Compare commits
1 Commits
v2.9.4-rc1
...
LAST_GOOD
Author | SHA1 | Date | |
---|---|---|---|
|
a02fc50b3e |
@@ -1,32 +0,0 @@
|
||||
Notes about plugins
|
||||
|
||||
|
||||
I have users that want to visit my pages with tclets, but they do not
|
||||
have the plugin. What can I do?
|
||||
|
||||
Add a pluginspage=http://www.sunlabs.com/tcl/plugin/ name=value
|
||||
pair to the embed statement. This will cause Navigator to find
|
||||
the plugin for your user and suggest they install it. The user
|
||||
is then prompted to download and install the plugin, and then she
|
||||
has to restart the browser and revisit your page. Very inconvenient
|
||||
and only slightly better than giving your users the broken image
|
||||
icon. Netscape says they are working on a more automatic solution.
|
||||
|
||||
|
||||
|
||||
|
||||
14. Your demos work just fine, but when I visit my own pages with tclets in
|
||||
them, at http://www.myserver.com/~mypages/mypage.html, I still get the
|
||||
broken image icon. Why doesn't it work for me?
|
||||
|
||||
This is likely because your web server -- the program that sends
|
||||
the pages to your browser when you click on a URL -- is not
|
||||
sending the right mime-type when it sends the '.tcl' file. You
|
||||
can work around this by adding a type=application/x-tcl name=value
|
||||
pair to the embed statement, which will cause Navigator to infer
|
||||
that it should use the Tcl plugin anyways. A better solution is
|
||||
to ask your system administrator to configure the web server to
|
||||
send the mime type application/x-tcl when it sends files with a
|
||||
'.tcl' extension. Nearly all web servers in the world nowadays
|
||||
are already configured to do this, the only ones we are aware of
|
||||
that do not are some older versions of Apache.
|
@@ -1 +0,0 @@
|
||||
I'm just here to force the creation of a LIB directory.
|
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds utilities for Win95, VC++ 4.0
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
THISDIR=$(WXDIR)\utils\nplugin
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
DEBUG_FLAGS="/Zi /FR"
|
||||
LINK_DEBUG_FLAGS="/RELEASE"
|
||||
|
||||
clean:
|
||||
cd $(WXDIR)\utils\nplugin\src
|
||||
nmake -f makefile.nt clean
|
||||
cd $(WXDIR)\utils\nplugin\samples\simple
|
||||
nmake -f makefile.nt clean
|
||||
cd $(WXDIR)\utils\nplugin\samples\gui
|
||||
nmake -f makefile.nt clean
|
||||
cd $(WXDIR)\utils\nplugin
|
||||
|
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* File: simple.cpp
|
||||
* Purpose: Minimal wxWindows plugin
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
/* static const char sccsid[] = "%W% %G%"; */
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include <fstream.h>
|
||||
|
||||
#include "NPApp.h"
|
||||
#include "NPFrame.h"
|
||||
|
||||
#define ID_HELLO 10
|
||||
|
||||
// Define a new application type
|
||||
class MyApp: public wxPluginApp
|
||||
{ public:
|
||||
virtual wxFrame *OnInit(void);
|
||||
virtual wxPluginFrame* OnNewInstance(const wxPluginData& data);
|
||||
};
|
||||
|
||||
// Define a new frame type
|
||||
class MyFrame: public wxPluginFrame
|
||||
{ public:
|
||||
MyFrame(const wxPluginData& data);
|
||||
|
||||
public:
|
||||
// Let's paint directly onto the 'frame'; we don't need a subwindow
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnHello(wxCommandEvent& event);
|
||||
|
||||
// Called when the file has been downloaded
|
||||
virtual void OnNPNewFile(NPStream *stream, const wxString& fname);
|
||||
|
||||
void CentreStrings(wxDC& dc);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
wxStringList m_strings;
|
||||
float m_xpos;
|
||||
float m_ypos;
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_SIZE(MyFrame::OnSize)
|
||||
EVT_PAINT(MyFrame::OnPaint)
|
||||
EVT_MOUSE_EVENTS(MyFrame::OnMouseEvent)
|
||||
EVT_BUTTON(ID_HELLO, MyFrame::OnHello)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
// No app initialisation necessary, and for a plugin there is no
|
||||
// top frame.
|
||||
wxFrame *MyApp::OnInit(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Called whenever a new plugin instance is called. We could check
|
||||
// various things here in 'data' but we won't bother.
|
||||
wxPluginFrame* MyApp::OnNewInstance(const wxPluginData& data)
|
||||
{
|
||||
// Implicitly added to list of plugin frames
|
||||
return new MyFrame(data);
|
||||
}
|
||||
|
||||
// My frame constructor
|
||||
MyFrame::MyFrame(const wxPluginData& data):
|
||||
wxPluginFrame(data)
|
||||
{
|
||||
m_xpos = -1;
|
||||
m_ypos = -1;
|
||||
|
||||
wxMenuBar *menuBar = new wxMenuBar;
|
||||
wxMenu *menu = new wxMenu;
|
||||
menu->Append(1, "E&xit");
|
||||
menuBar->Append(menu, "&File");
|
||||
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
new wxTextCtrl(this, -1, "", wxPoint(10, 30), wxSize(200, 25), wxSUNKEN_BORDER);
|
||||
new wxButton(this, ID_HELLO, "Hello", wxPoint(10, 70));
|
||||
}
|
||||
|
||||
void MyFrame::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
dc.SetBrush(*wxCYAN_BRUSH);
|
||||
dc.SetPen(*wxRED_PEN);
|
||||
|
||||
int w, h;
|
||||
GetClientSize(&w, &h);
|
||||
|
||||
dc.DrawRectangle(0, 0, w, h);
|
||||
|
||||
wxFont swissFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
dc.SetFont(swissFont);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
CentreStrings(dc);
|
||||
}
|
||||
|
||||
// Called when the file has been downloaded
|
||||
void MyFrame::OnNPNewFile(NPStream *stream, const wxString& fname)
|
||||
{
|
||||
ifstream str(fname);
|
||||
char buf[201];
|
||||
|
||||
while ( !str.eof() )
|
||||
{
|
||||
buf[0] = 0;
|
||||
str.getline(buf, 200);
|
||||
|
||||
if ( buf[0] != 0 )
|
||||
m_strings.Add(buf);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MyFrame::CentreStrings(wxDC& dc)
|
||||
{
|
||||
int y = 5;
|
||||
int cw, ch;
|
||||
GetClientSize(&cw, &ch);
|
||||
|
||||
wxNode *node = m_strings.First();
|
||||
while ( node )
|
||||
{
|
||||
char *s = (char *)node->Data();
|
||||
float w, h;
|
||||
dc.GetTextExtent(s, &w, &h);
|
||||
|
||||
int x = wxMax(0, (cw - w)/2);
|
||||
dc.DrawText(s, x, y);
|
||||
|
||||
y += h + (h/2);
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
// This implements a tiny doodling program. Drag the mouse using
|
||||
// the left button.
|
||||
void MyFrame::OnMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
float x, y;
|
||||
event.Position(&x, &y);
|
||||
wxClientDC dc(this);
|
||||
|
||||
if (m_xpos > -1 && m_ypos > -1 && event.Dragging() && event.LeftIsDown())
|
||||
{
|
||||
dc.SetPen(wxBLACK_PEN);
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.DrawLine(m_xpos, m_ypos, x, y);
|
||||
}
|
||||
m_xpos = x;
|
||||
m_ypos = y;
|
||||
}
|
||||
|
||||
void MyFrame::OnHello(wxCommandEvent& event)
|
||||
{
|
||||
wxMessageBox("Hello!");
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* File: gui.h
|
||||
* Purpose: wxWindows plugin with a few GUI elements
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
#ifndef __GUIH__
|
||||
#define __GUIH__
|
||||
|
||||
// Define a new application type
|
||||
class MyApp: public wxPluginApp
|
||||
{ public:
|
||||
virtual wxFrame *OnInit(void);
|
||||
virtual wxPluginFrame* OnNewInstance(const wxPluginData& data);
|
||||
};
|
||||
|
||||
class MyApp;
|
||||
class MyFrame;
|
||||
class MyCanvas;
|
||||
|
||||
class MyFrame: public wxPluginFrame
|
||||
{
|
||||
public:
|
||||
MyFrame(const wxPluginData& data);
|
||||
virtual ~MyFrame();
|
||||
|
||||
void OldOnMenuCommand(int id);
|
||||
|
||||
private:
|
||||
wxMenu* fileMenu;
|
||||
wxMenuBar* menuBar;
|
||||
MyCanvas* leftCanvas;
|
||||
MyCanvas* rightCanvas;
|
||||
wxSplitterWindow* splitter;
|
||||
};
|
||||
|
||||
class MyCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas(wxWindow* parent, int x, int y, int w, int h);
|
||||
virtual ~MyCanvas();
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ID for the menu quit command
|
||||
#define SPLIT_QUIT 1
|
||||
#define SPLIT_HORIZONTAL 2
|
||||
#define SPLIT_VERTICAL 3
|
||||
#define SPLIT_UNSPLIT 4
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1997
|
||||
# Updated:
|
||||
# Copyright: (c) 1997, Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds gui plugin example (MS VC++).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
# Application is a DLL
|
||||
DLL=1
|
||||
|
||||
EXTRAINC=/I$(WXDIR)\utils\nplugin\src
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
THISDIR = $(WXDIR)\utils\nplugin\examples\gui
|
||||
PROGRAM=npgui32
|
||||
PLUGINLIB=$(WXDIR)\utils\nplugin\lib\nplugin.lib
|
||||
|
||||
OBJECTS = gui.obj
|
||||
|
||||
all: $(PROGRAM).dll
|
||||
|
||||
$(PROGRAM): $(PROGRAM).exe
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt dllnp FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
# Update the dynamic link library
|
||||
|
||||
$(PROGRAM).dll: $(DUMMYOBJ) $(OBJECTS) $(WXDIR)\lib\wx.lib $(PLUGINLIB) $(PROGRAM).res $(PROGRAM).def
|
||||
$(link) $(LINKFLAGS) \
|
||||
-out:$(PROGRAM).dll \
|
||||
-def:$(PROGRAM).def \
|
||||
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res $(WXDIR)\lib\wx.lib $(PLUGINLIB) \
|
||||
$(guilibsdll) msvcrt.lib shell32.lib comctl32.lib ctl3d32.lib
|
||||
|
||||
gui.obj: gui.$(SRCSUFF) gui.h $(DUMMYOBJ)
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||
|
||||
copy:
|
||||
copy npgui32.dll "c:\program files\Netscape\Navigator\program\plugins"
|
||||
copy npgui32.dll "c:\program files\Internet Explorer\plugins"
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.sbr
|
||||
-erase *.pdb
|
||||
-erase *.dll
|
||||
-erase *.exp
|
||||
-erase *.lib
|
||||
-erase *.ilk
|
@@ -1,9 +0,0 @@
|
||||
LIBRARY NPGUI32
|
||||
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD SINGLE
|
||||
|
||||
EXPORTS
|
||||
NP_GetEntryPoints @1
|
||||
NP_Initialize @2
|
||||
NP_Shutdown @3
|
@@ -1,44 +0,0 @@
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Julian Smart\0"
|
||||
VALUE "FileDescription", "wxWindows GUI example plugin file\0"
|
||||
VALUE "FileVersion", "0.0.0.1\0"
|
||||
VALUE "InternalName", "wxWindows GUI Plugin\0"
|
||||
VALUE "LegalCopyright", "Copyright Julian Smart 1997\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename","npgui32.dll\0"
|
||||
VALUE "ProductName", "wxWindows GUI Plugin Sample\0"
|
||||
VALUE "ProductVersion", "0.0.0.1\0"
|
||||
VALUE "MIMEType", "wxgui/mime-type\0"
|
||||
VALUE "FileExtents", "gui\0"
|
||||
VALUE "FileOpenName", "wxWindows GUI (*.gui)\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
||||
|
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1997
|
||||
# Updated:
|
||||
# Copyright: (c) 1997, Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds simple plugin example (MS VC++).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
# Application is a DLL
|
||||
DLL=1
|
||||
|
||||
EXTRAINC=/I$(WXDIR)\utils\nplugin\src
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
THISDIR = $(WXDIR)\utils\nplugin\smples\simple
|
||||
PROGRAM=npsimple32
|
||||
PLUGINLIB=$(WXDIR)\utils\nplugin\lib\nplugin.lib
|
||||
|
||||
OBJECTS = simple.obj
|
||||
|
||||
all: $(PROGRAM).dll
|
||||
|
||||
$(PROGRAM): $(PROGRAM).exe
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt dllnp FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
# Update the dynamic link library
|
||||
|
||||
$(PROGRAM).dll: $(DUMMYOBJ) $(OBJECTS) $(WXDIR)\lib\wx.lib $(PLUGINLIB) $(PROGRAM).res $(PROGRAM).def
|
||||
$(link) $(LINKFLAGS) \
|
||||
-out:$(PROGRAM).dll \
|
||||
-def:$(PROGRAM).def \
|
||||
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res $(WXDIR)\lib\wx.lib $(PLUGINLIB) \
|
||||
$(guilibsdll) msvcrt.lib shell32.lib comctl32.lib ctl3d32.lib
|
||||
|
||||
simple.obj: simple.$(SRCSUFF) $(DUMMYOBJ)
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||
|
||||
copy:
|
||||
copy npsimple32.dll "c:\program files\Netscape\Navigator\program\plugins"
|
||||
copy npsimple32.dll "c:\program files\Internet Explorer\plugins"
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.sbr
|
||||
-erase *.pdb
|
||||
-erase *.dll
|
||||
-erase *.exp
|
||||
-erase *.lib
|
||||
-erase *.ilk
|
@@ -1,9 +0,0 @@
|
||||
LIBRARY NPSIMPLE32
|
||||
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD SINGLE
|
||||
|
||||
EXPORTS
|
||||
NP_GetEntryPoints @1
|
||||
NP_Initialize @2
|
||||
NP_Shutdown @3
|
@@ -1,44 +0,0 @@
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Julian Smart\0"
|
||||
VALUE "FileDescription", "wxWindows simple example plugin file\0"
|
||||
VALUE "FileVersion", "0.0.0.1\0"
|
||||
VALUE "InternalName", "wxWindows Simple Plugin\0"
|
||||
VALUE "LegalCopyright", "Copyright Julian Smart 1997\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename","npsimple32.dll\0"
|
||||
VALUE "ProductName", "wxWindows Simple Plugin Sample\0"
|
||||
VALUE "ProductVersion", "0.0.0.1\0"
|
||||
VALUE "MIMEType", "wxsimple/mime-type\0"
|
||||
VALUE "FileExtents", "smp\0"
|
||||
VALUE "FileOpenName", "wxWindows Simple (*.smp)\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
||||
|
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* File: simple.cpp
|
||||
* Purpose: Minimal wxWindows plugin
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
/* static const char sccsid[] = "%W% %G%"; */
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include <fstream.h>
|
||||
|
||||
#include "NPApp.h"
|
||||
#include "NPFrame.h"
|
||||
|
||||
// Define a new application type
|
||||
class MyApp: public wxPluginApp
|
||||
{ public:
|
||||
virtual wxFrame *OnInit(void);
|
||||
virtual wxPluginFrame* OnNewInstance(const wxPluginData& data);
|
||||
};
|
||||
|
||||
// Define a new frame type
|
||||
class MyFrame: public wxPluginFrame
|
||||
{ public:
|
||||
MyFrame(const wxPluginData& data);
|
||||
|
||||
public:
|
||||
// Let's paint directly onto the 'frame'; we don't need a subwindow
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
|
||||
// Called when the file has been downloaded
|
||||
virtual void OnNPNewFile(NPStream *stream, const wxString& fname);
|
||||
|
||||
void CentreStrings(wxDC& dc);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
wxStringList m_strings;
|
||||
long m_xpos;
|
||||
long m_ypos;
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_SIZE(MyFrame::OnSize)
|
||||
EVT_PAINT(MyFrame::OnPaint)
|
||||
EVT_MOUSE_EVENTS(MyFrame::OnMouseEvent)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
// No app initialisation necessary, and for a plugin there is no
|
||||
// top frame.
|
||||
wxFrame *MyApp::OnInit(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Called whenever a new plugin instance is called. We could check
|
||||
// various things here in 'data' but we won't bother.
|
||||
wxPluginFrame* MyApp::OnNewInstance(const wxPluginData& data)
|
||||
{
|
||||
// Implicitly added to list of plugin frames
|
||||
return new MyFrame(data);
|
||||
}
|
||||
|
||||
// My frame constructor
|
||||
MyFrame::MyFrame(const wxPluginData& data):
|
||||
wxPluginFrame(data)
|
||||
{
|
||||
m_xpos = -1;
|
||||
m_ypos = -1;
|
||||
}
|
||||
|
||||
void MyFrame::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
OnDraw(dc);
|
||||
}
|
||||
|
||||
void MyFrame::OnDraw(wxDC& dc)
|
||||
{
|
||||
dc.SetBrush(*wxCYAN_BRUSH);
|
||||
dc.SetPen(*wxRED_PEN);
|
||||
|
||||
int w, h;
|
||||
GetClientSize(&w, &h);
|
||||
|
||||
dc.DrawRectangle(0, 0, w, h);
|
||||
|
||||
wxFont swissFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
dc.SetFont(swissFont);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
CentreStrings(dc);
|
||||
}
|
||||
|
||||
// Called when the file has been downloaded
|
||||
void MyFrame::OnNPNewFile(NPStream *stream, const wxString& fname)
|
||||
{
|
||||
ifstream str(fname);
|
||||
char buf[201];
|
||||
|
||||
while ( !str.eof() )
|
||||
{
|
||||
buf[0] = 0;
|
||||
str.getline(buf, 200);
|
||||
|
||||
if ( buf[0] != 0 )
|
||||
m_strings.Add(buf);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MyFrame::CentreStrings(wxDC& dc)
|
||||
{
|
||||
int y = 5;
|
||||
int cw, ch;
|
||||
GetClientSize(&cw, &ch);
|
||||
|
||||
wxNode *node = m_strings.First();
|
||||
while ( node )
|
||||
{
|
||||
char *s = (char *)node->Data();
|
||||
long w, h;
|
||||
dc.GetTextExtent(s, &w, &h);
|
||||
|
||||
int x = wxMax(0, (cw - w)/2);
|
||||
dc.DrawText(s, x, y);
|
||||
|
||||
y += h + (h/2);
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
// This implements a tiny doodling program. Drag the mouse using
|
||||
// the left button.
|
||||
void MyFrame::OnMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
long x, y;
|
||||
event.Position(&x, &y);
|
||||
wxClientDC dc(this);
|
||||
|
||||
if (m_xpos > -1 && m_ypos > -1 && event.Dragging() && event.LeftIsDown())
|
||||
{
|
||||
dc.SetPen(wxBLACK_PEN);
|
||||
dc.SetBrush(wxTRANSPARENT_BRUSH);
|
||||
dc.DrawLine(m_xpos, m_ypos, x, y);
|
||||
}
|
||||
m_xpos = x;
|
||||
m_ypos = y;
|
||||
}
|
||||
|
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds controls example (MS VC++).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
# Application is a DLL
|
||||
DLL=1
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
PLUGINDIR = $(WXDIR)\utils\nplugin
|
||||
THISDIR = $(PLUGINDIR)\src
|
||||
LIBTARGET=$(PLUGINDIR)\lib\nplugin.lib
|
||||
|
||||
OBJECTS = npwin.obj npshell.obj NPFrame.obj NPApp.obj
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
wxclean:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt clean
|
||||
cd $(THISDIR)
|
||||
|
||||
$(LIBTARGET): $(OBJECTS)
|
||||
-erase $(LIBTARGET)
|
||||
$(implib) @<<
|
||||
-out:$(LIBTARGET)
|
||||
-machine:$(CPU)
|
||||
$(OBJECTS)
|
||||
<<
|
||||
|
||||
npwin.obj: npwin.cpp npapi.h npupp.h
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
npshell.obj: npshell.cpp npapi.h NPApp.h NPFrame.h
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
NPFrame.obj: NPFrame.cpp NPFrame.h NPApp.h npapi.h
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
NPApp.obj: NPApp.cpp NPApp.h NPFrame.h npapi.h
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.sbr
|
||||
-erase *.pdb
|
||||
-erase *.dll
|
||||
-erase *.exp
|
||||
-erase *.ilk
|
||||
-erase $(LIBTARGET)
|
@@ -1,258 +0,0 @@
|
||||
/*
|
||||
* npapi.h $Revision$
|
||||
* Netscape client plug-in API spec
|
||||
*/
|
||||
|
||||
#ifndef _NPAPI_H_
|
||||
#define _NPAPI_H_
|
||||
|
||||
|
||||
/* XXX this needs to get out of here */
|
||||
#if defined(__MWERKS__)
|
||||
#ifndef XP_MAC
|
||||
#define XP_MAC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Version constants
|
||||
*/
|
||||
|
||||
#define NP_VERSION_MAJOR 0
|
||||
#define NP_VERSION_MINOR 6
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Basic types
|
||||
*/
|
||||
|
||||
#ifndef _UINT16
|
||||
typedef unsigned short uint16;
|
||||
#endif
|
||||
#ifndef _UINT32
|
||||
typedef unsigned long uint32;
|
||||
#endif
|
||||
#ifndef _INT16
|
||||
typedef short int16;
|
||||
#endif
|
||||
#ifndef _INT32
|
||||
typedef long int32;
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
#ifndef NULL
|
||||
#define NULL (0L)
|
||||
#endif
|
||||
|
||||
typedef unsigned char NPBool;
|
||||
typedef void* NPEvent;
|
||||
typedef int16 NPError;
|
||||
typedef char* NPMIMEType;
|
||||
|
||||
|
||||
/*
|
||||
* NPP is a plug-in's opaque instance handle
|
||||
*/
|
||||
typedef struct _NPP
|
||||
{
|
||||
void* pdata; /* plug-in private data */
|
||||
void* ndata; /* netscape private data */
|
||||
} NPP_t;
|
||||
|
||||
typedef NPP_t* NPP;
|
||||
|
||||
|
||||
|
||||
typedef struct _NPStream
|
||||
{
|
||||
void* pdata; /* plug-in private data */
|
||||
void* ndata; /* netscape private data */
|
||||
const char* url;
|
||||
uint32 end;
|
||||
uint32 lastmodified;
|
||||
} NPStream;
|
||||
|
||||
typedef struct _NPByteRange
|
||||
{
|
||||
int32 offset; /* negative offset means from the end */
|
||||
uint32 length;
|
||||
struct _NPByteRange* next;
|
||||
} NPByteRange;
|
||||
|
||||
|
||||
typedef struct _NPSavedData
|
||||
{
|
||||
int32 len;
|
||||
void* buf;
|
||||
} NPSavedData;
|
||||
|
||||
|
||||
|
||||
typedef struct _NPRect
|
||||
{
|
||||
uint16 top;
|
||||
uint16 left;
|
||||
uint16 bottom;
|
||||
uint16 right;
|
||||
} NPRect;
|
||||
|
||||
typedef struct _NPWindow
|
||||
{
|
||||
void* window; /* platform specific window handle */
|
||||
uint32 x; /* position of top left corner relative to a netscape page */
|
||||
uint32 y;
|
||||
uint32 width; /* maximum window size */
|
||||
uint32 height;
|
||||
NPRect clipRect; /* clipping rectangle in port coordinates */
|
||||
} NPWindow;
|
||||
|
||||
|
||||
|
||||
typedef struct _NPFullPrint
|
||||
{
|
||||
NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen printing */
|
||||
NPBool printOne; /* TRUE if plugin should print one copy to default printer */
|
||||
void* platformPrint; /* Platform-specific printing info */
|
||||
} NPFullPrint;
|
||||
|
||||
typedef struct _NPEmbedPrint
|
||||
{
|
||||
NPWindow window;
|
||||
void* platformPrint; /* Platform-specific printing info */
|
||||
} NPEmbedPrint;
|
||||
|
||||
typedef struct _NPPrint
|
||||
{
|
||||
uint16 mode; /* NP_FULL or NP_EMBED */
|
||||
union
|
||||
{
|
||||
NPFullPrint fullPrint; /* if mode is NP_FULL */
|
||||
NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
|
||||
} print;
|
||||
} NPPrint;
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
|
||||
/*
|
||||
* Mac-specific structures and definitions.
|
||||
*/
|
||||
|
||||
#include <Quickdraw.h>
|
||||
#include <Events.h>
|
||||
|
||||
typedef struct NP_Port
|
||||
{
|
||||
CGrafPtr port; /* Grafport */
|
||||
int32 portx; /* position inside the topmost window */
|
||||
int32 porty;
|
||||
} NP_Port;
|
||||
|
||||
/*
|
||||
* Non-standard event types that can be passed to HandleEvent
|
||||
*/
|
||||
#define getFocusEvent (osEvt + 16)
|
||||
#define loseFocusEvent (osEvt + 17)
|
||||
#define adjustCursorEvent (osEvt + 18)
|
||||
|
||||
#endif /* XP_MAC */
|
||||
|
||||
|
||||
|
||||
|
||||
#define NP_EMBED 1
|
||||
#define NP_FULL 2
|
||||
#define NP_BACKGROUND 3
|
||||
|
||||
#define NP_NORMAL 1
|
||||
#define NP_SEEK 2
|
||||
#define NP_ASFILE 3
|
||||
|
||||
#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
|
||||
|
||||
|
||||
/*
|
||||
* Error and reason code definitions.
|
||||
*/
|
||||
|
||||
#define NP_NOERR 0
|
||||
#define NP_EINVAL 1
|
||||
#define NP_EABORT 2
|
||||
|
||||
#define NPERR_BASE 0
|
||||
#define NPERR_NO_ERROR (NPERR_BASE + 0)
|
||||
#define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
|
||||
#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
|
||||
#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
|
||||
#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
|
||||
#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
|
||||
#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
|
||||
#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
|
||||
#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
|
||||
|
||||
#define NPRES_BASE 0
|
||||
#define NPRES_NETWORK_ERR (NPRES_BASE + 0)
|
||||
#define NPRES_USER_BREAK (NPRES_BASE + 1)
|
||||
#define NPRES_DONE (NPRES_BASE + 3)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Function prototypes.
|
||||
* Functions beginning with 'NPP' are functions provided by the plugin that Netscape will call.
|
||||
* Functions beginning with 'NPN' are functions provided by Netscape that the plugin will call.
|
||||
*/
|
||||
|
||||
#if defined(_WINDOWS) && !defined(__WIN32__)
|
||||
#define NP_LOADDS _loadds
|
||||
#else
|
||||
#define NP_LOADDS
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
NPError NPP_Initialize(void);
|
||||
void NPP_Shutdown(void);
|
||||
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
|
||||
NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
|
||||
NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
|
||||
NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
|
||||
NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, NPError reason);
|
||||
int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
|
||||
int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
|
||||
void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
|
||||
void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
|
||||
int16 NPP_HandleEvent(NPP instance, void* event);
|
||||
|
||||
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor);
|
||||
NPError NPN_GetURL(NPP instance, const char* url, const char* window);
|
||||
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
|
||||
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
|
||||
NPError NPN_NewStream(NPP instance, NPMIMEType type, NPStream* stream);
|
||||
int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
|
||||
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason);
|
||||
void NPN_Status(NPP instance, const char* message);
|
||||
const char* NPN_UserAgent(NPP instance);
|
||||
void* NPN_MemAlloc(uint32 size);
|
||||
void NPN_MemFree(void* ptr);
|
||||
uint32 NPN_MemFlush(uint32 size);
|
||||
void NPN_ReloadPlugins(NPBool reloadPages);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _NPAPI_H_ */
|
||||
|
@@ -1,277 +0,0 @@
|
||||
/*
|
||||
* File: NPApp.cc
|
||||
* Purpose: wxPluginApp implementation
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "NPApp.h"
|
||||
#include "NPFrame.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxPluginApp, wxApp)
|
||||
|
||||
wxPluginApp *wxGetPluginApp(void)
|
||||
{
|
||||
if ( wxTheApp && wxTheApp->IsKindOf(CLASSINFO(wxPluginApp)))
|
||||
return (wxPluginApp *)wxTheApp;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxPluginApp::wxPluginApp(void)
|
||||
{
|
||||
m_data.m_argc = NULL;
|
||||
m_data.m_argn = NULL;
|
||||
m_data.m_argv = NULL;
|
||||
m_data.m_type = 0;
|
||||
m_data.m_instance = 0;
|
||||
m_data.m_mode = 0;
|
||||
m_data.m_window = 0;
|
||||
}
|
||||
|
||||
wxPluginApp::~wxPluginApp(void)
|
||||
{
|
||||
if ( m_data.m_argn )
|
||||
delete[] m_data.m_argn;
|
||||
if ( m_data.m_argv )
|
||||
delete[] m_data.m_argv;
|
||||
}
|
||||
|
||||
// Add a frame
|
||||
void wxPluginApp::AddFrame(wxPluginFrame *frame)
|
||||
{
|
||||
m_frames.Append(frame);
|
||||
}
|
||||
|
||||
// Remove a frame
|
||||
void wxPluginApp::RemoveFrame(wxPluginFrame *frame)
|
||||
{
|
||||
m_frames.DeleteObject(frame);
|
||||
}
|
||||
|
||||
// Find a frame given a NP instance
|
||||
wxPluginFrame *wxPluginApp::FindFrame(NPP instance)
|
||||
{
|
||||
wxNode *node = m_frames.First();
|
||||
while ( node )
|
||||
{
|
||||
wxPluginFrame *frame = (wxPluginFrame *)node->Data();
|
||||
if ( frame->GetInstance() == instance )
|
||||
{
|
||||
return frame;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxPluginApp::SetAttributeValues(const int n, char *argn[], char *argv[])
|
||||
{
|
||||
if ( m_data.m_argn )
|
||||
delete[] m_data.m_argn;
|
||||
if ( m_data.m_argv )
|
||||
delete[] m_data.m_argv;
|
||||
|
||||
m_data.m_argc = n;
|
||||
|
||||
m_data.m_argn = new wxString[n];
|
||||
m_data.m_argv = new wxString[n];
|
||||
int i;
|
||||
for ( i = 0; i < n ; i ++)
|
||||
{
|
||||
m_data.m_argn[i] = argn[i];
|
||||
m_data.m_argv[i] = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Netscape Plugin API calls routed via wxPluginApp
|
||||
|
||||
NPError wxPluginApp::NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
{
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
frame->OnClose();
|
||||
delete frame;
|
||||
}
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
NPError wxPluginApp::NPP_DestroyStream(NPP instance, NPStream* stream, NPError reason)
|
||||
{
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
jref wxPluginApp::NPP_GetJavaClass(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
NPError wxPluginApp::NPP_Initialize(void)
|
||||
{
|
||||
static int init = FALSE;
|
||||
|
||||
if ( init == TRUE )
|
||||
MessageBox(NULL, "wxPluginApp::NPP_Initialize:\nabout to call wxEntry for 2nd time!!!", "wxPlugin", MB_OK);
|
||||
|
||||
wxEntry((WXHINSTANCE) GetModuleHandle(NULL));
|
||||
|
||||
init = TRUE;
|
||||
|
||||
// MessageBox(NULL, "wxPluginApp::NPP_Initialize: have called wxEntry", "wxPlugin", MB_OK);
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
NPError wxPluginApp::NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode,
|
||||
int16 argc, char* argn[], char* argv[], NPSavedData* saved)
|
||||
{
|
||||
// MessageBox(NULL, "wxPluginApp::NPP_New", "wxPlugin", MB_OK);
|
||||
|
||||
// Save values so frame can be created in first NPP_SetWindow
|
||||
if ( m_data.m_instance != 0 )
|
||||
{
|
||||
MessageBox(NULL, "wxPluginApp::NPP_New: whoops, 2 NPP_New calls in succession without NPP_SetWindow.\n Need to modify my code!", "wxPlugin", MB_OK);
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
m_data.m_instance = instance;
|
||||
m_data.m_type = pluginType;
|
||||
m_data.m_mode = mode;
|
||||
|
||||
SetAttributeValues(argc, argn, argv);
|
||||
|
||||
// Unfortunately, we may get a stream event before we've got a valid window
|
||||
// handle, so we just have to go ahead and create a new instance.
|
||||
wxPluginFrame *frame = OnNewInstance(m_data);
|
||||
|
||||
m_data.m_instance = NULL;
|
||||
m_data.m_window = NULL;
|
||||
delete[] m_data.m_argv;
|
||||
delete[] m_data.m_argn;
|
||||
m_data.m_argv = NULL;
|
||||
m_data.m_argn = NULL;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
NPError wxPluginApp::NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream,
|
||||
NPBool seekable, uint16* stype)
|
||||
{
|
||||
// By default, we want to receive a file instead of a stream.
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
return frame->OnNPNewStream(type, stream, seekable, stype);
|
||||
}
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
void wxPluginApp::NPP_Print(NPP instance, NPPrint* printInfo)
|
||||
{
|
||||
if (instance == NULL)
|
||||
return;
|
||||
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
frame->OnNPPrint(printInfo);
|
||||
}
|
||||
}
|
||||
|
||||
NPError wxPluginApp::NPP_SetWindow(NPP instance, NPWindow* window)
|
||||
{
|
||||
// MessageBox(NULL, "wxPluginApp::NPP_SetWindow", "wxPlugin", MB_OK);
|
||||
|
||||
if ( window )
|
||||
wxDebugMsg("%d\n", (int) window->window);
|
||||
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
frame->SetNPWindow(window);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
// No such frame: must make it.
|
||||
if ( m_data.m_instance == NULL )
|
||||
{
|
||||
MessageBox(NULL, "wxPluginApp::NPP_SetWindow: whoops, no data to create window. SetWindow called in funny order?", "wxPlugin", MB_OK);
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
if ( window->window == NULL )
|
||||
{
|
||||
// We're receiving a NULL window before we've even received
|
||||
// a valid window. Ignore this silly thing.
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
m_data.m_window = window;
|
||||
m_data.m_instance = instance;
|
||||
|
||||
// wxPluginFrame *frame = OnNewInstance(m_data);
|
||||
|
||||
m_data.m_instance = NULL;
|
||||
m_data.m_window = NULL;
|
||||
delete[] m_data.m_argv;
|
||||
delete[] m_data.m_argn;
|
||||
m_data.m_argv = NULL;
|
||||
m_data.m_argn = NULL;
|
||||
#endif
|
||||
}
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
void wxPluginApp::NPP_Shutdown(void)
|
||||
{
|
||||
// Clean up wxWindows
|
||||
CleanUp();
|
||||
}
|
||||
|
||||
void wxPluginApp::NPP_StreamAsFile(NPP instance, NPStream* stream, const char *fname)
|
||||
{
|
||||
wxPluginFrame *frame = FindFrame(instance);
|
||||
if ( frame )
|
||||
{
|
||||
wxString str(fname);
|
||||
frame->OnNPNewFile(stream, str);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void wxPluginApp::NPP_URLNotify(NPP instance, const char* url, NPReason reason,
|
||||
void* notifyData)
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
int32 wxPluginApp::NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
|
||||
void* buf)
|
||||
{
|
||||
return len; // The number of bytes accepted
|
||||
}
|
||||
|
||||
static int32 STREAMBUFSIZE = 0X0FFFFFFF; // If we are reading from a file in NPAsFile
|
||||
// mode so we can take any size stream in our
|
||||
// write call (since we ignore it)
|
||||
|
||||
int32 wxPluginApp::NPP_WriteReady(NPP instance, NPStream* stream)
|
||||
{
|
||||
return STREAMBUFSIZE; // Number of bytes ready to accept in NPP_Write()
|
||||
}
|
||||
|
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* File: NPApp.h
|
||||
* Purpose: wxPluginApp declaration
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
#ifndef __PLUGINAPP__
|
||||
#define __PLUGINAPP__
|
||||
|
||||
#include "wx/wx.h"
|
||||
#include "npapi.h"
|
||||
|
||||
class wxPluginFrame;
|
||||
|
||||
// Data passed to OnNewInstance
|
||||
class wxPluginData
|
||||
{
|
||||
public:
|
||||
NPP m_instance;
|
||||
NPMIMEType m_type;
|
||||
NPWindow* m_window;
|
||||
int m_mode;
|
||||
int m_argc;
|
||||
wxString* m_argn;
|
||||
wxString* m_argv;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPluginApp: public wxApp
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxPluginApp)
|
||||
|
||||
public:
|
||||
wxPluginApp(void);
|
||||
~wxPluginApp(void);
|
||||
|
||||
// Find a frame given a NP instance
|
||||
wxPluginFrame *FindFrame(NPP instance);
|
||||
|
||||
// Add a frame
|
||||
void AddFrame(wxPluginFrame *frame);
|
||||
|
||||
// Remove a frame
|
||||
void RemoveFrame(wxPluginFrame *frame);
|
||||
|
||||
// Set attribute/values for the last instance
|
||||
void SetAttributeValues(const int n, char *argn[], char *argv[]);
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Higher-level API than NP API
|
||||
virtual wxPluginFrame *OnNewInstance(const wxPluginData& data) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Netscape Plugin API calls routed via wxPluginApp
|
||||
|
||||
virtual NPError NPP_Destroy(NPP instance, NPSavedData** save);
|
||||
virtual NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPError reason);
|
||||
// virtual jref NPP_GetJavaClass(void);
|
||||
virtual NPError NPP_Initialize(void);
|
||||
virtual NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode,
|
||||
int16 argc, char* argn[], char* argv[], NPSavedData* saved);
|
||||
virtual NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream,
|
||||
NPBool seekable, uint16* stype);
|
||||
virtual void NPP_Print(NPP instance, NPPrint* platformPrint);
|
||||
virtual NPError NPP_SetWindow(NPP instance, NPWindow* window);
|
||||
virtual void NPP_Shutdown(void);
|
||||
virtual void NPP_StreamAsFile(NPP instance, NPStream* stream, const char *fname);
|
||||
/*
|
||||
virtual void NPP_URLNotify(NPP instance, const char* url, NPReason reason,
|
||||
void* notifyData);
|
||||
*/
|
||||
virtual int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
|
||||
void* buf);
|
||||
virtual int32 NPP_WriteReady(NPP instance, NPStream* stream);
|
||||
|
||||
protected:
|
||||
|
||||
// List of plugin frames
|
||||
wxList m_frames;
|
||||
|
||||
// Temporary NPP_New arguments so we can wait until NPP_SetWindow is called
|
||||
// before creating a frame
|
||||
wxPluginData m_data;
|
||||
};
|
||||
|
||||
wxPluginApp *wxGetPluginApp(void);
|
||||
|
||||
#endif
|
||||
|
@@ -1,293 +0,0 @@
|
||||
/*
|
||||
* File: NPFrame.cc
|
||||
* Purpose: wxPluginFrame implementation
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcprint.h"
|
||||
|
||||
#include "NPFrame.h"
|
||||
#include "NPApp.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern wxList wxModelessWindows;
|
||||
extern char wxFrameClassName[];
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPluginFrame, wxFrame)
|
||||
|
||||
wxPluginFrame::wxPluginFrame(void)
|
||||
{
|
||||
m_npWindow = NULL;
|
||||
m_npInstance = NULL;
|
||||
m_nAttributes = 0;
|
||||
m_names = NULL;
|
||||
m_values = NULL;
|
||||
}
|
||||
|
||||
bool wxPluginFrame::Create(const wxPluginData& data)
|
||||
{
|
||||
SetName("pluginFrame");
|
||||
|
||||
m_npWindow = NULL;
|
||||
m_npInstance = NULL;
|
||||
m_nAttributes = 0;
|
||||
m_names = NULL;
|
||||
m_values = NULL;
|
||||
m_npWindow = data.m_window;
|
||||
m_npInstance = data.m_instance;
|
||||
|
||||
SetAttributeValues(data.m_argc, data.m_argn, data.m_argv);
|
||||
SetNPWindow(data.m_window);
|
||||
|
||||
wxModelessWindows.Append(this);
|
||||
|
||||
if (wxTheApp->IsKindOf(CLASSINFO(wxPluginApp)))
|
||||
{
|
||||
((wxPluginApp *)wxTheApp)->AddFrame(this);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxPluginFrame::~wxPluginFrame(void)
|
||||
{
|
||||
if (wxTheApp->IsKindOf(CLASSINFO(wxPluginApp)))
|
||||
{
|
||||
((wxPluginApp *)wxTheApp)->RemoveFrame(this);
|
||||
}
|
||||
|
||||
if ( GetHWND() )
|
||||
UnsubclassWin();
|
||||
m_hWnd = 0;
|
||||
|
||||
if ( m_names )
|
||||
delete[] m_names;
|
||||
if ( m_values )
|
||||
delete[] m_values;
|
||||
}
|
||||
|
||||
// Get size *available for subwindows* i.e. excluding menu bar etc.
|
||||
// For XView, this is the same as GetSize
|
||||
void wxPluginFrame::GetClientSize(int *x, int *y) const
|
||||
{
|
||||
if ( !m_hWnd )
|
||||
{
|
||||
*x = 0; *y = 0;
|
||||
return;
|
||||
}
|
||||
wxFrame::GetClientSize(x, y);
|
||||
}
|
||||
|
||||
// Set the client size (i.e. leave the calculation of borders etc.
|
||||
// to wxWindows)
|
||||
void wxPluginFrame::SetClientSize(const int width, const int height)
|
||||
{
|
||||
if ( !m_hWnd )
|
||||
return ;
|
||||
|
||||
wxFrame::SetClientSize(width, height);
|
||||
}
|
||||
|
||||
void wxPluginFrame::GetSize(int *width, int *height) const
|
||||
{
|
||||
if ( !m_hWnd )
|
||||
{
|
||||
*width = 0; *height = 0;
|
||||
return;
|
||||
}
|
||||
wxFrame::GetSize(width, height);
|
||||
}
|
||||
|
||||
void wxPluginFrame::GetPosition(int *x, int *y) const
|
||||
{
|
||||
if ( !m_hWnd )
|
||||
{
|
||||
*x = 0; *y = 0;
|
||||
return;
|
||||
}
|
||||
wxFrame::GetPosition(x, y);
|
||||
}
|
||||
|
||||
void wxPluginFrame::SetAttributeValues(const int n, const char *argn[], const char *argv[])
|
||||
{
|
||||
if ( m_names )
|
||||
delete[] m_names;
|
||||
if ( m_values )
|
||||
delete[] m_values;
|
||||
|
||||
m_nAttributes = n;
|
||||
|
||||
m_names = new wxString[n];
|
||||
m_values = new wxString[n];
|
||||
int i;
|
||||
for ( i = 0; i < n ; i ++)
|
||||
{
|
||||
m_names[i] = argn[i];
|
||||
m_values[i] = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
void wxPluginFrame::SetAttributeValues(const int n, const wxString* argn, const wxString* argv)
|
||||
{
|
||||
if ( m_names )
|
||||
delete[] m_names;
|
||||
if ( m_values )
|
||||
delete[] m_values;
|
||||
|
||||
m_nAttributes = n;
|
||||
|
||||
m_names = new wxString[n];
|
||||
m_values = new wxString[n];
|
||||
int i;
|
||||
for ( i = 0; i < n ; i ++)
|
||||
{
|
||||
m_names[i] = argn[i];
|
||||
m_values[i] = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
void wxPluginFrame::SetSize(const int x, const int y, const int width, const int height, const int sizeFlags)
|
||||
{
|
||||
// Can't allow app to set the size.
|
||||
return;
|
||||
}
|
||||
|
||||
// Sets and subclasses the platform-specific window handle
|
||||
bool wxPluginFrame::SetNPWindow(NPWindow *window)
|
||||
{
|
||||
if ( !window || !window->window)
|
||||
{
|
||||
if ( m_hWnd )
|
||||
{
|
||||
wxMessageBox("Unsubclassing window prematurely");
|
||||
UnsubclassWin();
|
||||
m_hWnd = 0;
|
||||
}
|
||||
m_npWindow = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_hWnd )
|
||||
{
|
||||
if ( m_hWnd == (WXHWND) window->window )
|
||||
{
|
||||
// Does this mean a resize?
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_npWindow = window;
|
||||
m_hWnd = (WXHWND) window->window;
|
||||
SubclassWin(m_hWnd);
|
||||
m_windowId = ::GetWindowLong((HWND) m_hWnd, GWL_ID);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
NPError wxPluginFrame::OnNPNewStream(NPMIMEType type, NPStream *stream, bool seekable, uint16* stype)
|
||||
{
|
||||
*stype = NP_ASFILE;
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
void wxPluginFrame::OnNPNewFile(NPStream *stream, const wxString& fname)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPluginFrame::OnNPPrint(NPPrint* printInfo)
|
||||
{
|
||||
if (printInfo->mode == NP_FULL)
|
||||
{
|
||||
//
|
||||
// *Developers*: If your plugin would like to take over
|
||||
// printing completely when it is in full-screen mode,
|
||||
// set printInfo->pluginPrinted to TRUE and print your
|
||||
// plugin as you see fit. If your plugin wants Netscape
|
||||
// to handle printing in this case, set printInfo->pluginPrinted
|
||||
// to FALSE (the default) and do nothing. If you do want
|
||||
// to handle printing yourself, printOne is true if the
|
||||
// print button (as opposed to the print menu) was clicked.
|
||||
// On the Macintosh, platformPrint is a THPrint; on Windows,
|
||||
// platformPrint is a structure (defined in npapi.h) containing
|
||||
// the printer name, port, etc.
|
||||
//
|
||||
void* platformPrint = printInfo->print.fullPrint.platformPrint;
|
||||
NPBool printOne = printInfo->print.fullPrint.printOne;
|
||||
|
||||
printInfo->print.fullPrint.pluginPrinted = FALSE; // Do the default
|
||||
|
||||
}
|
||||
else // If not fullscreen, we must be embedded
|
||||
{
|
||||
//
|
||||
// *Developers*: If your plugin is embedded, or is full-screen
|
||||
// but you returned false in pluginPrinted above, NPP_Print
|
||||
// will be called with mode == NP_EMBED. The NPWindow
|
||||
// in the printInfo gives the location and dimensions of
|
||||
// the embedded plugin on the printed page. On the Macintosh,
|
||||
// platformPrint is the printer port; on Windows, platformPrint
|
||||
// is the handle to the printing device context.
|
||||
//
|
||||
NPWindow* printWindow = &(printInfo->print.embedPrint.window);
|
||||
void* platformPrint = printInfo->print.embedPrint.platformPrint;
|
||||
|
||||
HDC hDC = (HDC) platformPrint;
|
||||
wxRectangle rect;
|
||||
rect.x = printWindow->x;
|
||||
rect.y = printWindow->y;
|
||||
rect.width = printWindow->width;
|
||||
rect.height = printWindow->height;
|
||||
|
||||
int saveIt = ::SaveDC(hDC);
|
||||
|
||||
wxPrinterDC *printerDC = new wxPrinterDC((WXHDC) hDC);
|
||||
|
||||
OnPrint(*printerDC, rect);
|
||||
|
||||
printerDC->SetHDC(0);
|
||||
delete printerDC;
|
||||
|
||||
::RestoreDC(hDC, saveIt);
|
||||
}
|
||||
}
|
||||
|
||||
void wxPluginFrame::OnPrint(wxPrinterDC& dc, wxRectangle& rect)
|
||||
{
|
||||
// We must do some transformations here
|
||||
RECT winRect;
|
||||
/*
|
||||
winRect.left = rect.x;
|
||||
winRect.top = rect.y;
|
||||
winRect.right = rect.x + rect.right;
|
||||
winRect.bottom = rect.y + rect.height;
|
||||
*/
|
||||
POINT winPoint[2];
|
||||
winPoint[0].x = rect.x;
|
||||
winPoint[0].y = rect.y;
|
||||
winPoint[1].x = rect.x + rect.width;
|
||||
winPoint[1].y = rect.y + rect.height;
|
||||
|
||||
if (!LPtoDP((HDC) dc.GetHDC(), winPoint, 2))
|
||||
wxMessageBox("LPtoDP failed.");
|
||||
|
||||
OnDraw(dc);
|
||||
}
|
||||
|
||||
void wxPluginFrame::OnDraw(wxDC& dc)
|
||||
{
|
||||
}
|
||||
|
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* File: NPFrame.h
|
||||
* Purpose: wxPluginFrame declaration
|
||||
* Author: Julian Smart
|
||||
* Created: 1997
|
||||
* Updated:
|
||||
* Copyright: (c) Julian Smart
|
||||
*/
|
||||
|
||||
#ifndef __PLUGINFRAME__
|
||||
#define __PLUGINFRAME__
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include "NPApp.h"
|
||||
#include "npapi.h"
|
||||
|
||||
WXDLLEXPORT extern const char *wxFrameNameStr;
|
||||
|
||||
class wxPrinterDC;
|
||||
class WXDLLEXPORT wxPluginFrame: public wxFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPluginFrame)
|
||||
|
||||
public:
|
||||
wxPluginFrame(void);
|
||||
inline wxPluginFrame(const wxPluginData& data)
|
||||
{
|
||||
m_npWindow = NULL;
|
||||
m_npInstance = NULL;
|
||||
m_nAttributes = 0;
|
||||
m_names = NULL;
|
||||
m_values = NULL;
|
||||
|
||||
Create(data);
|
||||
}
|
||||
|
||||
~wxPluginFrame(void);
|
||||
|
||||
bool Create(const wxPluginData& data);
|
||||
|
||||
// Sets and subclasses the platform-specific window handle
|
||||
virtual bool SetNPWindow(NPWindow *window);
|
||||
inline NPWindow *GetNPWindow(void) { return m_npWindow; }
|
||||
|
||||
void SetClientSize(const int width, const int height);
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
void GetSize(int *width, int *height) const ;
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Accessors
|
||||
inline int GetAttributeCount(void) const { return m_nAttributes; }
|
||||
inline wxString GetAttributeName(const int n) { return m_names[n]; }
|
||||
inline wxString GetAttributeValue(const int n) { return m_values[n]; }
|
||||
|
||||
void SetAttributeValues(const int n, const char* argn[], const char *argv[]);
|
||||
void SetAttributeValues(const int n, const wxString* argn, const wxString* argv);
|
||||
inline void SetInstance(const NPP instance) { m_npInstance = instance; };
|
||||
inline NPP GetInstance(void) { return m_npInstance; }
|
||||
|
||||
// Overridables: low-level
|
||||
virtual NPError OnNPNewStream(NPMIMEType type, NPStream *stream, bool seekable, uint16* stype);
|
||||
virtual void OnNPNewFile(NPStream *stream, const wxString& fname);
|
||||
virtual void OnNPPrint(NPPrint* printInfo);
|
||||
|
||||
// Overridables: high-level
|
||||
virtual void OnPrint(wxPrinterDC& dc, wxRectangle& rect);
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
|
||||
protected:
|
||||
|
||||
wxString* m_names;
|
||||
wxString* m_values;
|
||||
int m_nAttributes;
|
||||
NPP m_npInstance;
|
||||
NPWindow* m_npWindow;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,278 +0,0 @@
|
||||
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
//
|
||||
// npshell.cpp
|
||||
//
|
||||
// This file defines a "shell" plugin that plugin developers can use
|
||||
// as the basis for a real plugin. This shell just provides empty
|
||||
// implementations of all functions that the plugin can implement
|
||||
// that will be called by Netscape (the NPP_xxx methods defined in
|
||||
// npapi.h).
|
||||
//
|
||||
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
#ifndef _NPAPI_H_
|
||||
#include "npapi.h"
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "NPApp.h"
|
||||
|
||||
//
|
||||
// Instance state information about the plugin.
|
||||
//
|
||||
// *Developers*: Use this struct to hold per-instance
|
||||
// information that you'll need in the
|
||||
// various functions in this file.
|
||||
//
|
||||
typedef struct _PluginInstance
|
||||
{
|
||||
NPWindow* fWindow;
|
||||
uint16 fMode;
|
||||
|
||||
} PluginInstance;
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_Initialize:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NPP_Initialize(void)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_Initialize", "NPTest", MB_OK);
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_Initialize();
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_Shutdown:
|
||||
//------------------------------------------------------------------------------------
|
||||
void NPP_Shutdown(void)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_Shutdown", "wxPlugin", MB_OK);
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
app->NPP_Shutdown();
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_New:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NP_LOADDS
|
||||
NPP_New(NPMIMEType pluginType,
|
||||
NPP instance,
|
||||
uint16 mode,
|
||||
int16 argc,
|
||||
char* argn[],
|
||||
char* argv[],
|
||||
NPSavedData* saved)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_New", "NPTest", MB_OK);
|
||||
|
||||
if (instance == NULL)
|
||||
return NPERR_INVALID_INSTANCE_ERROR;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_Destroy:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NP_LOADDS
|
||||
NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_Destroy", "NPTest", MB_OK);
|
||||
|
||||
if (instance == NULL)
|
||||
return NPERR_INVALID_INSTANCE_ERROR;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_Destroy(instance, save);
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_SetWindow:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NP_LOADDS
|
||||
NPP_SetWindow(NPP instance, NPWindow* window)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_SetWindow", "NPTest", MB_OK);
|
||||
|
||||
if (instance == NULL)
|
||||
return NPERR_INVALID_INSTANCE_ERROR;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_SetWindow(instance, window);
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_NewStream:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NP_LOADDS
|
||||
NPP_NewStream(NPP instance,
|
||||
NPMIMEType type,
|
||||
NPStream *stream,
|
||||
NPBool seekable,
|
||||
uint16 *stype)
|
||||
{
|
||||
// MessageBox(NULL, "NPP_NewStream", "NPTest", MB_OK);
|
||||
|
||||
if (instance == NULL)
|
||||
return NPERR_INVALID_INSTANCE_ERROR;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_NewStream(instance, type, stream, seekable, stype);
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// *Developers*:
|
||||
// These next 2 functions are directly relevant in a plug-in which handles the
|
||||
// data in a streaming manner. If you want zero bytes because no buffer space
|
||||
// is YET available, return 0. As long as the stream has not been written
|
||||
// to the plugin, Navigator will continue trying to send bytes. If the plugin
|
||||
// doesn't want them, just return some large number from NPP_WriteReady(), and
|
||||
// ignore them in NPP_Write(). For a NP_ASFILE stream, they are still called
|
||||
// but can safely be ignored using this strategy.
|
||||
//
|
||||
|
||||
static int32 STREAMBUFSIZE = 0X0FFFFFFF; // If we are reading from a file in NPAsFile
|
||||
// mode so we can take any size stream in our
|
||||
// write call (since we ignore it)
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_WriteReady:
|
||||
//------------------------------------------------------------------------------------
|
||||
int32 NP_LOADDS
|
||||
NPP_WriteReady(NPP instance, NPStream *stream)
|
||||
{
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_WriteReady(instance, stream);
|
||||
else
|
||||
return STREAMBUFSIZE;
|
||||
|
||||
return STREAMBUFSIZE; // Number of bytes ready to accept in NPP_Write()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_Write:
|
||||
//------------------------------------------------------------------------------------
|
||||
int32 NP_LOADDS
|
||||
NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
|
||||
{
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_Write(instance, stream, offset, len, buffer);
|
||||
else
|
||||
return len; // The number of bytes accepted
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_DestroyStream:
|
||||
//------------------------------------------------------------------------------------
|
||||
NPError NP_LOADDS
|
||||
NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason)
|
||||
{
|
||||
if (instance == NULL)
|
||||
return NPERR_INVALID_INSTANCE_ERROR;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
return app->NPP_DestroyStream(instance, stream, reason);
|
||||
else
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_StreamAsFile:
|
||||
//------------------------------------------------------------------------------------
|
||||
void NP_LOADDS
|
||||
NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname)
|
||||
{
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
app->NPP_StreamAsFile(instance, stream, fname);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_Print:
|
||||
//------------------------------------------------------------------------------------
|
||||
void NP_LOADDS
|
||||
NPP_Print(NPP instance, NPPrint* printInfo)
|
||||
{
|
||||
if (printInfo == NULL) // trap invalid parm
|
||||
return;
|
||||
if ( instance == NULL )
|
||||
return;
|
||||
|
||||
wxPluginApp *app = wxGetPluginApp();
|
||||
if ( app )
|
||||
app->NPP_Print(instance, printInfo);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// NPP_HandleEvent:
|
||||
// Mac-only.
|
||||
//------------------------------------------------------------------------------------
|
||||
int16 NPP_HandleEvent(NPP instance, void* event)
|
||||
{
|
||||
NPBool eventHandled = FALSE;
|
||||
if (instance == NULL)
|
||||
return eventHandled;
|
||||
|
||||
PluginInstance* This = (PluginInstance*) instance->pdata;
|
||||
|
||||
//
|
||||
// *Developers*: The "event" passed in is a Macintosh
|
||||
// EventRecord*. The event.what field can be any of the
|
||||
// normal Mac event types, or one of the following additional
|
||||
// types defined in npapi.h: getFocusEvent, loseFocusEvent,
|
||||
// adjustCursorEvent. The focus events inform your plugin
|
||||
// that it will become, or is no longer, the recepient of
|
||||
// key events. If your plugin doesn't want to receive key
|
||||
// events, return false when passed at getFocusEvent. The
|
||||
// adjustCursorEvent is passed repeatedly when the mouse is
|
||||
// over your plugin; if your plugin doesn't want to set the
|
||||
// cursor, return false. Handle the standard Mac events as
|
||||
// normal. The return value for all standard events is currently
|
||||
// ignored except for the key event: for key events, only return
|
||||
// true if your plugin has handled that particular key event.
|
||||
//
|
||||
|
||||
return eventHandled;
|
||||
}
|
||||
|
@@ -1,799 +0,0 @@
|
||||
/*
|
||||
* npupp.h $Revision$
|
||||
* function call mecahnics needed by platform specific glue code.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NPUPP_H_
|
||||
#define _NPUPP_H_
|
||||
|
||||
#ifndef GENERATINGCFM
|
||||
#define GENERATINGCFM 0
|
||||
#endif
|
||||
|
||||
#ifndef _NPAPI_H_
|
||||
#include "npapi.h"
|
||||
#endif
|
||||
|
||||
/******************************************************************************************
|
||||
plug-in function table macros
|
||||
for each function in and out of the plugin API we define
|
||||
typedef NPP_FooUPP
|
||||
#define NewNPP_FooProc
|
||||
#define CallNPP_FooProc
|
||||
for mac, define the UPP magic for PPC/68K calling
|
||||
*******************************************************************************************/
|
||||
|
||||
|
||||
/* NPP_Initialize */
|
||||
|
||||
#if GENERATINGCFM
|
||||
typedef UniversalProcPtr NPP_InitializeUPP;
|
||||
|
||||
enum {
|
||||
uppNPP_InitializeProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
|
||||
| RESULT_SIZE(SIZE_CODE(0))
|
||||
};
|
||||
|
||||
#define NewNPP_InitializeProc(FUNC) \
|
||||
(NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_InitializeProc(FUNC) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPP_InitializeUPP)(void);
|
||||
#define NewNPP_InitializeProc(FUNC) \
|
||||
((NPP_InitializeUPP) (FUNC))
|
||||
#define CallNPP_InitializeProc(FUNC) \
|
||||
(*(FUNC))()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_Shutdown */
|
||||
|
||||
#if GENERATINGCFM
|
||||
typedef UniversalProcPtr NPP_ShutdownUPP;
|
||||
|
||||
enum {
|
||||
uppNPP_ShutdownProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
|
||||
| RESULT_SIZE(SIZE_CODE(0))
|
||||
};
|
||||
|
||||
#define NewNPP_ShutdownProc(FUNC) \
|
||||
(NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_ShutdownProc(FUNC) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPP_ShutdownUPP)(void);
|
||||
#define NewNPP_ShutdownProc(FUNC) \
|
||||
((NPP_ShutdownUPP) (FUNC))
|
||||
#define CallNPP_ShutdownProc(FUNC) \
|
||||
(*(FUNC))()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_New */
|
||||
|
||||
#if GENERATINGCFM
|
||||
typedef UniversalProcPtr NPP_NewUPP;
|
||||
|
||||
enum {
|
||||
uppNPP_NewProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
|
||||
| STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
|
||||
| STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
|
||||
| STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
|
||||
#define NewNPP_NewProc(FUNC) \
|
||||
(NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
|
||||
(ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
|
||||
#define NewNPP_NewProc(FUNC) \
|
||||
((NPP_NewUPP) (FUNC))
|
||||
#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
|
||||
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_Destroy */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_DestroyUPP;
|
||||
enum {
|
||||
uppNPP_DestroyProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPP_DestroyProc(FUNC) \
|
||||
(NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save);
|
||||
#define NewNPP_DestroyProc(FUNC) \
|
||||
((NPP_DestroyUPP) (FUNC))
|
||||
#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
|
||||
(*(FUNC))((ARG1), (ARG2))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_SetWindow */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_SetWindowUPP;
|
||||
enum {
|
||||
uppNPP_SetWindowProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPP_SetWindowProc(FUNC) \
|
||||
(NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window);
|
||||
#define NewNPP_SetWindowProc(FUNC) \
|
||||
((NPP_SetWindowUPP) (FUNC))
|
||||
#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
|
||||
(*(FUNC))((ARG1), (ARG2))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_NewStream */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_NewStreamUPP;
|
||||
enum {
|
||||
uppNPP_NewStreamProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
|
||||
| STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPP_NewStreamProc(FUNC) \
|
||||
(NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
|
||||
#define NewNPP_NewStreamProc(FUNC) \
|
||||
((NPP_NewStreamUPP) (FUNC))
|
||||
#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
|
||||
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_DestroyStream */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_DestroyStreamUPP;
|
||||
enum {
|
||||
uppNPP_DestroyStreamProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPError)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPP_DestroyStreamProc(FUNC) \
|
||||
(NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPErrorArg) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPErrorArg))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPError reason);
|
||||
#define NewNPP_DestroyStreamProc(FUNC) \
|
||||
((NPP_DestroyStreamUPP) (FUNC))
|
||||
#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPErrorArg) \
|
||||
(*(FUNC))((NPParg), (NPStreamPtr), (NPErrorArg))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_WriteReady */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_WriteReadyUPP;
|
||||
enum {
|
||||
uppNPP_WriteReadyProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(int32)))
|
||||
};
|
||||
#define NewNPP_WriteReadyProc(FUNC) \
|
||||
(NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
|
||||
(int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
|
||||
|
||||
#else
|
||||
|
||||
typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
|
||||
#define NewNPP_WriteReadyProc(FUNC) \
|
||||
((NPP_WriteReadyUPP) (FUNC))
|
||||
#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
|
||||
(*(FUNC))((NPParg), (NPStreamPtr))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_Write */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_WriteUPP;
|
||||
enum {
|
||||
uppNPP_WriteProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
|
||||
| STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(int32)))
|
||||
};
|
||||
#define NewNPP_WriteProc(FUNC) \
|
||||
(NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
|
||||
(int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
|
||||
|
||||
#else
|
||||
|
||||
typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
|
||||
#define NewNPP_WriteProc(FUNC) \
|
||||
((NPP_WriteUPP) (FUNC))
|
||||
#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
|
||||
(*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_StreamAsFile */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_StreamAsFileUPP;
|
||||
enum {
|
||||
uppNPP_StreamAsFileProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
|
||||
| RESULT_SIZE(SIZE_CODE(0))
|
||||
};
|
||||
#define NewNPP_StreamAsFileProc(FUNC) \
|
||||
(NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
|
||||
#define NewNPP_StreamAsFileProc(FUNC) \
|
||||
((NPP_StreamAsFileUPP) (FUNC))
|
||||
#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
|
||||
(*(FUNC))((ARG1), (ARG2), (ARG3))
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_Print */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_PrintUPP;
|
||||
enum {
|
||||
uppNPP_PrintProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
|
||||
| RESULT_SIZE(SIZE_CODE(0))
|
||||
};
|
||||
#define NewNPP_PrintProc(FUNC) \
|
||||
(NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
|
||||
#define NewNPP_PrintProc(FUNC) \
|
||||
((NPP_PrintUPP) (FUNC))
|
||||
#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
|
||||
(*(FUNC))((NPParg), (NPPrintArg))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPP_HandleEvent */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_HandleEventUPP;
|
||||
enum {
|
||||
uppNPP_HandleEventProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(int16)))
|
||||
};
|
||||
#define NewNPP_HandleEventProc(FUNC) \
|
||||
(NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
|
||||
(int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
|
||||
|
||||
#else
|
||||
|
||||
typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event);
|
||||
#define NewNPP_HandleEventProc(FUNC) \
|
||||
((NPP_HandleEventUPP) (FUNC))
|
||||
#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
|
||||
(*(FUNC))((NPParg), (voidPtr))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Netscape entry points
|
||||
*/
|
||||
|
||||
|
||||
/* NPN_GetUrl */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_GetURLUPP;
|
||||
enum {
|
||||
uppNPN_GetURLProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPN_GetURLProc(FUNC) \
|
||||
(NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
|
||||
#else
|
||||
|
||||
typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
|
||||
#define NewNPN_GetURLProc(FUNC) \
|
||||
((NPN_GetURLUPP) (FUNC))
|
||||
#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
|
||||
(*(FUNC))((ARG1), (ARG2), (ARG3))
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_PostUrl */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_PostURLUPP;
|
||||
enum {
|
||||
uppNPN_PostURLProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
|
||||
| STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
|
||||
| STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPN_PostURLProc(FUNC) \
|
||||
(NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
|
||||
#else
|
||||
|
||||
typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
|
||||
#define NewNPN_PostURLProc(FUNC) \
|
||||
((NPN_PostURLUPP) (FUNC))
|
||||
#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
|
||||
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_RequestRead */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_RequestReadUPP;
|
||||
enum {
|
||||
uppNPN_RequestReadProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPN_RequestReadProc(FUNC) \
|
||||
(NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_RequestReadProc(FUNC, stream, range) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
|
||||
#define NewNPN_RequestReadProc(FUNC) \
|
||||
((NPN_RequestReadUPP) (FUNC))
|
||||
#define CallNPN_RequestReadProc(FUNC, stream, range) \
|
||||
(*(FUNC))((stream), (range))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_NewStream */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_NewStreamUPP;
|
||||
enum {
|
||||
uppNPN_NewStreamProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
|
||||
| STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16*)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPN_NewStreamProc(FUNC) \
|
||||
(NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_NewStreamProc(FUNC, npp, type, stream) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (stream))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream);
|
||||
#define NewNPN_NewStreamProc(FUNC) \
|
||||
((NPN_NewStreamUPP) (FUNC))
|
||||
#define CallNPN_NewStreamProc(FUNC, npp, type, stream) \
|
||||
(*(FUNC))((npp), (type), (stream))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_Write */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_WriteUPP;
|
||||
enum {
|
||||
uppNPN_WriteProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
|
||||
| STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(int32)))
|
||||
};
|
||||
#define NewNPN_WriteProc(FUNC) \
|
||||
(NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
|
||||
(int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))
|
||||
|
||||
#else
|
||||
|
||||
typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
|
||||
#define NewNPN_WriteProc(FUNC) \
|
||||
((NPN_WriteUPP) (FUNC))
|
||||
#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
|
||||
(*(FUNC))((npp), (stream), (len), (buffer))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_DestroyStream */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_DestroyStreamUPP;
|
||||
enum {
|
||||
uppNPN_DestroyStreamProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPError)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPN_DestroyStreamProc(FUNC) \
|
||||
(NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_DestroyStreamProc(FUNC, npp, stream, err) \
|
||||
(NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (err))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPError reason);
|
||||
#define NewNPN_DestroyStreamProc(FUNC) \
|
||||
((NPN_DestroyStreamUPP) (FUNC))
|
||||
#define CallNPN_DestroyStreamProc(FUNC, npp, stream, err) \
|
||||
(*(FUNC))((npp), (stream), (err))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_Status */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_StatusUPP;
|
||||
enum {
|
||||
uppNPN_StatusProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
|
||||
};
|
||||
|
||||
#define NewNPN_StatusProc(FUNC) \
|
||||
(NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_StatusProc(FUNC, npp, msg) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPN_StatusUPP)(NPP instance, const char* message);
|
||||
#define NewNPN_StatusProc(FUNC) \
|
||||
((NPN_StatusUPP) (FUNC))
|
||||
#define CallNPN_StatusProc(FUNC, npp, msg) \
|
||||
(*(FUNC))((npp), (msg))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_UserAgent */
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_UserAgentUPP;
|
||||
enum {
|
||||
uppNPN_UserAgentProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
|
||||
};
|
||||
|
||||
#define NewNPN_UserAgentProc(FUNC) \
|
||||
(NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_UserAgentProc(FUNC, ARG1) \
|
||||
(const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1))
|
||||
|
||||
#else
|
||||
|
||||
typedef const char* (*NPN_UserAgentUPP)(NPP instance);
|
||||
#define NewNPN_UserAgentProc(FUNC) \
|
||||
((NPN_UserAgentUPP) (FUNC))
|
||||
#define CallNPN_UserAgentProc(FUNC, ARG1) \
|
||||
(*(FUNC))((ARG1))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_MemAlloc */
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_MemAllocUPP;
|
||||
enum {
|
||||
uppNPN_MemAllocProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(void *)))
|
||||
};
|
||||
|
||||
#define NewNPN_MemAllocProc(FUNC) \
|
||||
(NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_MemAllocProc(FUNC, ARG1) \
|
||||
(void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1))
|
||||
|
||||
#else
|
||||
|
||||
typedef void* (*NPN_MemAllocUPP)(uint32 size);
|
||||
#define NewNPN_MemAllocProc(FUNC) \
|
||||
((NPN_MemAllocUPP) (FUNC))
|
||||
#define CallNPN_MemAllocProc(FUNC, ARG1) \
|
||||
(*(FUNC))((ARG1))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN__MemFree */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_MemFreeUPP;
|
||||
enum {
|
||||
uppNPN_MemFreeProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
|
||||
};
|
||||
|
||||
#define NewNPN_MemFreeProc(FUNC) \
|
||||
(NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_MemFreeProc(FUNC, ARG1) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPN_MemFreeUPP)(void* ptr);
|
||||
#define NewNPN_MemFreeProc(FUNC) \
|
||||
((NPN_MemFreeUPP) (FUNC))
|
||||
#define CallNPN_MemFreeProc(FUNC, ARG1) \
|
||||
(*(FUNC))((ARG1))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* NPN_MemFlush */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_MemFlushUPP;
|
||||
enum {
|
||||
uppNPN_MemFlushProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
|
||||
};
|
||||
|
||||
#define NewNPN_MemFlushProc(FUNC) \
|
||||
(NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_MemFlushProc(FUNC, ARG1) \
|
||||
(uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))
|
||||
|
||||
#else
|
||||
|
||||
typedef uint32 (*NPN_MemFlushUPP)(uint32 size);
|
||||
#define NewNPN_MemFlushProc(FUNC) \
|
||||
((NPN_MemFlushUPP) (FUNC))
|
||||
#define CallNPN_MemFlushProc(FUNC, ARG1) \
|
||||
(*(FUNC))((ARG1))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* NPN_ReloadPlugins */
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPN_ReloadPluginsUPP;
|
||||
enum {
|
||||
uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
|
||||
| RESULT_SIZE(SIZE_CODE(0))
|
||||
};
|
||||
|
||||
#define NewNPN_ReloadPluginsProc(FUNC) \
|
||||
(NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
|
||||
(void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))
|
||||
|
||||
#else
|
||||
|
||||
typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages);
|
||||
#define NewNPN_ReloadPluginsProc(FUNC) \
|
||||
((NPN_ReloadPluginsUPP) (FUNC))
|
||||
#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
|
||||
(*(FUNC))((ARG1))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************************
|
||||
* The actual plugin function table definitions
|
||||
*******************************************************************************************/
|
||||
|
||||
typedef struct _NPPluginFuncs {
|
||||
uint16 size;
|
||||
uint16 version;
|
||||
NPP_NewUPP newp;
|
||||
NPP_DestroyUPP destroy;
|
||||
NPP_SetWindowUPP setwindow;
|
||||
NPP_NewStreamUPP newstream;
|
||||
NPP_DestroyStreamUPP destroystream;
|
||||
NPP_StreamAsFileUPP asfile;
|
||||
NPP_WriteReadyUPP writeready;
|
||||
NPP_WriteUPP write;
|
||||
NPP_PrintUPP print;
|
||||
NPP_HandleEventUPP event;
|
||||
} NPPluginFuncs;
|
||||
|
||||
typedef struct _NPNetscapeFuncs {
|
||||
uint16 size;
|
||||
uint16 version;
|
||||
NPN_GetURLUPP geturl;
|
||||
NPN_PostURLUPP posturl;
|
||||
NPN_RequestReadUPP requestread;
|
||||
NPN_NewStreamUPP newstream;
|
||||
NPN_WriteUPP write;
|
||||
NPN_DestroyStreamUPP destroystream;
|
||||
NPN_StatusUPP status;
|
||||
NPN_UserAgentUPP uagent;
|
||||
NPN_MemAllocUPP memalloc;
|
||||
NPN_MemFreeUPP memfree;
|
||||
NPN_MemFlushUPP memflush;
|
||||
NPN_ReloadPluginsUPP reloadplugins;
|
||||
} NPNetscapeFuncs;
|
||||
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
/******************************************************************************************
|
||||
* Mac platform-specific plugin glue stuff
|
||||
*******************************************************************************************/
|
||||
|
||||
/*
|
||||
* Main entry point of the plugin.
|
||||
* This routine will be called when the plugin is loaded. The function
|
||||
* tables are passed in and the plugin fills in the NPPluginFuncs table
|
||||
* and NPPShutdownUPP for Netscape's use.
|
||||
*/
|
||||
|
||||
#if GENERATINGCFM
|
||||
|
||||
typedef UniversalProcPtr NPP_MainEntryUPP;
|
||||
enum {
|
||||
uppNPP_MainEntryProcInfo = kThinkCStackBased
|
||||
| STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
|
||||
| STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
|
||||
| STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
|
||||
| RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
|
||||
};
|
||||
#define NewNPP_MainEntryProc(FUNC) \
|
||||
(NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
|
||||
#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
|
||||
CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
|
||||
|
||||
#else
|
||||
|
||||
typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
|
||||
#define NewNPP_MainEntryProc(FUNC) \
|
||||
((NPP_MainEntryUPP) (FUNC))
|
||||
#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
|
||||
(*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
|
||||
|
||||
#endif
|
||||
#endif /* MAC */
|
||||
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* plugin meta member functions */
|
||||
|
||||
NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs);
|
||||
|
||||
NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs);
|
||||
|
||||
NPError WINAPI NP_Shutdown();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _WINDOWS */
|
||||
|
||||
|
||||
#endif /* _NPUPP_H_ */
|
||||
|
@@ -1,186 +0,0 @@
|
||||
/* npwin.cpp */
|
||||
#include "windows.h"
|
||||
|
||||
#include "npapi.h"
|
||||
#include "npupp.h"
|
||||
|
||||
#ifdef __WIN32__
|
||||
#define NP_EXPORT
|
||||
#else
|
||||
#define NP_EXPORT _export
|
||||
#endif
|
||||
|
||||
static NPNetscapeFuncs* g_pNavigatorFuncs = NULL;
|
||||
|
||||
|
||||
/* PLUGIN DLL entry points */
|
||||
/* These are the Windows specific DLL entry points, not the "normal" plugin
|
||||
entry points. The "normal" ones are in NPSHELL.CPP
|
||||
*/
|
||||
|
||||
/* fills in the func table used by Navigator to call entry points in
|
||||
plugin DLL. Note that these entry points ensure that DS is loaded
|
||||
by using the NP_LOADDS macro, when compiling for Win16
|
||||
*/
|
||||
NPError WINAPI NP_EXPORT NP_GetEntryPoints(NPPluginFuncs* pFuncs)
|
||||
{
|
||||
/* trap a NULL ptr */
|
||||
if(pFuncs == NULL)
|
||||
return NPERR_INVALID_FUNCTABLE_ERROR;
|
||||
|
||||
/* if the plugin's function table is smaller than the plugin expects,
|
||||
then they are incompatible, and should return an error */
|
||||
if(pFuncs->size < sizeof NPPluginFuncs)
|
||||
return NPERR_INVALID_FUNCTABLE_ERROR;
|
||||
|
||||
pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
|
||||
pFuncs->newp = NPP_New;
|
||||
pFuncs->destroy = NPP_Destroy;
|
||||
pFuncs->setwindow = NPP_SetWindow;
|
||||
pFuncs->newstream = NPP_NewStream;
|
||||
pFuncs->destroystream = NPP_DestroyStream;
|
||||
pFuncs->asfile = NPP_StreamAsFile;
|
||||
pFuncs->writeready = NPP_WriteReady;
|
||||
pFuncs->write = NPP_Write;
|
||||
pFuncs->print = NPP_Print;
|
||||
pFuncs->event = NULL; /* reserved */
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
/* called immediately after the plugin DLL is loaded
|
||||
*/
|
||||
NPError WINAPI NP_EXPORT NP_Initialize(NPNetscapeFuncs* pFuncs)
|
||||
{
|
||||
/* trap a NULL ptr */
|
||||
if(pFuncs == NULL)
|
||||
return NPERR_INVALID_FUNCTABLE_ERROR;
|
||||
|
||||
g_pNavigatorFuncs = pFuncs; /* save it for future reference */
|
||||
|
||||
/* if the plugin's major ver level is lower than the Navigator's,
|
||||
then they are incompatible, and should return an error */
|
||||
if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
|
||||
return NPERR_INCOMPATIBLE_VERSION_ERROR;
|
||||
|
||||
/* if the Navigator's function table is smaller than the plugin expects,
|
||||
then they are incompatible, and should return an error */
|
||||
if(pFuncs->size < sizeof NPNetscapeFuncs)
|
||||
return NPERR_INVALID_FUNCTABLE_ERROR;
|
||||
|
||||
return NPP_Initialize();
|
||||
}
|
||||
|
||||
/* called immediately before the plugin DLL is unloaded
|
||||
*/
|
||||
NPError WINAPI NP_EXPORT NP_Shutdown()
|
||||
{
|
||||
NPP_Shutdown();
|
||||
|
||||
g_pNavigatorFuncs = NULL;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/* NAVIGATOR Entry points */
|
||||
|
||||
/* These entry points expect to be called from within the plugin. The
|
||||
noteworthy assumption is that DS has already been set to point to the
|
||||
plugin's DLL data segment. Don't call these functions from outside
|
||||
the plugin without ensuring DS is set to the DLLs data segment first,
|
||||
typically using the NP_LOADDS macro
|
||||
*/
|
||||
|
||||
/* returns the major/minor version numbers of the Plugin API for the plugin
|
||||
and the Navigator
|
||||
*/
|
||||
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
|
||||
{
|
||||
*plugin_major = NP_VERSION_MAJOR;
|
||||
*plugin_minor = NP_VERSION_MINOR;
|
||||
*netscape_major = HIBYTE(g_pNavigatorFuncs->version);
|
||||
*netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
|
||||
}
|
||||
|
||||
/* causes the specified URL to be fetched and streamed in
|
||||
*/
|
||||
NPError NPN_GetURL(NPP instance, const char *url, const char *window)
|
||||
{
|
||||
return g_pNavigatorFuncs->geturl(instance, url, window);
|
||||
}
|
||||
|
||||
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
|
||||
{
|
||||
return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
|
||||
}
|
||||
|
||||
/* Requests that a number of bytes be provided on a stream. Typically
|
||||
this would be used if a stream was in "pull" mode. An optional
|
||||
position can be provided for streams which are seekable.
|
||||
*/
|
||||
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
|
||||
{
|
||||
return g_pNavigatorFuncs->requestread(stream, rangeList);
|
||||
}
|
||||
|
||||
/* Creates a new stream of data from the plug-in to be interpreted
|
||||
by Netscape in the current window.
|
||||
*/
|
||||
NPError NPN_NewStream(NPP instance, NPMIMEType type, NPStream *stream)
|
||||
{
|
||||
return g_pNavigatorFuncs->newstream(instance, type, stream);
|
||||
}
|
||||
|
||||
/* Provides len bytes of data.
|
||||
*/
|
||||
int32 NPN_Write(NPP instance, NPStream *stream,
|
||||
int32 len, void *buffer)
|
||||
{
|
||||
return g_pNavigatorFuncs->write(instance, stream, len, buffer);
|
||||
}
|
||||
|
||||
/* Closes a stream object.
|
||||
reason indicates why the stream was closed.
|
||||
*/
|
||||
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
|
||||
{
|
||||
return g_pNavigatorFuncs->destroystream(instance, stream, reason);
|
||||
}
|
||||
|
||||
/* Provides a text status message in the Netscape client user interface
|
||||
*/
|
||||
void NPN_Status(NPP instance, const char *message)
|
||||
{
|
||||
g_pNavigatorFuncs->status(instance, message);
|
||||
}
|
||||
|
||||
/* returns the user agent string of Navigator, which contains version info
|
||||
*/
|
||||
const char* NPN_UserAgent(NPP instance)
|
||||
{
|
||||
return g_pNavigatorFuncs->uagent(instance);
|
||||
}
|
||||
|
||||
/* allocates memory from the Navigator's memory space. Necessary so that
|
||||
saved instance data may be freed by Navigator when exiting.
|
||||
*/
|
||||
void* NPN_MemAlloc(uint32 size)
|
||||
{
|
||||
return g_pNavigatorFuncs->memalloc(size);
|
||||
}
|
||||
|
||||
/* reciprocal of MemAlloc() above
|
||||
*/
|
||||
void NPN_MemFree(void* ptr)
|
||||
{
|
||||
g_pNavigatorFuncs->memfree(ptr);
|
||||
}
|
||||
|
||||
/* private function to Netscape. do not use!
|
||||
*/
|
||||
void NPN_ReloadPlugins(NPBool reloadPages)
|
||||
{
|
||||
g_pNavigatorFuncs->reloadplugins(reloadPages);
|
||||
}
|
||||
|
@@ -1,39 +0,0 @@
|
||||
src/*.cpp
|
||||
src/*.c
|
||||
src/*.h
|
||||
src/*.rc
|
||||
src/*.def
|
||||
src/*.xbm
|
||||
src/make*.*
|
||||
src/*.txt
|
||||
src/*.ico
|
||||
src/*.bmp
|
||||
|
||||
samples/ogledit/*.cpp
|
||||
samples/ogledit/*.c
|
||||
samples/ogledit/*.h
|
||||
samples/ogledit/*.rc
|
||||
samples/ogledit/*.def
|
||||
samples/ogledit/*.xbm
|
||||
samples/ogledit/make*.*
|
||||
samples/ogledit/*.txt
|
||||
|
||||
samples/ogledit/*.ico
|
||||
samples/ogledit/*.bmp
|
||||
samples/ogledit/bitmaps/*.bmp
|
||||
samples/ogledit/bitmaps/*.gif
|
||||
samples/ogledit/bitmaps/*.xbm
|
||||
|
||||
distrib/*.rsp
|
||||
distrib/*.bat
|
||||
|
||||
docs/*.txt
|
||||
docs/*.tex
|
||||
docs/*.ini
|
||||
docs/*.hpj
|
||||
docs/*.ps
|
||||
docs/*.eps
|
||||
docs/*.cnt
|
||||
docs/*.bmp
|
||||
docs/*.gif
|
||||
docs/*.hlp
|
@@ -1,48 +0,0 @@
|
||||
@echo off
|
||||
rem Tar up an external distribution of OGL
|
||||
|
||||
if "%1" == "" goto usage
|
||||
if "%2" == "" goto usage
|
||||
echo About to archive an external OGL distribution:
|
||||
echo From %1
|
||||
echo To %2\ogl.tgz
|
||||
echo CTRL-C if this is not correct.
|
||||
inkey /W4 `Press any key to continue...` %%input
|
||||
|
||||
erase %2\ogl.tgz
|
||||
cd %1
|
||||
|
||||
rem First, expand the wildcards in the ogl.rsp file
|
||||
|
||||
rem Create empty list file
|
||||
erase %1\distrib\ogl.lis
|
||||
c:\bin\touch %1\distrib\ogl.lis
|
||||
|
||||
rem Create a .rsp file with backslashes instead
|
||||
rem of forward slashes
|
||||
rem No need if using ls2 (from UNIX95 distribution)
|
||||
rem sed -e "s/\//\\/g" %1\distrib\ogl.rsp > %1\distrib\ogl.rs2
|
||||
|
||||
set len=%@LINES[%1\distrib\ogl.rsp]
|
||||
rem set len=%@DEC[%len]
|
||||
do i = 0 to %len by 1
|
||||
set line=%@LINE[%1\distrib\ogl.rsp,%i]
|
||||
if NOT "%line" == "" ls2 -1 %line >> %1\distrib\ogl.lis
|
||||
enddo
|
||||
|
||||
tar -c -T %1\distrib\ogl.lis
|
||||
move archive.tar ogl.tar
|
||||
gzip ogl.tar
|
||||
move ogl.taz %2\ogl.tgz
|
||||
|
||||
echo OGL archived.
|
||||
goto end
|
||||
|
||||
:usage
|
||||
echo DOS OGL distribution.
|
||||
echo Usage: tarogl source destination
|
||||
echo e.g. tarogl c:\wx\utils\ogl c:\wx\utils\ogl\deliver
|
||||
|
||||
:end
|
||||
|
||||
|
@@ -1,26 +0,0 @@
|
||||
@echo off
|
||||
rem Zip up an external distribution of OGL
|
||||
|
||||
if "%1" == "" goto usage
|
||||
if "%2" == "" goto usage
|
||||
echo About to archive an external OGL distribution:
|
||||
echo From %1
|
||||
echo To %2\ogl.zip
|
||||
echo CTRL-C if this is not correct.
|
||||
inkey /W4 `Press any key to continue...` %%input
|
||||
|
||||
erase %2\ogl.zip
|
||||
cd %1
|
||||
zip -P %3 %4 %5 %6 %7 %8 %2\ogl.zip @%1\distrib\ogl.rsp
|
||||
|
||||
echo OGL archived.
|
||||
goto end
|
||||
|
||||
:usage
|
||||
echo DOS OGL distribution.
|
||||
echo Usage: zipogl source destination
|
||||
echo e.g. zipogl c:\wx\utils\ogl c:\wx\utils\ogl\deliver
|
||||
|
||||
:end
|
||||
|
||||
|
Before Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,11 +0,0 @@
|
||||
\chapter{Bugs}\label{bugs}%
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
These are the known bugs.
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item In the OGLEdit sample, .dia files are output double-spaced
|
||||
due to an unidentified bug in the way a stream is converted to a file.
|
||||
\end{itemize}
|
||||
|
Before Width: | Height: | Size: 138 B |
@@ -1,9 +0,0 @@
|
||||
\chapter{Change log}
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
Version 2.0, June 1st 1996
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item First publically released version.
|
||||
\end{itemize}
|
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 164 B |
@@ -1,45 +0,0 @@
|
||||
\chapter{Introduction}
|
||||
\pagenumbering{arabic}%
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
Object Graphics Library (\ogl) is a C++ library supporting the creation and
|
||||
manipulation of simple and complex graphic images on a canvas.
|
||||
|
||||
It can be found in the directory {\tt utils/ogl/src} in the
|
||||
wxWindows distribution. The file {\tt ogl.h} must be included to make use
|
||||
of the library.
|
||||
|
||||
Please see \helpref{OGL overview}{ogloverview} for a general description how the object library works. For details,
|
||||
please see the \helpref{class reference}{classref}.
|
||||
|
||||
\section{File structure}
|
||||
|
||||
These are the files that comprise the \ogl\ library.
|
||||
|
||||
\begin{description}\itemsep=0pt
|
||||
\item[basic.h] Header for basic objects such as wxShape and wxRectangleShape.
|
||||
\item[basic.cpp] Basic objects implementation (1).
|
||||
\item[basic2.cpp] Basic objects implementation (2).
|
||||
\item[bitmap.cpp] wxBitmapShape class header.
|
||||
\item[bitmap.cpp] wxBitmapShape implementation.
|
||||
\item[canvas.h] wxShapeCanvas class header.
|
||||
\item[canvas.cpp] wxShapeCanvas class implementation.
|
||||
\item[composit.h] Composite object class header.
|
||||
\item[composit.cpp] Composite object class implementation.
|
||||
\item[constrnt.h] Constraint classes header.
|
||||
\item[constrnt.cpp] Constraint classes implementation.
|
||||
\item[divided.h] Divided object class header.
|
||||
\item[divided.cpp] Divided object class implementation.
|
||||
\item[drawn.h] Drawn (metafile) object class header.
|
||||
\item[drawn.cpp] Drawn (metafile) object class implementation.
|
||||
\item[graphics.h] Main include file.
|
||||
\item[lines.h] wxLineShape class header.
|
||||
\item[lines.cpp] wxLineShape class implementation.
|
||||
\item[misc.h] Miscellaneous graphics functions header.
|
||||
\item[misc.cpp] Miscellaneous graphics functions implementation.
|
||||
\item[ogldiag.h] wxDiagram class header.
|
||||
\item[ogldiag.cpp] wxDiagram implementation.
|
||||
\end{description}
|
||||
|
||||
|
@@ -1,17 +0,0 @@
|
||||
[OPTIONS]
|
||||
BMROOT=d:\wx2\wxwind~1\utils\ogl\docs ; Assume that bitmaps are where the source is
|
||||
TITLE=OGL Manual
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
||||
[FILES]
|
||||
ogl.rtf
|
||||
|
||||
[CONFIG]
|
||||
CreateButton("Up", "&Up", "JumpId(`ogl.hlp', `Contents')")
|
||||
BrowseButtons()
|
||||
|
||||
[MAP]
|
||||
|
||||
[BITMAPS]
|
||||
|
@@ -1,38 +0,0 @@
|
||||
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}
|
||||
\newcommand{\ogl}[0]{{OGL}}
|
||||
\input psbox.tex
|
||||
\parindent 0pt
|
||||
\parskip 11pt
|
||||
\title{Manual for Object Graphics Library 3.0}
|
||||
\author{Julian Smart}
|
||||
\date{July 1998}
|
||||
|
||||
\makeindex
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
\pagestyle{fancyplain}
|
||||
\bibliographystyle{plain}
|
||||
\pagenumbering{roman}
|
||||
\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
\tableofcontents%
|
||||
|
||||
\input{intro.tex}
|
||||
%
|
||||
\input{sample.tex}
|
||||
%
|
||||
\input{classes.tex}
|
||||
%
|
||||
\input{topics.tex}
|
||||
%
|
||||
\input{bugs.tex}
|
||||
%
|
||||
\input{changes.tex}
|
||||
|
||||
%
|
||||
\addcontentsline{toc}{chapter}{Index}
|
||||
\setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}}
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
\printindex
|
||||
\end{document}
|
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 7.0 KiB |
@@ -1,128 +0,0 @@
|
||||
\chapter{OGLEdit: a sample OGL application}\label{ogledit}%
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
OGLEdit is a sample OGL application that allows the user to draw, edit,
|
||||
save and load a few shapes. It should clarify aspects of OGL usage, and
|
||||
can act as a template for similar applications. OGLEdit can be found in\rtfsp
|
||||
{\tt samples/ogledit} in the OGL distribution.
|
||||
|
||||
$$\image{10cm;0cm}{ogledit.eps}$$\par
|
||||
|
||||
The wxWindows document/view model has been used in OGL, to reduce the amount of
|
||||
housekeeping logic required to get it up and running. OGLEdit also provides
|
||||
a demonstration of the Undo/Redo capability supported by the document/view classes,
|
||||
and how a typical application might implement this feature.
|
||||
|
||||
{\it Note:} A bug in the wxWindows document/view implementation before
|
||||
version 1.66C may cause Do/Undo to misbehave and get out of sync. If this is the case,
|
||||
please replace wxCommandProcessor::Submit with the following in wx\_doc.cpp.
|
||||
|
||||
{\small
|
||||
\begin{verbatim}
|
||||
Bool wxCommandProcessor::Submit(wxCommand *command, Bool storeIt)
|
||||
{
|
||||
Bool success = command->Do();
|
||||
if (success && storeIt)
|
||||
{
|
||||
if (commands.Number() == maxNoCommands)
|
||||
{
|
||||
wxNode *firstNode = commands.First();
|
||||
wxCommand *firstCommand = (wxCommand *)firstNode->Data();
|
||||
delete firstCommand;
|
||||
delete firstNode;
|
||||
}
|
||||
|
||||
// Correct a bug: we must chop off the current 'branch'
|
||||
// so that we're at the end of the command list.
|
||||
if (currentCommand)
|
||||
{
|
||||
wxNode *node = currentCommand->Next();
|
||||
while (node)
|
||||
{
|
||||
wxNode *next = node->Next();
|
||||
delete node;
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
commands.Append(command);
|
||||
currentCommand = commands.Last();
|
||||
SetMenuStrings();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
\end{verbatim}
|
||||
}
|
||||
|
||||
\section{OGLEdit files}
|
||||
|
||||
OGLEdit comprises the following source files.
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item doc.h, doc.cpp: MyDiagram, DiagramDocument, DiagramCommand, MyEvtHandler
|
||||
classes related to diagram functionality and documents.
|
||||
\item view.h, view.cpp: MyCanvas, DiagramView classes related to visualisation of
|
||||
the diagram.
|
||||
\item ogledit.h, ogledit.cpp: MyFrame, MyApp classes related to the overall application.
|
||||
\item palette.h, palette.cpp: EditorToolPalette implementing the shape palette.
|
||||
\end{itemize}
|
||||
|
||||
\section{How OGLEdit works}
|
||||
|
||||
OGLEdit defines a DiagramDocument class, each of instance of which holds a MyDiagram
|
||||
member which itself contains the shapes.
|
||||
|
||||
In order to implement specific mouse behaviour for shapes, a class MyEvtHandler is
|
||||
defined which is `plugged into' each shape when it is created, instead of overriding each shape class
|
||||
individually. This event handler class also holds a label string.
|
||||
|
||||
The DiagramCommand class is the key to implementing Undo/Redo. Each instance of DiagramCommand
|
||||
stores enough information about an operation (create, delete, change colour etc.) to allow
|
||||
it to carry out (or undo) its command. In DiagramView::OnMenuCommand, when the user initiates the
|
||||
command, a new DiagramCommand instance is created which is then sent to the document's
|
||||
command processor (see wxWindows manual for more information about doc/view and command
|
||||
processing).
|
||||
|
||||
Apart from menu commands, another way commands are initiated is by the user left-clicking on
|
||||
the canvas or right-dragging on a node. MyCanvas::OnLeftClick in view.cpp shows how
|
||||
the appropriate wxClassInfo is passed to a DiagramCommand, to allow DiagramCommand::Do
|
||||
to create a new shape given the wxClassInfo.
|
||||
|
||||
The MyEvtHandler right-drag methods in doc.cpp implement drawing a line between
|
||||
two shapes, detecting where the right mouse button was released and looking for a second
|
||||
shape. Again, a new DiagramCommand instance is created and passed to the command
|
||||
processor to carry out the command.
|
||||
|
||||
DiagramCommand::Do and DiagramCommand::Undo embody much of the
|
||||
interesting interaction with the OGL library. A complication of note
|
||||
when implementing undo is the problem of deleting a node shape which has
|
||||
one or more arcs attached to it. If you delete the node, the arc(s)
|
||||
should be deleted too. But multiple arc deletion represents more information
|
||||
that can be incorporated in the existing DiagramCommand scheme. OGLEdit
|
||||
copes with this by treating each arc deletion as a separate command, and
|
||||
sending Cut commands recursively, providing an undo path. Undoing such a
|
||||
Cut will only undo one command at a time - not a one to one
|
||||
correspondence with the original command - but it's a reasonable
|
||||
compromise and preserves Do/Undo whilst keeping our DiagramCommand class
|
||||
simple.
|
||||
|
||||
\section{Possible enhancements}
|
||||
|
||||
OGLEdit is very simplistic and does not employ the more advanced features
|
||||
of OGL, such as:
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item attachment points (arcs are drawn to particular points on a shape)
|
||||
\item metafile and bitmaps shapes
|
||||
\item divided rectangles
|
||||
\item composite shapes, and constraints
|
||||
\item creating labels in shape regions
|
||||
\item arc labels (OGL has support for three movable labels per arc)
|
||||
\item spline and multiple-segment line arcs
|
||||
\item adding annotations to node and arc shapes
|
||||
\item line-straightening (supported by OGL) and alignment (not supported directly by OGL)
|
||||
\end{itemize}
|
||||
|
||||
These could be added to OGLEdit, at the risk of making it a less
|
||||
useful example for beginners.
|
@@ -1,20 +0,0 @@
|
||||
runTwice = yes
|
||||
titleFontSize = 12
|
||||
authorFontSize = 10
|
||||
chapterFontSize = 12
|
||||
sectionFontSize = 12
|
||||
subsectionFontSize = 12
|
||||
headerRule = yes
|
||||
footerRule = yes
|
||||
useHeadingStyles = yes
|
||||
listItemIndent=40
|
||||
generateHPJ = no
|
||||
htmlBrowseButtons = bitmap
|
||||
winHelpVersion = 3
|
||||
winHelpContents = yes
|
||||
winHelpTitle = "OGL Manual"
|
||||
truncateFilenames = yes
|
||||
combineSubSections = yes
|
||||
\overview [2] {\rtfonly{See also }\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}}
|
||||
\htmlonly{\image{}{books.gif}}\helpref{#1}{#2}
|
||||
\sethotspotcolour{on}\sethotspotunderline{on}}
|
@@ -1,163 +0,0 @@
|
||||
\chapter{Topic overviews}
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
The following sections describe particular topics.
|
||||
|
||||
\section{OGL overview}\label{ogloverview}
|
||||
|
||||
\helpref{wxShapeCanvas}{wxshapecanvas}, derived from {\bf wxCanvas}, is the drawing area
|
||||
for a number of \helpref{wxShape}{wxshape} instances. Everything drawn on a
|
||||
wxShapeCanvas is derived from wxShape, which provides virtual
|
||||
member functions for redrawing, creating and destroying
|
||||
resize/selection `handles', movement and erasing behaviour, mouse
|
||||
click behaviour, calculating the bounding box of the shape, linking
|
||||
nodes with arcs, and so on.
|
||||
|
||||
The way a client application copes with `damage' to the canvas is to
|
||||
erase (white out) anything should no longer be displayed, redraw the shape,
|
||||
and then redraw everything on the canvas to repair any damage. If quick edit
|
||||
mode is on for the canvas, the complete should be omitted by OGL and the
|
||||
application.
|
||||
|
||||
Selection handles (called control points in the code) are implemented as
|
||||
wxRectangleShapes.
|
||||
|
||||
Events are passed to shapes by the canvas in a high-level form, for example {\bf OnLeftClick},
|
||||
{\bf OnBeginDragLeft}, {\bf OnDragLeft}, {\bf OnEndDragLeft}. The canvas decides
|
||||
what is a click and what is a drag, whether it is on a shape or the canvas itself,
|
||||
and (by interrogating the shape) which attachment point the click is associated with.
|
||||
|
||||
In order to provide event-handling flexibility, each shapes has an `event handler' associated with it,
|
||||
which by default is the shape itself (all shapes derive from wxShapeEvtHandler).
|
||||
An application can modify the event-handling behaviour simply by plugging a new
|
||||
event handler into the shape. This can avoid the need for multiple inheritance when
|
||||
new properties and behaviour are required for a number of different shape classes: instead
|
||||
of overriding each class, one new event handler class can be defined and used for all
|
||||
existing shape classes.
|
||||
|
||||
A range of shapes have been predefined in the library, including rectangles, ellipses,
|
||||
polygons. A client application can derive from these shapes and/or derive entirely
|
||||
new shapes from wxShape.
|
||||
|
||||
Instances of a class called \helpref{wxDiagram}{wxdiagram} organise collections of
|
||||
shapes, providing default file input and output behaviour.
|
||||
|
||||
|
||||
\section{wxDividedShape overview}\label{dividedshapeoverview}
|
||||
|
||||
Classes: \helpref{wxDividedShape}{wxdividedshape}
|
||||
|
||||
A wxDividedShape is a rectangle with a number of vertical divisions. Each
|
||||
division may have its text formatted with independent characteristics, and
|
||||
the size of each division relative to the whole image may be specified.
|
||||
|
||||
Once a wxDividedShape has been created, the user may move the divisions with the
|
||||
mouse. By pressing Ctrl while right-clicking, the region attributes can be edited.
|
||||
|
||||
Here are examples of creating wxDividedShape objects:
|
||||
|
||||
{\small
|
||||
\begin{verbatim}
|
||||
/*
|
||||
* Divided rectangle with 3 regions
|
||||
*
|
||||
*/
|
||||
|
||||
wxDividedShape *dividedRect = new wxDividedShape(50, 60);
|
||||
|
||||
wxShapeRegion *region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.25);
|
||||
dividedRect->AddRegion(region);
|
||||
|
||||
region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.5);
|
||||
dividedRect->AddRegion(region);
|
||||
|
||||
region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.25);
|
||||
dividedRect->AddRegion(region);
|
||||
|
||||
dividedRect->SetSize(50, 60); // Allow it to calculate region sizes
|
||||
dividedRect->SetPen(wxBLACK_PEN);
|
||||
dividedRect->SetBrush(wxWHITE_BRUSH);
|
||||
dividedRect->Show(TRUE);
|
||||
dividedRect->NameRegions();
|
||||
|
||||
/*
|
||||
* Divided rectangle with 3 regions, rounded
|
||||
*
|
||||
*/
|
||||
|
||||
wxDividedShape *dividedRect3 = new wxDividedShape(50, 60);
|
||||
dividedRect3->SetCornerRadius(-0.4);
|
||||
|
||||
region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.25);
|
||||
dividedRect3->AddRegion(region);
|
||||
|
||||
region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.5);
|
||||
dividedRect3->AddRegion(region);
|
||||
|
||||
region = new wxShapeRegion;
|
||||
region->SetProportions(0.0, 0.25);
|
||||
dividedRect3->AddRegion(region);
|
||||
|
||||
dividedRect3->SetSize(50, 60); // Allow it to calculate region sizes
|
||||
dividedRect3->SetPen(wxBLACK_PEN);
|
||||
dividedRect3->SetBrush(wxWHITE_BRUSH);
|
||||
dividedRect3->Show(TRUE);
|
||||
dividedRect3->NameRegions();
|
||||
\end{verbatim}
|
||||
}
|
||||
|
||||
|
||||
\section{wxCompositeShape overview}\label{compositeshapeoverview}
|
||||
|
||||
Classes: \helpref{wxCompositeShape}{wxcompositeshape}, \helpref{OGLConstraint}{oglconstraint}
|
||||
|
||||
The wxCompositeShape allows fairly complex shapes to be created, and maintains
|
||||
a set of constraints which specify the layout and proportions of child shapes.
|
||||
|
||||
Add child shapes to a wxCompositeShape using \helpref{AddChild}{wxcompositeshapeaddchild}, and
|
||||
add constraints using \helpref{AddConstraint}{wxcompositeshapeaddconstraint}.
|
||||
|
||||
After children and shapes have been added, call \helpref{Recompute}{wxcompositeshaperecompute} which
|
||||
will return TRUE is the constraints could be satisfied, FALSE otherwise. If
|
||||
constraints have been correctly and consistently specified, this call will succeed.
|
||||
|
||||
If there is more than one child, constraints must be specified: OGL cannot calculate
|
||||
the size and position of children otherwise. Don't assume that children will simply
|
||||
move relative to the parent without the use of constraints.
|
||||
|
||||
To specify a constraint, you need three things:
|
||||
|
||||
\begin{enumerate}\itemsep=0pt
|
||||
\item a constraint type, such as gyCONSTRAINT\_CENTRED\_VERTICALLY;
|
||||
\item a reference shape, with respect to which other shapes are going to be positioned - the\rtfsp
|
||||
{\it constraining} shape;
|
||||
\item a list of one or more shapes to be constrained: the {\it constrained} shapes.
|
||||
\end{enumerate}
|
||||
|
||||
The constraining shape can be either the parent of the constrained shapes, or a sibling. The
|
||||
constrained shapes must all be siblings of each other.
|
||||
|
||||
For an exhaustive list and description of the available constraint types, see the \helpref{OGLConstraint constructor}{oglconstraintconstr}.
|
||||
Note that most constraints operate in one dimension only (vertically or horizontally), so you will
|
||||
usually need to specify constraints in pairs.
|
||||
|
||||
You can set the spacing between constraining and constrained shapes by
|
||||
calling \helpref{OGLConstraint::SetSpacing}{oglconstraintsetspacing}.
|
||||
|
||||
Finally, a wxCompositeShape can have {\it divisions}, which are special child shapes of class
|
||||
wxDivisionShape (not to be confused with wxDividedShape). The purpose of this is to allow
|
||||
the composite to be divided into user-adjustable regions (divisions) into which other shapes
|
||||
can be dropped dynamically, given suitable application code. Divisons allow the child
|
||||
shapes to have an identity of their own - they can be manipulated independently of their container -
|
||||
but to behave as if they are contained with the division, moving with the parent shape.
|
||||
Divisions boundaries can themselves be moved using the mouse.
|
||||
|
||||
To create an initial division, call \helpref{wxCompositeShape::MakeContainer}{wxcompositeshapemakecontainer}.
|
||||
Make further divisions by calling \helpref{wxDivisionShape::Divide}{wxdivisionshapedivide}.
|
||||
|
Before Width: | Height: | Size: 137 B |
@@ -1,605 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: basic.h
|
||||
// Purpose: Basic OGL classes and definitions
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_BASIC_H_
|
||||
#define _OGL_BASIC_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "basic.h"
|
||||
#endif
|
||||
|
||||
#define OGL_VERSION 2.0
|
||||
|
||||
#ifndef DEFAULT_MOUSE_TOLERANCE
|
||||
#define DEFAULT_MOUSE_TOLERANCE 3
|
||||
#endif
|
||||
|
||||
// Edit these lines if you positively don't want PROLOGIO support
|
||||
#ifndef PROLOGIO
|
||||
#define PROLOGIO
|
||||
#endif
|
||||
|
||||
// Key identifiers
|
||||
#define KEY_SHIFT 1
|
||||
#define KEY_CTRL 2
|
||||
|
||||
// Arrow styles
|
||||
|
||||
#define ARROW_NONE 0
|
||||
#define ARROW_END 1
|
||||
#define ARROW_BOTH 2
|
||||
#define ARROW_MIDDLE 3
|
||||
#define ARROW_START 4
|
||||
|
||||
// Control point types
|
||||
// Rectangle and most other shapes
|
||||
#define CONTROL_POINT_VERTICAL 1
|
||||
#define CONTROL_POINT_HORIZONTAL 2
|
||||
#define CONTROL_POINT_DIAGONAL 3
|
||||
|
||||
// Line
|
||||
#define CONTROL_POINT_ENDPOINT_TO 4
|
||||
#define CONTROL_POINT_ENDPOINT_FROM 5
|
||||
#define CONTROL_POINT_LINE 6
|
||||
|
||||
// Types of formatting: can be combined in a bit list
|
||||
#define FORMAT_NONE 0
|
||||
// Left justification
|
||||
#define FORMAT_CENTRE_HORIZ 1
|
||||
// Centre horizontally
|
||||
#define FORMAT_CENTRE_VERT 2
|
||||
// Centre vertically
|
||||
#define FORMAT_SIZE_TO_CONTENTS 4
|
||||
// Resize shape to contents
|
||||
|
||||
// Shadow mode
|
||||
#define SHADOW_NONE 0
|
||||
#define SHADOW_LEFT 1
|
||||
#define SHADOW_RIGHT 2
|
||||
|
||||
/*
|
||||
* Declare types
|
||||
*
|
||||
*/
|
||||
|
||||
#define SHAPE_BASIC wxTYPE_USER + 1
|
||||
#define SHAPE_RECTANGLE wxTYPE_USER + 2
|
||||
#define SHAPE_ELLIPSE wxTYPE_USER + 3
|
||||
#define SHAPE_POLYGON wxTYPE_USER + 4
|
||||
#define SHAPE_CIRCLE wxTYPE_USER + 5
|
||||
#define SHAPE_LINE wxTYPE_USER + 6
|
||||
#define SHAPE_DIVIDED_RECTANGLE wxTYPE_USER + 8
|
||||
#define SHAPE_COMPOSITE wxTYPE_USER + 9
|
||||
#define SHAPE_CONTROL_POINT wxTYPE_USER + 10
|
||||
#define SHAPE_DRAWN wxTYPE_USER + 11
|
||||
#define SHAPE_DIVISION wxTYPE_USER + 12
|
||||
#define SHAPE_LABEL_OBJECT wxTYPE_USER + 13
|
||||
#define SHAPE_BITMAP wxTYPE_USER + 14
|
||||
#define SHAPE_DIVIDED_OBJECT_CONTROL_POINT wxTYPE_USER + 15
|
||||
|
||||
#define OBJECT_REGION wxTYPE_USER + 20
|
||||
|
||||
#define OP_CLICK_LEFT 1
|
||||
#define OP_CLICK_RIGHT 2
|
||||
#define OP_DRAG_LEFT 4
|
||||
#define OP_DRAG_RIGHT 8
|
||||
|
||||
#define OP_ALL (OP_CLICK_LEFT | OP_CLICK_RIGHT | OP_DRAG_LEFT | OP_DRAG_RIGHT)
|
||||
|
||||
class wxShapeTextLine;
|
||||
class wxShapeCanvas;
|
||||
class wxLineShape;
|
||||
class wxControlPoint;
|
||||
class wxShapeRegion;
|
||||
class wxShape;
|
||||
|
||||
#ifdef PROLOGIO
|
||||
class wxExpr;
|
||||
class wxDatabase;
|
||||
#endif
|
||||
|
||||
class wxShapeEvtHandler: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler)
|
||||
|
||||
public:
|
||||
wxShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL);
|
||||
virtual ~wxShapeEvtHandler();
|
||||
|
||||
inline void SetHandlerShape(wxShape *sh) { m_handlerShape = sh; }
|
||||
inline wxShape *GetShape() const { return m_handlerShape; }
|
||||
|
||||
// This is called when the _shape_ is deleted.
|
||||
virtual void OnDelete();
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
virtual void OnDrawContents(wxDC& dc);
|
||||
virtual void OnMoveLinks(wxDC& dc);
|
||||
virtual void OnErase(wxDC& dc);
|
||||
virtual void OnEraseContents(wxDC& dc);
|
||||
virtual void OnHighlight(wxDC& dc);
|
||||
virtual void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
virtual void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
virtual void OnSize(float x, float y);
|
||||
virtual bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
virtual void OnMovePost(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
|
||||
virtual void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
|
||||
virtual void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
|
||||
virtual void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
|
||||
virtual void OnDrawControlPoints(wxDC& dc);
|
||||
virtual void OnEraseControlPoints(wxDC& dc);
|
||||
virtual void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||
|
||||
virtual void OnBeginSize(float WXUNUSED(w), float WXUNUSED(h)) { }
|
||||
virtual void OnEndSize(float WXUNUSED(w), float WXUNUSED(h)) { }
|
||||
|
||||
private:
|
||||
wxShapeEvtHandler* m_previousHandler;
|
||||
wxShape* m_handlerShape;
|
||||
};
|
||||
|
||||
class wxShape: public wxShapeEvtHandler
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxShape)
|
||||
|
||||
public:
|
||||
|
||||
wxShape(wxShapeCanvas *can = NULL);
|
||||
virtual ~wxShape();
|
||||
virtual void GetBoundingBoxMax(float *width, float *height);
|
||||
virtual void GetBoundingBoxMin(float *width, float *height) = 0;
|
||||
virtual bool GetPerimeterPoint(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float *x3, float *y3);
|
||||
inline wxShapeCanvas *GetCanvas() { return m_canvas; }
|
||||
void SetCanvas(wxShapeCanvas *the_canvas);
|
||||
virtual void AddToCanvas(wxShapeCanvas *the_canvas, wxShape *addAfter = NULL);
|
||||
virtual void InsertInCanvas(wxShapeCanvas *the_canvas);
|
||||
|
||||
virtual void RemoveFromCanvas(wxShapeCanvas *the_canvas);
|
||||
inline float GetX() const { return m_xpos; }
|
||||
inline float GetY() const { return m_ypos; }
|
||||
inline void SetX(float x) { m_xpos = x; }
|
||||
inline void SetY(float y) { m_ypos = y; }
|
||||
|
||||
inline wxShape *GetParent() const { return m_parent; }
|
||||
inline void SetParent(wxShape *p) { m_parent = p; }
|
||||
wxShape *GetTopAncestor();
|
||||
inline wxList& GetChildren() { return m_children; }
|
||||
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
virtual void OnDrawContents(wxDC& dc);
|
||||
virtual void OnMoveLinks(wxDC& dc);
|
||||
virtual void Unlink() { };
|
||||
void SetDrawHandles(bool drawH);
|
||||
inline bool GetDrawHandles() { return m_drawHandles; }
|
||||
virtual void OnErase(wxDC& dc);
|
||||
virtual void OnEraseContents(wxDC& dc);
|
||||
virtual void OnHighlight(wxDC& dc);
|
||||
virtual void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
virtual void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
virtual void OnSize(float x, float y);
|
||||
virtual bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
virtual void OnMovePost(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
|
||||
virtual void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
|
||||
virtual void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
|
||||
virtual void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
virtual void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
|
||||
virtual void OnDrawControlPoints(wxDC& dc);
|
||||
virtual void OnEraseControlPoints(wxDC& dc);
|
||||
|
||||
virtual void OnBeginSize(float WXUNUSED(w), float WXUNUSED(h)) { }
|
||||
virtual void OnEndSize(float WXUNUSED(w), float WXUNUSED(h)) { }
|
||||
|
||||
virtual void MakeControlPoints();
|
||||
virtual void DeleteControlPoints(wxDC *dc = NULL);
|
||||
virtual void ResetControlPoints();
|
||||
|
||||
inline wxShapeEvtHandler *GetEventHandler() { return m_eventHandler; }
|
||||
inline void SetEventHandler(wxShapeEvtHandler *handler) { m_eventHandler = handler; }
|
||||
|
||||
// Mandatory control points, e.g. the divided line moving handles
|
||||
// should appear even if a child of the 'selected' image
|
||||
virtual void MakeMandatoryControlPoints();
|
||||
virtual void ResetMandatoryControlPoints();
|
||||
|
||||
inline virtual bool Recompute() { return TRUE; };
|
||||
// Calculate size recursively, if size changes. Size might depend on children.
|
||||
inline virtual void CalculateSize() { };
|
||||
virtual void Select(bool select = TRUE, wxDC* dc = NULL);
|
||||
virtual void SetHighlight(bool hi = TRUE, bool recurse = FALSE);
|
||||
inline virtual bool IsHighlighted() const { return m_highlighted; };
|
||||
virtual bool Selected() const;
|
||||
virtual bool AncestorSelected() const;
|
||||
void SetSensitivityFilter(int sens = OP_ALL, bool recursive = FALSE);
|
||||
int GetSensitivityFilter() const { return m_sensitivity; }
|
||||
void SetDraggable(bool drag, bool recursive = FALSE);
|
||||
inline void SetFixedSize(bool x, bool y) { m_fixedWidth = x; m_fixedHeight = y; };
|
||||
inline void GetFixedSize(bool *x, bool *y) const { *x = m_fixedWidth; *y = m_fixedHeight; };
|
||||
inline bool GetFixedWidth() const { return m_fixedWidth; }
|
||||
inline bool GetFixedHeight() const { return m_fixedHeight; }
|
||||
inline void SetSpaceAttachments(bool sp) { m_spaceAttachments = sp; };
|
||||
inline bool GetSpaceAttachments() const { return m_spaceAttachments; };
|
||||
void SetShadowMode(int mode, bool redraw = FALSE);
|
||||
inline int GetShadowMode() const { return m_shadowMode; }
|
||||
virtual bool HitTest(float x, float y, int *attachment, float *distance);
|
||||
inline void SetCentreResize(bool cr) { m_centreResize = cr; }
|
||||
inline bool GetCentreResize() const { return m_centreResize; }
|
||||
inline wxList& GetLines() { return m_lines; }
|
||||
inline void SetDisableLabel(bool flag) { m_disableLabel = flag; }
|
||||
inline bool GetDisableLabel() const { return m_disableLabel; }
|
||||
inline void SetAttachmentMode(bool flag) { m_attachmentMode = flag; }
|
||||
inline bool GetAttachmentMode() const { return m_attachmentMode; }
|
||||
inline void SetId(long i) { m_id = i; }
|
||||
inline long GetId() const { return m_id; }
|
||||
|
||||
void SetPen(wxPen *pen);
|
||||
void SetBrush(wxBrush *brush);
|
||||
inline void SetClientData(wxObject *client_data) { m_clientData = client_data; };
|
||||
inline wxObject *GetClientData() const { return m_clientData; };
|
||||
|
||||
virtual void Show(bool show);
|
||||
virtual bool IsShown() const { return m_visible; }
|
||||
virtual void Move(wxDC& dc, float x1, float y1, bool display = TRUE);
|
||||
virtual void Erase(wxDC& dc);
|
||||
virtual void EraseContents(wxDC& dc);
|
||||
virtual void Draw(wxDC& dc);
|
||||
virtual void Flash();
|
||||
virtual void MoveLinks(wxDC& dc);
|
||||
virtual void DrawContents(wxDC& dc); // E.g. for drawing text label
|
||||
virtual void SetSize(float x, float y, bool recursive = TRUE);
|
||||
virtual void SetAttachmentSize(float x, float y);
|
||||
void Attach(wxShapeCanvas *can);
|
||||
void Detach();
|
||||
|
||||
inline virtual bool Constrain() { return FALSE; } ;
|
||||
|
||||
void AddLine(wxLineShape *line, wxShape *other,
|
||||
int attachFrom = 0, int attachTo = 0);
|
||||
void AddText(const wxString& string);
|
||||
|
||||
inline wxPen *GetPen() const { return m_pen; }
|
||||
inline wxBrush *GetBrush() const { return m_brush; }
|
||||
|
||||
/*
|
||||
* Region-specific functions (defaults to the default region
|
||||
* for simple objects
|
||||
*/
|
||||
|
||||
// Set the default, single region size to be consistent
|
||||
// with the object size
|
||||
void SetDefaultRegionSize();
|
||||
virtual void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
|
||||
virtual void SetFormatMode(int mode, int regionId = 0);
|
||||
virtual int GetFormatMode(int regionId = 0) const;
|
||||
virtual void SetFont(wxFont *font, int regionId = 0);
|
||||
virtual wxFont *GetFont(int regionId = 0) const;
|
||||
virtual void SetTextColour(const wxString& colour, int regionId = 0);
|
||||
virtual wxString GetTextColour(int regionId = 0) const;
|
||||
virtual inline int GetNumberOfTextRegions() const { return m_regions.Number(); }
|
||||
virtual void SetRegionName(const wxString& name, int regionId = 0);
|
||||
|
||||
// Get the name representing the region for this image alone.
|
||||
// I.e. this image's region ids go from 0 to N-1.
|
||||
// But the names might be "0.2.0", "0.2.1" etc. depending on position in composite.
|
||||
// So the last digit represents the region Id, the others represent positions
|
||||
// in composites.
|
||||
virtual wxString GetRegionName(int regionId);
|
||||
|
||||
// Gets the region corresponding to the name, or -1 if not found.
|
||||
virtual int GetRegionId(const wxString& name);
|
||||
|
||||
// Construct names for regions, unique even for children of a composite.
|
||||
virtual void NameRegions(const wxString& parentName = "");
|
||||
|
||||
// Get list of regions
|
||||
inline wxList& GetRegions() { return m_regions; }
|
||||
|
||||
virtual void AddRegion(wxShapeRegion *region);
|
||||
|
||||
virtual void ClearRegions();
|
||||
|
||||
// Assign new ids to this image and children (if composite)
|
||||
void AssignNewIds();
|
||||
|
||||
// Returns actual image (same as 'this' if non-composite) and region id
|
||||
// for given region name.
|
||||
virtual wxShape *FindRegion(const wxString& regionName, int *regionId);
|
||||
|
||||
// Finds all region names for this image (composite or simple).
|
||||
// Supply empty string list.
|
||||
virtual void FindRegionNames(wxStringList& list);
|
||||
|
||||
virtual void ClearText(int regionId = 0);
|
||||
void RemoveLine(wxLineShape *line);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
virtual char *GetFunctor();
|
||||
virtual void WritePrologAttributes(wxExpr *clause);
|
||||
virtual void ReadPrologAttributes(wxExpr *clause);
|
||||
|
||||
// In case the object has constraints it needs to read in in a different pass
|
||||
inline virtual void ReadConstraints(wxExpr *WXUNUSED(clause), wxExprDatabase *WXUNUSED(database)) { };
|
||||
virtual void WriteRegions(wxExpr *clause);
|
||||
virtual void ReadRegions(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the WHOLE copy calling PrivateCopy - don't redefine.
|
||||
// If canvas is non-null, set the canvas too.
|
||||
wxShape *CreateNewCopy(wxShapeCanvas *theCanvas = NULL);
|
||||
|
||||
// Attachment code
|
||||
virtual bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
virtual int GetNumberOfAttachments();
|
||||
virtual bool AttachmentIsValid(int attachment);
|
||||
|
||||
virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||
virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||
|
||||
virtual void MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
float x, float y);
|
||||
|
||||
// Reorders the lines coming into the node image at this attachment
|
||||
// position, in the order in which they appear in linesToSort.
|
||||
virtual void SortLines(int attachment, wxList& linesToSort);
|
||||
|
||||
// This is really to distinguish between lines and other images.
|
||||
// For lines, want to pass drag to canvas, since lines tend to prevent
|
||||
// dragging on a canvas (they get in the way.)
|
||||
virtual bool Draggable() const { return TRUE; }
|
||||
|
||||
// Returns TRUE if image is a descendant of this image
|
||||
bool HasDescendant(wxShape *image);
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxShape& copy);
|
||||
// Returns a new instance, and does the copy for this class. Define for each class.
|
||||
virtual wxShape *PrivateCopy() = 0;
|
||||
|
||||
// Rotate about the given axis by the given amount in radians
|
||||
// (does nothing for most objects)
|
||||
// But even non-rotating objects should record their notional
|
||||
// rotation in case it's important (e.g. in dog-leg code).
|
||||
virtual inline void Rotate(float WXUNUSED(x), float WXUNUSED(y), float theta) { m_rotation = theta; }
|
||||
virtual inline float GetRotation() const { return m_rotation; }
|
||||
|
||||
void ClearAttachments();
|
||||
|
||||
// Recentres all the text regions for this object
|
||||
void Recentre(wxDC& dc);
|
||||
|
||||
// Clears points from a list of wxRealPoints
|
||||
void ClearPointList(wxList& list);
|
||||
|
||||
private:
|
||||
wxObject* m_clientData;
|
||||
|
||||
protected:
|
||||
wxShapeEvtHandler* m_eventHandler;
|
||||
bool m_formatted;
|
||||
float m_xpos, m_ypos;
|
||||
wxPen* m_pen;
|
||||
wxBrush* m_brush;
|
||||
wxFont* m_font;
|
||||
wxColour* m_textColour;
|
||||
wxString m_textColourName;
|
||||
wxShapeCanvas* m_canvas;
|
||||
wxList m_lines;
|
||||
wxList m_text;
|
||||
wxList m_controlPoints;
|
||||
wxList m_regions;
|
||||
wxList m_attachmentPoints;
|
||||
bool m_visible;
|
||||
bool m_disableLabel;
|
||||
long m_id;
|
||||
bool m_selected;
|
||||
bool m_highlighted; // Different from selected: user-defined highlighting,
|
||||
// e.g. thick border.
|
||||
float m_rotation;
|
||||
int m_sensitivity;
|
||||
bool m_draggable;
|
||||
bool m_attachmentMode; // TRUE if using attachments, FALSE otherwise
|
||||
bool m_spaceAttachments; // TRUE if lines at one side should be spaced
|
||||
bool m_fixedWidth;
|
||||
bool m_fixedHeight;
|
||||
bool m_centreResize; // Default is to resize keeping the centre constant (TRUE)
|
||||
bool m_drawHandles; // Don't draw handles if FALSE, usually TRUE
|
||||
wxList m_children; // In case it's composite
|
||||
wxShape* m_parent; // In case it's a child
|
||||
int m_formatMode;
|
||||
int m_shadowMode;
|
||||
wxBrush* m_shadowBrush;
|
||||
int m_shadowOffsetX;
|
||||
int m_shadowOffsetY;
|
||||
int m_textMarginX; // Gap between text and border
|
||||
int m_textMarginY;
|
||||
wxString m_regionName;
|
||||
};
|
||||
|
||||
class wxPolygonShape: public wxShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPolygonShape)
|
||||
public:
|
||||
wxPolygonShape();
|
||||
~wxPolygonShape();
|
||||
|
||||
// Takes a list of wxRealPoints; each point is an OFFSET from the centre.
|
||||
// Deletes user's points in destructor.
|
||||
virtual void Create(wxList *points);
|
||||
|
||||
void GetBoundingBoxMin(float *w, float *h);
|
||||
void CalculateBoundingBox();
|
||||
bool GetPerimeterPoint(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float *x3, float *y3);
|
||||
bool HitTest(float x, float y, int *attachment, float *distance);
|
||||
void SetSize(float x, float y, bool recursive = TRUE);
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
|
||||
|
||||
// A polygon should have a control point at each vertex,
|
||||
// with the option of moving the control points individually
|
||||
// to change the shape.
|
||||
void MakeControlPoints();
|
||||
void ResetControlPoints();
|
||||
|
||||
// If we've changed the shape, must make the original
|
||||
// points match the working points
|
||||
void UpdateOriginalPoints();
|
||||
|
||||
// Add a control point after the given point
|
||||
virtual void AddPolygonPoint(int pos = 0);
|
||||
|
||||
// Delete a control point
|
||||
virtual void DeletePolygonPoint(int pos = 0);
|
||||
|
||||
// Recalculates the centre of the polygon
|
||||
virtual void CalculatePolygonCentre();
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
bool AttachmentIsValid(int attachment);
|
||||
// Does the copying for this object
|
||||
void Copy(wxPolygonShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
inline wxList *GetPoints() { return m_points; }
|
||||
|
||||
private:
|
||||
wxList* m_points;
|
||||
wxList* m_originalPoints;
|
||||
float m_boundWidth;
|
||||
float m_boundHeight;
|
||||
float m_originalWidth;
|
||||
float m_originalHeight;
|
||||
};
|
||||
|
||||
class wxRectangleShape: public wxShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRectangleShape)
|
||||
public:
|
||||
wxRectangleShape(float w = 0.0, float h = 0.0);
|
||||
void GetBoundingBoxMin(float *w, float *h);
|
||||
bool GetPerimeterPoint(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float *x3, float *y3);
|
||||
void OnDraw(wxDC& dc);
|
||||
void SetSize(float x, float y, bool recursive = TRUE);
|
||||
void SetCornerRadius(float rad); // If > 0, rounded corners
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
// Does the copying for this object
|
||||
void Copy(wxRectangleShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
inline float GetWidth() const { return m_width; }
|
||||
inline float GetHeight() const { return m_height; }
|
||||
|
||||
protected:
|
||||
float m_width;
|
||||
float m_height;
|
||||
float m_cornerRadius;
|
||||
};
|
||||
|
||||
class wxTextShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTextShape)
|
||||
public:
|
||||
wxTextShape(float width = 0.0, float height = 0.0);
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxTextShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
};
|
||||
|
||||
class wxEllipseShape: public wxShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxEllipseShape)
|
||||
public:
|
||||
wxEllipseShape(float w = 0.0, float h = 0.0);
|
||||
|
||||
void GetBoundingBoxMin(float *w, float *h);
|
||||
bool GetPerimeterPoint(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float *x3, float *y3);
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void SetSize(float x, float y, bool recursive = TRUE);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxEllipseShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
inline float GetWidth() const { return m_width; }
|
||||
inline float GetHeight() const { return m_height; }
|
||||
|
||||
protected:
|
||||
float m_width;
|
||||
float m_height;
|
||||
};
|
||||
|
||||
class wxCircleShape: public wxEllipseShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCircleShape)
|
||||
public:
|
||||
wxCircleShape(float w = 0.0);
|
||||
|
||||
bool GetPerimeterPoint(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float *x3, float *y3);
|
||||
// Does the copying for this object
|
||||
void Copy(wxCircleShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_BASIC_H_
|
@@ -1,195 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: basicp.h
|
||||
// Purpose: Private OGL classes and definitions
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_BASICP_H_
|
||||
#define _OGL_BASICP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "basicp.h"
|
||||
#endif
|
||||
|
||||
#define CONTROL_POINT_SIZE 6
|
||||
|
||||
class wxShapeTextLine: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxShapeTextLine)
|
||||
public:
|
||||
wxShapeTextLine(float the_x = 0.0, float the_y = 0.0, const wxString& the_line = "");
|
||||
~wxShapeTextLine();
|
||||
|
||||
inline float GetX() const { return m_x; }
|
||||
inline float GetY() const { return m_y; }
|
||||
|
||||
inline void SetX(float x) { m_x = x; }
|
||||
inline void SetY(float y) { m_y = y; }
|
||||
|
||||
inline void SetText(const wxString& text) { m_line = text; }
|
||||
inline wxString GetText() const { return m_line; }
|
||||
|
||||
protected:
|
||||
wxString m_line;
|
||||
float m_x;
|
||||
float m_y;
|
||||
};
|
||||
|
||||
class wxControlPoint: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxControlPoint)
|
||||
|
||||
public:
|
||||
wxControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, float size = 0.0, float the_xoffset = 0.0,
|
||||
float the_yoffset = 0.0, int the_type = 0);
|
||||
~wxControlPoint();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnErase(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
|
||||
bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
int GetNumberOfAttachments();
|
||||
|
||||
inline void SetEraseObject(bool er) { m_eraseObject = er; }
|
||||
|
||||
public:
|
||||
int m_type;
|
||||
float m_xoffset;
|
||||
float m_yoffset;
|
||||
wxShape* m_shape;
|
||||
wxCursor* m_oldCursor;
|
||||
bool m_eraseObject; // If TRUE, erases object before dragging handle.
|
||||
|
||||
};
|
||||
|
||||
class wxPolygonControlPoint: public wxControlPoint
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPolygonControlPoint)
|
||||
|
||||
public:
|
||||
wxPolygonControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, float size = 0.0, wxRealPoint *vertex = NULL,
|
||||
float the_xoffset = 0.0, float the_yoffset = 0.0);
|
||||
~wxPolygonControlPoint();
|
||||
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
|
||||
public:
|
||||
wxRealPoint* m_polygonVertex;
|
||||
wxRealPoint m_originalSize;
|
||||
float m_originalDistance;
|
||||
};
|
||||
|
||||
/*
|
||||
* Object regions.
|
||||
* Every shape has one or more text regions with various
|
||||
* properties. Not all of a region's properties will be used
|
||||
* by a shape.
|
||||
*
|
||||
*/
|
||||
|
||||
class wxShapeRegion: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxShapeRegion)
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
wxShapeRegion();
|
||||
// Copy constructor
|
||||
wxShapeRegion(wxShapeRegion& region);
|
||||
// Destructor
|
||||
~wxShapeRegion();
|
||||
|
||||
// Accessors
|
||||
inline void SetText(const wxString& s) { m_regionText = s; }
|
||||
void SetFont(wxFont *f);
|
||||
void SetMinSize(float w, float h);
|
||||
void SetSize(float w, float h);
|
||||
void SetPosition(float x, float y);
|
||||
void SetProportions(float x, float y);
|
||||
void SetFormatMode(int mode);
|
||||
inline void SetName(const wxString& s) { m_regionName = s; };
|
||||
void SetColour(const wxString& col); // Text colour
|
||||
|
||||
inline wxString GetText() const { return m_regionText; }
|
||||
inline wxFont *GetFont() const { return m_font; }
|
||||
inline void GetMinSize(float *x, float *y) const { *x = m_minWidth; *y = m_minHeight; }
|
||||
inline void GetProportion(float *x, float *y) const { *x = m_regionProportionX; *y = m_regionProportionY; }
|
||||
inline void GetSize(float *x, float *y) const { *x = m_width; *y = m_height; }
|
||||
inline void GetPosition(float *xp, float *yp) const { *xp = m_x; *yp = m_y; }
|
||||
inline int GetFormatMode() const { return m_formatMode; }
|
||||
inline wxString GetName() const { return m_regionName; }
|
||||
inline wxString GetColour() const { return m_textColour; }
|
||||
wxColour *GetActualColourObject();
|
||||
inline wxList& GetFormattedText() { return m_formattedText; }
|
||||
inline wxString GetPenColour() const { return m_penColour; }
|
||||
inline int GetPenStyle() const { return m_penStyle; }
|
||||
inline void SetPenStyle(int style) { m_penStyle = style; m_actualPenObject = NULL; }
|
||||
void SetPenColour(const wxString& col);
|
||||
wxPen *GetActualPen();
|
||||
inline float GetWidth() const { return m_width; }
|
||||
inline float GetHeight() const { return m_height; }
|
||||
|
||||
void ClearText();
|
||||
|
||||
public:
|
||||
wxString m_regionText;
|
||||
wxList m_formattedText; // List of wxShapeTextLines
|
||||
wxFont* m_font;
|
||||
float m_minHeight; // If zero, hide region.
|
||||
float m_minWidth; // If zero, hide region.
|
||||
float m_width;
|
||||
float m_height;
|
||||
float m_x;
|
||||
float m_y;
|
||||
|
||||
float m_regionProportionX; // Proportion of total object size;
|
||||
// -1.0 indicates equal proportion
|
||||
float m_regionProportionY; // Proportion of total object size;
|
||||
// -1.0 indicates equal proportion
|
||||
|
||||
int m_formatMode; // FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT | FORMAT_NONE
|
||||
wxString m_regionName;
|
||||
wxString m_textColour;
|
||||
wxColour* m_actualColourObject; // For speed purposes
|
||||
|
||||
// New members for specifying divided rectangle division colour/style 30/6/94
|
||||
wxString m_penColour;
|
||||
int m_penStyle;
|
||||
wxPen* m_actualPenObject;
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* User-defined attachment point
|
||||
*/
|
||||
|
||||
class wxAttachmentPoint: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxAttachmentPoint)
|
||||
|
||||
public:
|
||||
inline wxAttachmentPoint()
|
||||
{
|
||||
m_id = 0; m_x = 0.0; m_y = 0.0;
|
||||
}
|
||||
|
||||
public:
|
||||
int m_id; // Identifier
|
||||
float m_x; // x offset from centre of object
|
||||
float m_y; // y offset from centre of object
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_BASICP_H_
|
@@ -1,126 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.cpp
|
||||
// Purpose: Bitmap shape class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "bitmap.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
#include "basicp.h"
|
||||
#include "canvas.h"
|
||||
#include "bitmap.h"
|
||||
#include "misc.h"
|
||||
|
||||
/*
|
||||
* Bitmap object
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapShape, wxShape)
|
||||
|
||||
wxBitmapShape::wxBitmapShape():wxRectangleShape(100.0, 50.0)
|
||||
{
|
||||
m_filename = "";
|
||||
}
|
||||
|
||||
wxBitmapShape::~wxBitmapShape()
|
||||
{
|
||||
}
|
||||
|
||||
void wxBitmapShape::OnDraw(wxDC& dc)
|
||||
{
|
||||
if (!m_bitmap.Ok())
|
||||
return;
|
||||
|
||||
wxMemoryDC tempDC;
|
||||
tempDC.SelectObject(m_bitmap);
|
||||
float x, y;
|
||||
x = (long)(m_xpos - m_bitmap.GetWidth() / 2.0);
|
||||
y = (long)(m_ypos - m_bitmap.GetHeight() / 2.0);
|
||||
dc.Blit(x, y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), &tempDC, 0, 0);
|
||||
}
|
||||
|
||||
void wxBitmapShape::SetSize(float w, float h, bool recursive)
|
||||
{
|
||||
if (m_bitmap.Ok())
|
||||
{
|
||||
w = m_bitmap.GetWidth();
|
||||
h = m_bitmap.GetHeight();
|
||||
}
|
||||
|
||||
SetAttachmentSize(w, h);
|
||||
|
||||
m_width = w;
|
||||
m_height = h;
|
||||
SetDefaultRegionSize();
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *wxBitmapShape::GetFunctor()
|
||||
{
|
||||
return "node_image";
|
||||
}
|
||||
|
||||
void wxBitmapShape::WritePrologAttributes(wxExpr *clause)
|
||||
{
|
||||
// Can't really save the bitmap; so instantiate the bitmap
|
||||
// at a higher level in the application, from a symbol library.
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
clause->AddAttributeValueString("filename", m_filename);
|
||||
}
|
||||
|
||||
void wxBitmapShape::ReadPrologAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
clause->GetAttributeValue("filename", m_filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
void wxBitmapShape::Copy(wxBitmapShape& copy)
|
||||
{
|
||||
wxRectangleShape::Copy(copy);
|
||||
copy.m_bitmap = m_bitmap;
|
||||
copy.SetFilename(m_filename);
|
||||
}
|
||||
|
||||
// Returns a new instance, and does the copy for this class. Define for each class.
|
||||
wxShape *wxBitmapShape::PrivateCopy()
|
||||
{
|
||||
wxBitmapShape *obj = new wxBitmapShape;
|
||||
Copy(*obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
void wxBitmapShape::SetBitmap(const wxBitmap& bm)
|
||||
{
|
||||
m_bitmap = bm;
|
||||
if (m_bitmap.Ok())
|
||||
SetSize(m_bitmap.GetWidth(), m_bitmap.GetHeight());
|
||||
}
|
||||
|
||||
|
@@ -1,57 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.h
|
||||
// Purpose: wxBitmapShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_BITMAP_H_
|
||||
#define _OGL_BITMAP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bitmap.h"
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
|
||||
class wxBitmapShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapShape)
|
||||
public:
|
||||
wxBitmapShape();
|
||||
~wxBitmapShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *GetFunctor();
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxBitmapShape& copy);
|
||||
|
||||
// Returns a new instance, and does the copy for this class. Define for each class.
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
void SetSize(float w, float h, bool recursive = TRUE);
|
||||
inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_bitmap; }
|
||||
void SetBitmap(const wxBitmap& bm);
|
||||
inline void SetFilename(const wxString& f) { m_filename = f; };
|
||||
inline wxString GetFilename() const { return m_filename; }
|
||||
|
||||
private:
|
||||
wxBitmap m_bitmap;
|
||||
wxString m_filename;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_BITMAP_H_
|
||||
|
||||
|
@@ -1,511 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: canvas.cpp
|
||||
// Purpose: Shape canvas class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "canvas.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#if USE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "basic.h"
|
||||
#include "basicp.h"
|
||||
#include "canvas.h"
|
||||
#include "ogldiag.h"
|
||||
#include "misc.h"
|
||||
#include "lines.h"
|
||||
#include "composit.h"
|
||||
|
||||
#define CONTROL_POINT_SIZE 6
|
||||
|
||||
// Control point types
|
||||
// Rectangle and most other shapes
|
||||
#define CONTROL_POINT_VERTICAL 1
|
||||
#define CONTROL_POINT_HORIZONTAL 2
|
||||
#define CONTROL_POINT_DIAGONAL 3
|
||||
|
||||
// Line
|
||||
#define CONTROL_POINT_ENDPOINT_TO 4
|
||||
#define CONTROL_POINT_ENDPOINT_FROM 5
|
||||
#define CONTROL_POINT_LINE 6
|
||||
|
||||
extern wxCursor *GraphicsBullseyeCursor;
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxShapeCanvas, wxScrolledWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxShapeCanvas, wxScrolledWindow)
|
||||
EVT_PAINT(wxShapeCanvas::OnPaint)
|
||||
EVT_MOUSE_EVENTS(wxShapeCanvas::OnMouseEvent)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Object canvas
|
||||
wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style):
|
||||
wxScrolledWindow(parent, id, pos, size, style)
|
||||
{
|
||||
m_shapeDiagram = NULL;
|
||||
m_dragState = NoDragging;
|
||||
m_draggedShape = NULL;
|
||||
m_oldDragX = 0;
|
||||
m_oldDragY = 0;
|
||||
m_firstDragX = 0;
|
||||
m_firstDragY = 0;
|
||||
m_checkTolerance = TRUE;
|
||||
}
|
||||
|
||||
wxShapeCanvas::~wxShapeCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
PrepareDC(dc);
|
||||
|
||||
dc.Clear();
|
||||
|
||||
if (GetDiagram())
|
||||
GetDiagram()->Redraw(dc);
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
|
||||
wxPoint logPos(event.GetLogicalPosition(dc));
|
||||
|
||||
float x, y;
|
||||
x = (float) logPos.x;
|
||||
y = (float) logPos.y;
|
||||
|
||||
int keys = 0;
|
||||
if (event.ShiftDown())
|
||||
keys = keys | KEY_SHIFT;
|
||||
if (event.ControlDown())
|
||||
keys = keys | KEY_CTRL;
|
||||
|
||||
bool dragging = event.Dragging();
|
||||
|
||||
// Check if we're within the tolerance for mouse movements.
|
||||
// If we're very close to the position we started dragging
|
||||
// from, this may not be an intentional drag at all.
|
||||
if (dragging)
|
||||
{
|
||||
int dx = abs(dc.LogicalToDeviceX(x - m_firstDragX));
|
||||
int dy = abs(dc.LogicalToDeviceY(y - m_firstDragY));
|
||||
if (m_checkTolerance && (dx <= GetDiagram()->GetMouseTolerance()) && (dy <= GetDiagram()->GetMouseTolerance()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
// If we've ignored the tolerance once, then ALWAYS ignore
|
||||
// tolerance in this drag, even if we come back within
|
||||
// the tolerance range.
|
||||
m_checkTolerance = FALSE;
|
||||
}
|
||||
|
||||
// Dragging - note that the effect of dragging is left entirely up
|
||||
// to the object, so no movement is done unless explicitly done by
|
||||
// object.
|
||||
if (dragging && m_draggedShape && m_dragState == StartDraggingLeft)
|
||||
{
|
||||
m_dragState = ContinueDraggingLeft;
|
||||
|
||||
// If the object isn't m_draggable, transfer message to canvas
|
||||
if (m_draggedShape->Draggable())
|
||||
m_draggedShape->GetEventHandler()->OnBeginDragLeft((float)x, (float)y, keys, m_draggedAttachment);
|
||||
else
|
||||
{
|
||||
m_draggedShape = NULL;
|
||||
OnBeginDragLeft((float)x, (float)y, keys);
|
||||
}
|
||||
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (dragging && m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
// Continue dragging
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(TRUE, (float)x, (float)y, keys, m_draggedAttachment);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.LeftUp() && m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnEndDragLeft((float)x, (float)y, keys, m_draggedAttachment);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
else if (dragging && m_draggedShape && m_dragState == StartDraggingRight)
|
||||
{
|
||||
m_dragState = ContinueDraggingRight;
|
||||
|
||||
if (m_draggedShape->Draggable())
|
||||
m_draggedShape->GetEventHandler()->OnBeginDragRight((float)x, (float)y, keys, m_draggedAttachment);
|
||||
else
|
||||
{
|
||||
m_draggedShape = NULL;
|
||||
OnBeginDragRight((float)x, (float)y, keys);
|
||||
}
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (dragging && m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
// Continue dragging
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(TRUE, (float)x, (float)y, keys, m_draggedAttachment);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.RightUp() && m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnEndDragRight((float)x, (float)y, keys, m_draggedAttachment);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
|
||||
// All following events sent to canvas, not object
|
||||
else if (dragging && !m_draggedShape && m_dragState == StartDraggingLeft)
|
||||
{
|
||||
m_dragState = ContinueDraggingLeft;
|
||||
OnBeginDragLeft((float)x, (float)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
// Continue dragging
|
||||
OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragLeft(TRUE, (float)x, (float)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.LeftUp() && !m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
|
||||
OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnEndDragLeft((float)x, (float)y, keys);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
else if (dragging && !m_draggedShape && m_dragState == StartDraggingRight)
|
||||
{
|
||||
m_dragState = ContinueDraggingRight;
|
||||
OnBeginDragRight((float)x, (float)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
// Continue dragging
|
||||
OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragRight(TRUE, (float)x, (float)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.RightUp() && !m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
|
||||
OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnEndDragRight((float)x, (float)y, keys);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
|
||||
// Non-dragging events
|
||||
else if (event.IsButton())
|
||||
{
|
||||
m_checkTolerance = TRUE;
|
||||
|
||||
// Find the nearest object
|
||||
int attachment = 0;
|
||||
wxShape *nearest_object = FindShape(x, y, &attachment);
|
||||
if (nearest_object) // Object event
|
||||
{
|
||||
if (event.LeftDown())
|
||||
{
|
||||
m_draggedShape = nearest_object;
|
||||
m_draggedAttachment = attachment;
|
||||
m_dragState = StartDraggingLeft;
|
||||
m_firstDragX = x;
|
||||
m_firstDragY = y;
|
||||
}
|
||||
else if (event.LeftUp())
|
||||
{
|
||||
// N.B. Only register a click if the same object was
|
||||
// identified for down *and* up.
|
||||
if (nearest_object == m_draggedShape)
|
||||
nearest_object->GetEventHandler()->OnLeftClick((float)x, (float)y, keys, attachment);
|
||||
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = NoDragging;
|
||||
}
|
||||
else if (event.RightDown())
|
||||
{
|
||||
m_draggedShape = nearest_object;
|
||||
m_draggedAttachment = attachment;
|
||||
m_dragState = StartDraggingRight;
|
||||
m_firstDragX = x;
|
||||
m_firstDragY = y;
|
||||
}
|
||||
else if (event.RightUp())
|
||||
{
|
||||
if (nearest_object == m_draggedShape)
|
||||
nearest_object->GetEventHandler()->OnRightClick((float)x, (float)y, keys, attachment);
|
||||
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = NoDragging;
|
||||
}
|
||||
}
|
||||
else // Canvas event (no nearest object)
|
||||
{
|
||||
if (event.LeftDown())
|
||||
{
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = StartDraggingLeft;
|
||||
m_firstDragX = x;
|
||||
m_firstDragY = y;
|
||||
}
|
||||
else if (event.LeftUp())
|
||||
{
|
||||
OnLeftClick((float)x, (float)y, keys);
|
||||
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = NoDragging;
|
||||
}
|
||||
else if (event.RightDown())
|
||||
{
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = StartDraggingRight;
|
||||
m_firstDragX = x;
|
||||
m_firstDragY = y;
|
||||
}
|
||||
else if (event.RightUp())
|
||||
{
|
||||
OnRightClick((float)x, (float)y, keys);
|
||||
|
||||
m_draggedShape = NULL;
|
||||
m_dragState = NoDragging;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to find a sensitive object, working up the hierarchy of composites.
|
||||
*
|
||||
*/
|
||||
wxShape *wxShapeCanvas::FindFirstSensitiveShape(float x, float y, int *new_attachment, int op)
|
||||
{
|
||||
wxShape *image = FindShape(x, y, new_attachment);
|
||||
if (!image) return NULL;
|
||||
|
||||
wxShape *actualImage = FindFirstSensitiveShape1(image, op);
|
||||
if (actualImage)
|
||||
{
|
||||
float dist;
|
||||
// Find actual attachment
|
||||
actualImage->HitTest(x, y, new_attachment, &dist);
|
||||
}
|
||||
return actualImage;
|
||||
}
|
||||
|
||||
wxShape *wxShapeCanvas::FindFirstSensitiveShape1(wxShape *image, int op)
|
||||
{
|
||||
if (image->GetSensitivityFilter() & op)
|
||||
return image;
|
||||
if (image->GetParent())
|
||||
return FindFirstSensitiveShape1(image->GetParent(), op);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Helper function: TRUE if 'contains' wholly contains 'contained'.
|
||||
static bool WhollyContains(wxShape *contains, wxShape *contained)
|
||||
{
|
||||
float xp1, yp1, xp2, yp2;
|
||||
float w1, h1, w2, h2;
|
||||
float left1, top1, right1, bottom1, left2, top2, right2, bottom2;
|
||||
|
||||
xp1 = contains->GetX(); yp1 = contains->GetY(); xp2 = contained->GetX(); yp2 = contained->GetY();
|
||||
contains->GetBoundingBoxMax(&w1, &h1);
|
||||
contained->GetBoundingBoxMax(&w2, &h2);
|
||||
|
||||
left1 = (float)(xp1 - (w1 / 2.0));
|
||||
top1 = (float)(yp1 - (h1 / 2.0));
|
||||
right1 = (float)(xp1 + (w1 / 2.0));
|
||||
bottom1 = (float)(yp1 + (h1 / 2.0));
|
||||
|
||||
left2 = (float)(xp2 - (w2 / 2.0));
|
||||
top2 = (float)(yp2 - (h2 / 2.0));
|
||||
right2 = (float)(xp2 + (w2 / 2.0));
|
||||
bottom2 = (float)(yp2 + (h2 / 2.0));
|
||||
|
||||
return ((left1 <= left2) && (top1 <= top2) && (right1 >= right2) && (bottom1 >= bottom2));
|
||||
}
|
||||
|
||||
wxShape *wxShapeCanvas::FindShape(float x, float y, int *attachment, wxClassInfo *info, wxShape *notObject)
|
||||
{
|
||||
float nearest = 100000.0;
|
||||
int nearest_attachment = 0;
|
||||
wxShape *nearest_object = NULL;
|
||||
|
||||
// Go backward through the object list, since we want:
|
||||
// (a) to have the control points drawn LAST to overlay
|
||||
// the other objects
|
||||
// (b) to find the control points FIRST if they exist
|
||||
|
||||
wxNode *current = GetDiagram()->GetShapeList()->Last();
|
||||
while (current)
|
||||
{
|
||||
wxShape *object = (wxShape *)current->Data();
|
||||
|
||||
float dist;
|
||||
int temp_attachment;
|
||||
|
||||
// First pass for lines, which might be inside a container, so we
|
||||
// want lines to take priority over containers. This first loop
|
||||
// could fail if we clickout side a line, so then we'll
|
||||
// try other shapes.
|
||||
if (object->IsShown() &&
|
||||
object->IsKindOf(CLASSINFO(wxLineShape)) &&
|
||||
object->HitTest(x, y, &temp_attachment, &dist) &&
|
||||
((info == NULL) || object->IsKindOf(info)) &&
|
||||
(!notObject || !notObject->HasDescendant(object)))
|
||||
{
|
||||
// A line is trickier to spot than a normal object.
|
||||
// For a line, since it's the diagonal of the box
|
||||
// we use for the hit test, we may have several
|
||||
// lines in the box and therefore we need to be able
|
||||
// to specify the nearest point to the centre of the line
|
||||
// as our hit criterion, to give the user some room for
|
||||
// manouevre.
|
||||
if (dist < nearest)
|
||||
{
|
||||
nearest = dist;
|
||||
nearest_object = object;
|
||||
nearest_attachment = temp_attachment;
|
||||
}
|
||||
}
|
||||
if (current)
|
||||
current = current->Previous();
|
||||
}
|
||||
|
||||
current = GetDiagram()->GetShapeList()->Last();
|
||||
while (current)
|
||||
{
|
||||
wxShape *object = (wxShape *)current->Data();
|
||||
float dist;
|
||||
int temp_attachment;
|
||||
|
||||
// On second pass, only ever consider non-composites or divisions. If children want to pass
|
||||
// up control to the composite, that's up to them.
|
||||
if (object->IsShown() && (object->IsKindOf(CLASSINFO(wxDivisionShape)) || !object->IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
&& object->HitTest(x, y, &temp_attachment, &dist) && ((info == NULL) || object->IsKindOf(info)) &&
|
||||
(!notObject || !notObject->HasDescendant(object)))
|
||||
{
|
||||
if (!object->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
// If we've hit a container, and we have already found a line in the
|
||||
// first pass, then ignore the container in case the line is in the container.
|
||||
// Check for division in case line straddles divisions (i.e. is not wholly contained).
|
||||
if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object)))
|
||||
{
|
||||
nearest = dist;
|
||||
nearest_object = object;
|
||||
nearest_attachment = temp_attachment;
|
||||
current = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (current)
|
||||
current = current->Previous();
|
||||
}
|
||||
|
||||
*attachment = nearest_attachment;
|
||||
return nearest_object;
|
||||
}
|
||||
|
||||
/*
|
||||
* Higher-level events called by OnEvent
|
||||
*
|
||||
*/
|
||||
|
||||
void wxShapeCanvas::OnLeftClick(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnRightClick(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnDragLeft(bool draw, float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnBeginDragLeft(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnEndDragLeft(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnDragRight(bool draw, float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnBeginDragRight(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::OnEndDragRight(float x, float y, int keys)
|
||||
{
|
||||
}
|
||||
|
||||
void wxShapeCanvas::AddShape(wxShape *object, wxShape *addAfter)
|
||||
{ GetDiagram()->AddShape(object, addAfter); }
|
||||
void wxShapeCanvas::InsertShape(wxShape *object)
|
||||
{ GetDiagram()->InsertShape(object); }
|
||||
void wxShapeCanvas::RemoveShape(wxShape *object)
|
||||
{ GetDiagram()->RemoveShape(object); }
|
||||
bool wxShapeCanvas::GetQuickEditMode()
|
||||
{ return GetDiagram()->GetQuickEditMode(); }
|
||||
void wxShapeCanvas::Redraw(wxDC& dc)
|
||||
{ GetDiagram()->Redraw(dc); }
|
||||
void wxShapeCanvas::Snap(float *x, float *y)
|
||||
{ GetDiagram()->Snap(x, y); }
|
@@ -1,83 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: canvas.h
|
||||
// Purpose: wxShapeCanvas
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_CANVAS_H_
|
||||
#define _OGL_CANVAS_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "canvas.h"
|
||||
#endif
|
||||
|
||||
// Drag states
|
||||
#define NoDragging 0
|
||||
#define StartDraggingLeft 1
|
||||
#define ContinueDraggingLeft 2
|
||||
#define StartDraggingRight 3
|
||||
#define ContinueDraggingRight 4
|
||||
|
||||
// When drag_count reaches 0, process drag message
|
||||
|
||||
class wxDiagram;
|
||||
|
||||
class wxShapeCanvas: public wxScrolledWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxShapeCanvas)
|
||||
public:
|
||||
wxShapeCanvas(wxWindow *parent = NULL, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxBORDER | wxRETAINED);
|
||||
~wxShapeCanvas();
|
||||
|
||||
inline void SetDiagram(wxDiagram *diag) { m_shapeDiagram = diag; }
|
||||
inline wxDiagram *GetDiagram() const { return m_shapeDiagram; }
|
||||
|
||||
virtual void OnLeftClick(float x, float y, int keys = 0);
|
||||
virtual void OnRightClick(float x, float y, int keys = 0);
|
||||
|
||||
virtual void OnDragLeft(bool draw, float x, float y, int keys=0); // Erase if draw false
|
||||
virtual void OnBeginDragLeft(float x, float y, int keys=0);
|
||||
virtual void OnEndDragLeft(float x, float y, int keys=0);
|
||||
|
||||
virtual void OnDragRight(bool draw, float x, float y, int keys=0); // Erase if draw false
|
||||
virtual void OnBeginDragRight(float x, float y, int keys=0);
|
||||
virtual void OnEndDragRight(float x, float y, int keys=0);
|
||||
|
||||
// Find object for mouse click, of given wxClassInfo (NULL for any type).
|
||||
// If notImage is non-NULL, don't find an object that is equal to or a descendant of notImage
|
||||
virtual wxShape *FindShape(float x, float y, int *attachment, wxClassInfo *info = NULL, wxShape *notImage = NULL);
|
||||
wxShape *FindFirstSensitiveShape(float x, float y, int *new_attachment, int op);
|
||||
wxShape *FindFirstSensitiveShape1(wxShape *image, int op);
|
||||
|
||||
// Redirect to wxDiagram object
|
||||
virtual void AddShape(wxShape *object, wxShape *addAfter = NULL);
|
||||
virtual void InsertShape(wxShape *object);
|
||||
virtual void RemoveShape(wxShape *object);
|
||||
virtual bool GetQuickEditMode();
|
||||
virtual void Redraw(wxDC& dc);
|
||||
void Snap(float *x, float *y);
|
||||
|
||||
// Events
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
|
||||
protected:
|
||||
wxDiagram* m_shapeDiagram;
|
||||
int m_dragState;
|
||||
float m_oldDragX, m_oldDragY; // Previous drag coordinates
|
||||
float m_firstDragX, m_firstDragY; // INITIAL drag coordinates
|
||||
bool m_checkTolerance; // Whether to check drag tolerance
|
||||
wxShape* m_draggedShape;
|
||||
int m_draggedAttachment;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_CANVAS_H_
|
@@ -1,244 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: composit.h
|
||||
// Purpose: wxCompositeShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_COMPOSIT_H_
|
||||
#define _OGL_COMPOSIT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "composit.h"
|
||||
#endif
|
||||
|
||||
class wxDivisionShape;
|
||||
class OGLConstraint;
|
||||
|
||||
/*
|
||||
* A composite object is an invisible rectangle surrounding all children
|
||||
*
|
||||
*/
|
||||
|
||||
class wxCompositeShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCompositeShape)
|
||||
public:
|
||||
|
||||
wxCompositeShape();
|
||||
~wxCompositeShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
void OnErase(wxDC& dc);
|
||||
bool OnMovePre(wxDC& dc, float x, float y, float oldX, float oldY, bool display = TRUE);
|
||||
void OnDragLeft(bool draw, float x, float y, int keys, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys, int attachment = 0);
|
||||
|
||||
void OnRightClick(float x, float y, int keys, int attachment = 0);
|
||||
|
||||
void SetSize(float w, float h, bool recursive = TRUE);
|
||||
|
||||
// Returns TRUE if it settled down
|
||||
bool Recompute();
|
||||
|
||||
// New members
|
||||
void AddChild(wxShape *child, wxShape *addAfter = NULL);
|
||||
void RemoveChild(wxShape *child);
|
||||
|
||||
OGLConstraint *AddConstraint(OGLConstraint *constraint);
|
||||
OGLConstraint *AddConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
OGLConstraint *AddConstraint(int type, wxShape *constraining, wxShape *constrained);
|
||||
|
||||
void DeleteConstraint(OGLConstraint *constraint);
|
||||
|
||||
// Delete constraints that involve this child.
|
||||
void DeleteConstraintsInvolvingChild(wxShape *child);
|
||||
|
||||
// Remove the image from any constraints involving it, but DON'T
|
||||
// remove any constraints.
|
||||
void RemoveChildFromConstraints(wxShape *child);
|
||||
|
||||
// Find constraint, also returning actual composite the constraint was in,
|
||||
// in case it had to find it recursively.
|
||||
OGLConstraint *FindConstraint(long id, wxCompositeShape **actualComposite = NULL);
|
||||
|
||||
// Returns TRUE if something changed
|
||||
bool Constrain();
|
||||
|
||||
// Make this composite into a container by creating one wxDivisionShape
|
||||
void MakeContainer();
|
||||
|
||||
// Calculates size and position of composite object based on children
|
||||
void CalculateSize();
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
// In case the object has constraints it needs to read in in a different pass
|
||||
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
|
||||
#endif
|
||||
// Does the copying for this object
|
||||
void Copy(wxCompositeShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
virtual wxDivisionShape *OnCreateDivision();
|
||||
|
||||
// Finds the image used to visualize a container. This is any child
|
||||
// of the composite that is not in the divisions list.
|
||||
wxShape *FindContainerImage();
|
||||
|
||||
// Returns TRUE if division is a descendant of this container
|
||||
bool ContainsDivision(wxDivisionShape *division);
|
||||
|
||||
inline wxList& GetDivisions() const { return (wxList&) m_divisions; }
|
||||
inline wxList& GetConstraints() const { return (wxList&) m_constraints; }
|
||||
|
||||
protected:
|
||||
float m_oldX;
|
||||
float m_oldY;
|
||||
wxList m_constraints;
|
||||
wxList m_divisions; // In case it's a container
|
||||
};
|
||||
|
||||
/*
|
||||
* A division object is a composite with special properties,
|
||||
* to be used for containment. It's a subdivision of a container.
|
||||
* A containing node image consists of a composite with a main child shape
|
||||
* such as rounded rectangle, plus a list of division objects.
|
||||
* It needs to be a composite because a division contains pieces
|
||||
* of diagram.
|
||||
* NOTE a container has at least one wxDivisionShape for consistency.
|
||||
* This can be subdivided, so it turns into two objects, then each of
|
||||
* these can be subdivided, etc.
|
||||
*/
|
||||
#define DIVISION_SIDE_NONE 0
|
||||
#define DIVISION_SIDE_LEFT 1
|
||||
#define DIVISION_SIDE_TOP 2
|
||||
#define DIVISION_SIDE_RIGHT 3
|
||||
#define DIVISION_SIDE_BOTTOM 4
|
||||
|
||||
class wxDivisionShape: public wxCompositeShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDivisionShape)
|
||||
public:
|
||||
|
||||
wxDivisionShape();
|
||||
~wxDivisionShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
bool OnMovePre(wxDC& dc, float x, float y, float oldX, float oldY, bool display = TRUE);
|
||||
void OnDragLeft(bool draw, float x, float y, int keys, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys, int attachment = 0);
|
||||
|
||||
void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
|
||||
// Don't want this kind of composite to resize its subdiagrams, so
|
||||
// override composite's SetSize.
|
||||
void SetSize(float w, float h, bool recursive = TRUE);
|
||||
|
||||
// Similarly for calculating size: it's fixed at whatever SetSize
|
||||
// set it to, not in terms of children.
|
||||
void CalculateSize();
|
||||
|
||||
void MakeControlPoints();
|
||||
void ResetControlPoints();
|
||||
void MakeMandatoryControlPoints();
|
||||
void ResetMandatoryControlPoints();
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
// Does the copying for this object
|
||||
void Copy(wxDivisionShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
// Divide horizontally (wxHORIZONTAL) or vertically (wxVERTICAL)
|
||||
bool Divide(int direction);
|
||||
|
||||
// Resize adjoining divisions at the given side. If test is TRUE,
|
||||
// just see whether it's possible for each adjoining region,
|
||||
// returning FALSE if it's not.
|
||||
bool ResizeAdjoining(int side, float newPos, bool test);
|
||||
|
||||
// Adjust a side, returning FALSE if it's not physically possible.
|
||||
bool AdjustLeft(float left, bool test);
|
||||
bool AdjustTop(float top, bool test);
|
||||
bool AdjustRight(float right, bool test);
|
||||
bool AdjustBottom(float bottom, bool test);
|
||||
|
||||
// Edit style of left or top side
|
||||
void EditEdge(int side);
|
||||
|
||||
// Popup menu
|
||||
void PopupMenu(float x, float y);
|
||||
|
||||
inline void SetLeftSide(wxDivisionShape *shape) { m_leftSide = shape; }
|
||||
inline void SetTopSide(wxDivisionShape *shape) { m_topSide = shape; }
|
||||
inline void SetRightSide(wxDivisionShape *shape) { m_rightSide = shape; }
|
||||
inline void SetBottomSide(wxDivisionShape *shape) { m_bottomSide = shape; }
|
||||
inline wxDivisionShape *GetLeftSide() const { return m_leftSide; }
|
||||
inline wxDivisionShape *GetTopSide() const { return m_topSide; }
|
||||
inline wxDivisionShape *GetRightSide() const { return m_rightSide; }
|
||||
inline wxDivisionShape *GetBottomSide() const { return m_bottomSide; }
|
||||
|
||||
inline void SetHandleSide(int side) { m_handleSide = side; }
|
||||
inline int GetHandleSide() const { return m_handleSide; }
|
||||
|
||||
inline void SetLeftSidePen(wxPen *pen) { m_leftSidePen = pen; }
|
||||
inline wxPen *GetLeftSidePen() const { return m_leftSidePen; }
|
||||
inline void SetTopSidePen(wxPen *pen) { m_topSidePen = pen; }
|
||||
inline wxPen *GetTopSidePen() const { return m_topSidePen; }
|
||||
|
||||
void SetLeftSideColour(const wxString& colour);
|
||||
void SetTopSideColour(const wxString& colour);
|
||||
void SetLeftSideStyle(const wxString& style);
|
||||
void SetTopSideStyle(const wxString& style);
|
||||
|
||||
inline wxString GetLeftSideColour() const { return m_leftSideColour; }
|
||||
inline wxString GetTopSideColour() const { return m_topSideColour; }
|
||||
inline wxString GetLeftSideStyle() const { return m_leftSideStyle; }
|
||||
inline wxString GetTopSideStyle() const { return m_topSideStyle; }
|
||||
|
||||
protected:
|
||||
// Adjoining divisions. NULL indicates edge
|
||||
// of container, and that side shouldn't be
|
||||
// drawn.
|
||||
wxDivisionShape* m_leftSide;
|
||||
wxDivisionShape* m_rightSide;
|
||||
wxDivisionShape* m_topSide;
|
||||
wxDivisionShape* m_bottomSide;
|
||||
|
||||
int m_handleSide; // Side at which handle is legal
|
||||
|
||||
wxPen* m_leftSidePen;
|
||||
wxPen* m_topSidePen;
|
||||
wxString m_leftSideColour;
|
||||
wxString m_topSideColour;
|
||||
wxString m_leftSideStyle;
|
||||
wxString m_topSideStyle;
|
||||
};
|
||||
|
||||
extern wxMenu *oglPopupDivisionMenu;
|
||||
extern void oglGraphicsDivisionMenuProc(wxMenu& menu, wxCommandEvent& event);
|
||||
|
||||
#define DIVISION_MENU_SPLIT_HORIZONTALLY 1
|
||||
#define DIVISION_MENU_SPLIT_VERTICALLY 2
|
||||
#define DIVISION_MENU_EDIT_LEFT_EDGE 3
|
||||
#define DIVISION_MENU_EDIT_TOP_EDGE 4
|
||||
#define DIVISION_MENU_EDIT_RIGHT_EDGE 5
|
||||
#define DIVISION_MENU_EDIT_BOTTOM_EDGE 6
|
||||
#define DIVISION_MENU_DELETE_ALL 7
|
||||
|
||||
#endif
|
||||
// _OGL_COMPOSIT_H_
|
@@ -1,600 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: constrnt.cpp
|
||||
// Purpose: OGL Constraint classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "constrnt.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
#include "constrnt.h"
|
||||
#include "canvas.h"
|
||||
|
||||
wxList OGLConstraintTypes(wxKEY_INTEGER);
|
||||
|
||||
/*
|
||||
* Constraint type
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(OGLConstraintType, wxObject)
|
||||
|
||||
OGLConstraintType::OGLConstraintType(int theType, const wxString& theName, const wxString& thePhrase)
|
||||
{
|
||||
m_type = theType;
|
||||
m_name = theName;
|
||||
m_phrase = thePhrase;
|
||||
}
|
||||
|
||||
OGLConstraintType::~OGLConstraintType()
|
||||
{
|
||||
}
|
||||
|
||||
void OGLInitializeConstraintTypes()
|
||||
{
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_CENTRED_VERTICALLY,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t."));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_CENTRED_HORIZONTALLY,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t."));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_CENTRED_BOTH,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t."));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_LEFT_OF,
|
||||
new OGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_RIGHT_OF,
|
||||
new OGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_ABOVE,
|
||||
new OGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_BELOW,
|
||||
new OGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below"));
|
||||
|
||||
// Alignment
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_ALIGNED_TOP,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_ALIGNED_BOTTOM,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_ALIGNED_LEFT,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_ALIGNED_RIGHT,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of"));
|
||||
|
||||
// Mid-alignment
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_MIDALIGNED_TOP,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_MIDALIGNED_BOTTOM,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_MIDALIGNED_LEFT,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of"));
|
||||
|
||||
OGLConstraintTypes.Append(gyCONSTRAINT_MIDALIGNED_RIGHT,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Constraint Stuff
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(OGLConstraint, wxObject)
|
||||
|
||||
OGLConstraint::OGLConstraint(int type, wxShape *constraining, wxList& constrained)
|
||||
{
|
||||
m_xSpacing = 0.0;
|
||||
m_ySpacing = 0.0;
|
||||
|
||||
m_constraintType = type;
|
||||
m_constrainingObject = constraining;
|
||||
|
||||
m_constraintId = 0;
|
||||
m_constraintName = "noname";
|
||||
|
||||
wxNode *node = constrained.First();
|
||||
while (node)
|
||||
{
|
||||
m_constrainedObjects.Append(node->Data());
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
OGLConstraint::~OGLConstraint()
|
||||
{
|
||||
}
|
||||
|
||||
bool OGLConstraint::Equals(float a, float b)
|
||||
{
|
||||
float marg = 0.5;
|
||||
|
||||
bool eq = ((b <= a + marg) && (b >= a - marg));
|
||||
return eq;
|
||||
}
|
||||
|
||||
// Return TRUE if anything changed
|
||||
bool OGLConstraint::Evaluate()
|
||||
{
|
||||
float maxWidth, maxHeight, minWidth, minHeight, x, y;
|
||||
m_constrainingObject->GetBoundingBoxMax(&maxWidth, &maxHeight);
|
||||
m_constrainingObject->GetBoundingBoxMin(&minWidth, &minHeight);
|
||||
x = m_constrainingObject->GetX();
|
||||
y = m_constrainingObject->GetY();
|
||||
|
||||
wxClientDC dc(m_constrainingObject->GetCanvas());
|
||||
m_constrainingObject->GetCanvas()->PrepareDC(dc);
|
||||
|
||||
switch (m_constraintType)
|
||||
{
|
||||
case gyCONSTRAINT_CENTRED_VERTICALLY:
|
||||
{
|
||||
int n = m_constrainedObjects.Number();
|
||||
float totalObjectHeight = 0.0;
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
totalObjectHeight += height2;
|
||||
node = node->Next();
|
||||
}
|
||||
float startY;
|
||||
float spacingY;
|
||||
// Check if within the constraining object...
|
||||
if ((totalObjectHeight + (n + 1)*m_ySpacing) <= minHeight)
|
||||
{
|
||||
spacingY = (float)((minHeight - totalObjectHeight)/(n + 1));
|
||||
startY = (float)(y - (minHeight/2.0));
|
||||
}
|
||||
// Otherwise, use default spacing
|
||||
else
|
||||
{
|
||||
spacingY = m_ySpacing;
|
||||
startY = (float)(y - ((totalObjectHeight + (n+1)*spacingY)/2.0));
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
startY += (float)(spacingY + (height2/2.0));
|
||||
if (!Equals(startY, constrainedObject->GetY()))
|
||||
{
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), startY, FALSE);
|
||||
changed = TRUE;
|
||||
}
|
||||
startY += (float)(height2/2.0);
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_CENTRED_HORIZONTALLY:
|
||||
{
|
||||
int n = m_constrainedObjects.Number();
|
||||
float totalObjectWidth = 0.0;
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
totalObjectWidth += width2;
|
||||
node = node->Next();
|
||||
}
|
||||
float startX;
|
||||
float spacingX;
|
||||
// Check if within the constraining object...
|
||||
if ((totalObjectWidth + (n + 1)*m_xSpacing) <= minWidth)
|
||||
{
|
||||
spacingX = (float)((minWidth - totalObjectWidth)/(n + 1));
|
||||
startX = (float)(x - (minWidth/2.0));
|
||||
}
|
||||
// Otherwise, use default spacing
|
||||
else
|
||||
{
|
||||
spacingX = m_xSpacing;
|
||||
startX = (float)(x - ((totalObjectWidth + (n+1)*spacingX)/2.0));
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
startX += (float)(spacingX + (width2/2.0));
|
||||
if (!Equals(startX, constrainedObject->GetX()))
|
||||
{
|
||||
constrainedObject->Move(dc, startX, constrainedObject->GetY(), FALSE);
|
||||
changed = TRUE;
|
||||
}
|
||||
startX += (float)(width2/2.0);
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_CENTRED_BOTH:
|
||||
{
|
||||
int n = m_constrainedObjects.Number();
|
||||
float totalObjectWidth = 0.0;
|
||||
float totalObjectHeight = 0.0;
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
totalObjectWidth += width2;
|
||||
totalObjectHeight += height2;
|
||||
node = node->Next();
|
||||
}
|
||||
float startX;
|
||||
float spacingX;
|
||||
float startY;
|
||||
float spacingY;
|
||||
|
||||
// Check if within the constraining object...
|
||||
if ((totalObjectWidth + (n + 1)*m_xSpacing) <= minWidth)
|
||||
{
|
||||
spacingX = (float)((minWidth - totalObjectWidth)/(n + 1));
|
||||
startX = (float)(x - (minWidth/2.0));
|
||||
}
|
||||
// Otherwise, use default spacing
|
||||
else
|
||||
{
|
||||
spacingX = m_xSpacing;
|
||||
startX = (float)(x - ((totalObjectWidth + (n+1)*spacingX)/2.0));
|
||||
}
|
||||
|
||||
// Check if within the constraining object...
|
||||
if ((totalObjectHeight + (n + 1)*m_ySpacing) <= minHeight)
|
||||
{
|
||||
spacingY = (float)((minHeight - totalObjectHeight)/(n + 1));
|
||||
startY = (float)(y - (minHeight/2.0));
|
||||
}
|
||||
// Otherwise, use default spacing
|
||||
else
|
||||
{
|
||||
spacingY = m_ySpacing;
|
||||
startY = (float)(y - ((totalObjectHeight + (n+1)*spacingY)/2.0));
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
startX += (float)(spacingX + (width2/2.0));
|
||||
startY += (float)(spacingY + (height2/2.0));
|
||||
|
||||
if ((!Equals(startX, constrainedObject->GetX())) || (!Equals(startY, constrainedObject->GetY())))
|
||||
{
|
||||
constrainedObject->Move(dc, startX, startY, FALSE);
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
startX += (float)(width2/2.0);
|
||||
startY += (float)(height2/2.0);
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_LEFT_OF:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float x3 = (float)(x - (minWidth/2.0) - (width2/2.0) - m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_RIGHT_OF:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float x3 = (float)(x + (minWidth/2.0) + (width2/2.0) + m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
case gyCONSTRAINT_ABOVE:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float y3 = (float)(y - (minHeight/2.0) - (height2/2.0) - m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_BELOW:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float y3 = (float)(y + (minHeight/2.0) + (height2/2.0) + m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_LEFT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float x3 = (float)(x - (minWidth/2.0) + (width2/2.0) + m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_RIGHT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float x3 = (float)(x + (minWidth/2.0) - (width2/2.0) - m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_TOP:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float y3 = (float)(y - (minHeight/2.0) + (height2/2.0) + m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_BOTTOM:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float width2, height2;
|
||||
constrainedObject->GetBoundingBoxMax(&width2, &height2);
|
||||
|
||||
float y3 = (float)(y + (minHeight/2.0) - (height2/2.0) - m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_LEFT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float x3 = (float)(x - (minWidth/2.0));
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_RIGHT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float x3 = (float)(x + (minWidth/2.0));
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_TOP:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float y3 = (float)(y - (minHeight/2.0));
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_BOTTOM:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
|
||||
wxNode *node = m_constrainedObjects.First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *constrainedObject = (wxShape *)node->Data();
|
||||
|
||||
float y3 = (float)(y + (minHeight/2.0));
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -1,86 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: constrnt.h
|
||||
// Purpose: OGL constraint definitions
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_CONSTRNT_H_
|
||||
#define _OGL_CONSTRNT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "constrnt.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OGL Constraints
|
||||
*
|
||||
*/
|
||||
|
||||
class OGLConstraintType: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(OGLConstraintType)
|
||||
public:
|
||||
OGLConstraintType(int type = 0, const wxString& name = "", const wxString& phrase = "");
|
||||
~OGLConstraintType();
|
||||
|
||||
public:
|
||||
int m_type; // E.g. gyCONSTRAINT_CENTRED_VERTICALLY
|
||||
wxString m_name; // E.g. "Centre vertically"
|
||||
wxString m_phrase; // E.g. "centred vertically with respect to", "left of"
|
||||
|
||||
};
|
||||
|
||||
extern wxList OGLConstraintTypes;
|
||||
|
||||
#define gyCONSTRAINT_CENTRED_VERTICALLY 1
|
||||
#define gyCONSTRAINT_CENTRED_HORIZONTALLY 2
|
||||
#define gyCONSTRAINT_CENTRED_BOTH 3
|
||||
#define gyCONSTRAINT_LEFT_OF 4
|
||||
#define gyCONSTRAINT_RIGHT_OF 5
|
||||
#define gyCONSTRAINT_ABOVE 6
|
||||
#define gyCONSTRAINT_BELOW 7
|
||||
#define gyCONSTRAINT_ALIGNED_TOP 8
|
||||
#define gyCONSTRAINT_ALIGNED_BOTTOM 9
|
||||
#define gyCONSTRAINT_ALIGNED_LEFT 10
|
||||
#define gyCONSTRAINT_ALIGNED_RIGHT 11
|
||||
|
||||
// Like aligned, but with the objects centred on the respective edge
|
||||
// of the reference object.
|
||||
#define gyCONSTRAINT_MIDALIGNED_TOP 12
|
||||
#define gyCONSTRAINT_MIDALIGNED_BOTTOM 13
|
||||
#define gyCONSTRAINT_MIDALIGNED_LEFT 14
|
||||
#define gyCONSTRAINT_MIDALIGNED_RIGHT 15
|
||||
|
||||
class OGLConstraint: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(OGLConstraint)
|
||||
public:
|
||||
OGLConstraint() { m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; m_constraintName = ""; m_constraintId = 0;
|
||||
m_constrainingObject = NULL; }
|
||||
OGLConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
~OGLConstraint();
|
||||
|
||||
// Returns TRUE if anything changed
|
||||
bool Evaluate();
|
||||
inline void SetSpacing(float x, float y) { m_xSpacing = x; m_ySpacing = y; };
|
||||
bool Equals(float a, float b);
|
||||
|
||||
float m_xSpacing;
|
||||
float m_ySpacing;
|
||||
int m_constraintType;
|
||||
wxString m_constraintName;
|
||||
long m_constraintId;
|
||||
wxShape* m_constrainingObject;
|
||||
wxList m_constrainedObjects;
|
||||
|
||||
};
|
||||
|
||||
void OGLInitializeConstraintTypes();
|
||||
|
||||
#endif
|
||||
// _OGL_CONSTRNT_H_
|
@@ -1,729 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: divided.cpp
|
||||
// Purpose: wxDividedShape class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "divided.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
#include "basicp.h"
|
||||
#include "canvas.h"
|
||||
#include "divided.h"
|
||||
#include "lines.h"
|
||||
#include "misc.h"
|
||||
|
||||
class wxDividedShapeControlPoint: public wxControlPoint
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDividedShapeControlPoint)
|
||||
private:
|
||||
int regionId;
|
||||
public:
|
||||
wxDividedShapeControlPoint() { regionId = 0; }
|
||||
wxDividedShapeControlPoint(wxShapeCanvas *the_canvas, wxShape *object, int region,
|
||||
float size, float the_xoffset, float the_yoffset, int the_type);
|
||||
~wxDividedShapeControlPoint();
|
||||
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDividedShapeControlPoint, wxControlPoint)
|
||||
|
||||
/*
|
||||
* Divided object
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDividedShape, wxRectangleShape)
|
||||
|
||||
wxDividedShape::wxDividedShape(float w, float h): wxRectangleShape(w, h)
|
||||
{
|
||||
ClearRegions();
|
||||
}
|
||||
|
||||
wxDividedShape::~wxDividedShape()
|
||||
{
|
||||
}
|
||||
|
||||
void wxDividedShape::OnDraw(wxDC& dc)
|
||||
{
|
||||
wxRectangleShape::OnDraw(dc);
|
||||
}
|
||||
|
||||
void wxDividedShape::OnDrawContents(wxDC& dc)
|
||||
{
|
||||
float defaultProportion = (float)(GetRegions().Number() > 0 ? (1.0/((float)(GetRegions().Number()))) : 0.0);
|
||||
float currentY = (float)(m_ypos - (m_height / 2.0));
|
||||
float maxY = (float)(m_ypos + (m_height / 2.0));
|
||||
|
||||
float leftX = (float)(m_xpos - (m_width / 2.0));
|
||||
float rightX = (float)(m_xpos + (m_width / 2.0));
|
||||
|
||||
if (m_pen) dc.SetPen(m_pen);
|
||||
|
||||
if (m_textColour) dc.SetTextForeground(* m_textColour);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// For efficiency, don't do this under X - doesn't make
|
||||
// any visible difference for our purposes.
|
||||
if (m_brush)
|
||||
dc.SetTextBackground(m_brush->GetColour());
|
||||
#endif
|
||||
/*
|
||||
if (!formatted)
|
||||
{
|
||||
FormatRegionText();
|
||||
formatted = TRUE;
|
||||
}
|
||||
*/
|
||||
if (GetDisableLabel()) return;
|
||||
|
||||
float xMargin = 2;
|
||||
float yMargin = 2;
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
wxNode *node = GetRegions().First();
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
dc.SetFont(region->GetFont());
|
||||
dc.SetTextForeground(* region->GetActualColourObject());
|
||||
|
||||
float proportion =
|
||||
region->m_regionProportionY < 0.0 ? defaultProportion : region->m_regionProportionY;
|
||||
|
||||
float y = currentY + m_height*proportion;
|
||||
float actualY = maxY < y ? maxY : y;
|
||||
|
||||
float centreX = m_xpos;
|
||||
float centreY = (float)(currentY + (actualY - currentY)/2.0);
|
||||
|
||||
DrawFormattedText(dc, ®ion->m_formattedText,
|
||||
(float)(centreX), (float)(centreY), (float)(m_width-2*xMargin), (float)(actualY - currentY - 2*yMargin),
|
||||
region->m_formatMode);
|
||||
if ((y <= maxY) && (node->Next()))
|
||||
{
|
||||
wxPen *regionPen = region->GetActualPen();
|
||||
if (regionPen)
|
||||
{
|
||||
dc.SetPen(regionPen);
|
||||
dc.DrawLine(leftX, y, rightX, y);
|
||||
}
|
||||
}
|
||||
|
||||
currentY = actualY;
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
void wxDividedShape::SetSize(float w, float h, bool recursive)
|
||||
{
|
||||
SetAttachmentSize(w, h);
|
||||
m_width = w;
|
||||
m_height = h;
|
||||
SetRegionSizes();
|
||||
}
|
||||
|
||||
void wxDividedShape::SetRegionSizes()
|
||||
{
|
||||
if (GetRegions().Number() == 0)
|
||||
return;
|
||||
|
||||
float defaultProportion = (float)(GetRegions().Number() > 0 ? (1.0/((float)(GetRegions().Number()))) : 0.0);
|
||||
float currentY = (float)(m_ypos - (m_height / 2.0));
|
||||
float maxY = (float)(m_ypos + (m_height / 2.0));
|
||||
|
||||
// float leftX = (float)(m_xpos - (m_width / 2.0));
|
||||
// float rightX = (float)(m_xpos + (m_width / 2.0));
|
||||
|
||||
wxNode *node = GetRegions().First();
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
float proportion =
|
||||
region->m_regionProportionY <= 0.0 ? defaultProportion : region->m_regionProportionY;
|
||||
|
||||
float sizeY = (float)proportion*m_height;
|
||||
float y = currentY + sizeY;
|
||||
float actualY = maxY < y ? maxY : y;
|
||||
|
||||
float centreY = (float)(currentY + (actualY - currentY)/2.0);
|
||||
|
||||
region->SetSize(m_width, sizeY);
|
||||
region->SetPosition(0.0, (float)(centreY - m_ypos));
|
||||
currentY = actualY;
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
// Attachment points correspond to regions in the divided box
|
||||
bool wxDividedShape::GetAttachmentPosition(int attachment, float *x, float *y, int nth, int no_arcs,
|
||||
wxLineShape *line)
|
||||
{
|
||||
int totalNumberAttachments = (GetRegions().Number() * 2) + 2;
|
||||
if (!GetAttachmentMode() || (attachment >= totalNumberAttachments))
|
||||
{
|
||||
return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs);
|
||||
}
|
||||
|
||||
int n = GetRegions().Number();
|
||||
bool isEnd = (line && line->IsEnd(this));
|
||||
|
||||
float left = (float)(m_xpos - m_width/2.0);
|
||||
float right = (float)(m_xpos + m_width/2.0);
|
||||
float top = (float)(m_ypos - m_height/2.0);
|
||||
float bottom = (float)(m_ypos + m_height/2.0);
|
||||
|
||||
// Zero is top, n+1 is bottom.
|
||||
if (attachment == 0)
|
||||
{
|
||||
*y = top;
|
||||
if (m_spaceAttachments)
|
||||
{
|
||||
if (line && (line->GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE))
|
||||
{
|
||||
// Align line according to the next handle along
|
||||
wxRealPoint *point = line->GetNextControlPoint(this);
|
||||
if (point->x < left)
|
||||
*x = left;
|
||||
else if (point->x > right)
|
||||
*x = right;
|
||||
else
|
||||
*x = point->x;
|
||||
}
|
||||
else
|
||||
*x = left + (nth + 1)*m_width/(no_arcs + 1);
|
||||
}
|
||||
else
|
||||
*x = m_xpos;
|
||||
}
|
||||
else if (attachment == (n+1))
|
||||
{
|
||||
*y = bottom;
|
||||
if (m_spaceAttachments)
|
||||
{
|
||||
if (line && (line->GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE))
|
||||
{
|
||||
// Align line according to the next handle along
|
||||
wxRealPoint *point = line->GetNextControlPoint(this);
|
||||
if (point->x < left)
|
||||
*x = left;
|
||||
else if (point->x > right)
|
||||
*x = right;
|
||||
else
|
||||
*x = point->x;
|
||||
}
|
||||
else
|
||||
*x = left + (nth + 1)*m_width/(no_arcs + 1);
|
||||
}
|
||||
else
|
||||
*x = m_xpos;
|
||||
}
|
||||
// Left or right.
|
||||
else
|
||||
{
|
||||
int i = 0;
|
||||
bool isLeft = FALSE;
|
||||
if (attachment < (n+1))
|
||||
{
|
||||
i = attachment-1;
|
||||
isLeft = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = (totalNumberAttachments - attachment - 1);
|
||||
isLeft = TRUE;
|
||||
}
|
||||
wxNode *node = GetRegions().Nth(i);
|
||||
if (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
|
||||
if (isLeft)
|
||||
*x = left;
|
||||
else
|
||||
*x = right;
|
||||
|
||||
// Calculate top and bottom of region
|
||||
top = (float)((m_ypos + region->m_y) - (region->m_height/2.0));
|
||||
bottom = (float)((m_ypos + region->m_y) + (region->m_height/2.0));
|
||||
|
||||
// Assuming we can trust the absolute size and
|
||||
// position of these regions...
|
||||
if (m_spaceAttachments)
|
||||
{
|
||||
if (line && (line->GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE))
|
||||
{
|
||||
// Align line according to the next handle along
|
||||
wxRealPoint *point = line->GetNextControlPoint(this);
|
||||
if (point->y < bottom)
|
||||
*y = bottom;
|
||||
else if (point->y > top)
|
||||
*y = top;
|
||||
else
|
||||
*y = point->y;
|
||||
}
|
||||
else
|
||||
// *y = (float)(((m_ypos + region->m_y) - (region->m_height/2.0)) + (nth + 1)*region->m_height/(no_arcs+1));
|
||||
*y = (float)(top + (nth + 1)*region->m_height/(no_arcs+1));
|
||||
}
|
||||
else
|
||||
*y = (float)(m_ypos + region->m_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
*x = m_xpos;
|
||||
*y = m_ypos;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wxDividedShape::GetNumberOfAttachments()
|
||||
{
|
||||
// There are two attachments for each region (left and right),
|
||||
// plus one on the top and one on the bottom.
|
||||
int n = (GetRegions().Number() * 2) + 2;
|
||||
|
||||
int maxN = n - 1;
|
||||
wxNode *node = m_attachmentPoints.First();
|
||||
while (node)
|
||||
{
|
||||
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
|
||||
if (point->m_id > maxN)
|
||||
maxN = point->m_id;
|
||||
node = node->Next();
|
||||
}
|
||||
return maxN + 1;
|
||||
}
|
||||
|
||||
bool wxDividedShape::AttachmentIsValid(int attachment)
|
||||
{
|
||||
int totalNumberAttachments = (GetRegions().Number() * 2) + 2;
|
||||
if (attachment >= totalNumberAttachments)
|
||||
{
|
||||
return wxShape::AttachmentIsValid(attachment);
|
||||
}
|
||||
else if (attachment >= 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxDividedShape::Copy(wxDividedShape& copy)
|
||||
{
|
||||
wxRectangleShape::Copy(copy);
|
||||
}
|
||||
|
||||
wxShape *wxDividedShape::PrivateCopy()
|
||||
{
|
||||
wxDividedShape *obj = new wxDividedShape(m_width, m_height);
|
||||
Copy(*obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Region operations
|
||||
|
||||
void wxDividedShape::MakeControlPoints()
|
||||
{
|
||||
wxRectangleShape::MakeControlPoints();
|
||||
|
||||
MakeMandatoryControlPoints();
|
||||
}
|
||||
|
||||
void wxDividedShape::MakeMandatoryControlPoints()
|
||||
{
|
||||
float currentY = (float)(GetY() - (m_height / 2.0));
|
||||
float maxY = (float)(GetY() + (m_height / 2.0));
|
||||
|
||||
wxNode *node = GetRegions().First();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
|
||||
float proportion = region->m_regionProportionY;
|
||||
|
||||
float y = currentY + m_height*proportion;
|
||||
float actualY = (float)(maxY < y ? maxY : y);
|
||||
|
||||
if (node->Next())
|
||||
{
|
||||
wxDividedShapeControlPoint *controlPoint =
|
||||
new wxDividedShapeControlPoint(m_canvas, this, i, CONTROL_POINT_SIZE, 0.0, (float)(actualY - GetY()), 0);
|
||||
m_canvas->AddShape(controlPoint);
|
||||
m_controlPoints.Append(controlPoint);
|
||||
}
|
||||
currentY = actualY;
|
||||
i ++;
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
void wxDividedShape::ResetControlPoints()
|
||||
{
|
||||
// May only have the region handles, (n - 1) of them.
|
||||
if (m_controlPoints.Number() > (GetRegions().Number() - 1))
|
||||
wxRectangleShape::ResetControlPoints();
|
||||
|
||||
ResetMandatoryControlPoints();
|
||||
}
|
||||
|
||||
void wxDividedShape::ResetMandatoryControlPoints()
|
||||
{
|
||||
float currentY = (float)(GetY() - (m_height / 2.0));
|
||||
float maxY = (float)(GetY() + (m_height / 2.0));
|
||||
|
||||
wxNode *node = m_controlPoints.First();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
wxControlPoint *controlPoint = (wxControlPoint *)node->Data();
|
||||
if (controlPoint->IsKindOf(CLASSINFO(wxDividedShapeControlPoint)))
|
||||
{
|
||||
wxNode *node1 = GetRegions().Nth(i);
|
||||
wxShapeRegion *region = (wxShapeRegion *)node1->Data();
|
||||
|
||||
float proportion = region->m_regionProportionY;
|
||||
|
||||
float y = currentY + m_height*proportion;
|
||||
float actualY = (float)(maxY < y ? maxY : y);
|
||||
|
||||
controlPoint->m_xoffset = 0.0;
|
||||
controlPoint->m_yoffset = (float)(actualY - GetY());
|
||||
currentY = actualY;
|
||||
i ++;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxDividedShape::WritePrologAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
}
|
||||
|
||||
void wxDividedShape::ReadPrologAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Edit the division colour/style
|
||||
*
|
||||
*/
|
||||
|
||||
void wxDividedShape::EditRegions()
|
||||
{
|
||||
wxMessageBox("EditRegions() is unimplemented.", "OGL", wxOK);
|
||||
|
||||
// TODO
|
||||
#if 0
|
||||
if (GetRegions().Number() < 2)
|
||||
return;
|
||||
|
||||
wxBeginBusyCursor();
|
||||
|
||||
GraphicsForm *form = new GraphicsForm("Divided nodes");
|
||||
// Need an array to store all the style strings,
|
||||
// since they need to be converted to integers
|
||||
char **styleStrings = new char *[GetRegions().Number()];
|
||||
for (int j = 0; j < GetRegions().Number(); j++)
|
||||
styleStrings[j] = NULL;
|
||||
|
||||
int i = 0;
|
||||
wxNode *node = GetRegions().First();
|
||||
while (node && node->Next())
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
char buf[50];
|
||||
sprintf(buf, "Region %d", (i+1));
|
||||
form->Add(wxMakeFormMessage(buf));
|
||||
form->Add(wxMakeFormNewLine());
|
||||
|
||||
form->Add(wxMakeFormString("Colour", ®ion->penColour, wxFORM_CHOICE,
|
||||
new wxList(wxMakeConstraintStrings(
|
||||
"Invisible" ,
|
||||
"BLACK" ,
|
||||
"BLUE" ,
|
||||
"BROWN" ,
|
||||
"CORAL" ,
|
||||
"CYAN" ,
|
||||
"DARK GREY" ,
|
||||
"DARK GREEN" ,
|
||||
"DIM GREY" ,
|
||||
"GREY" ,
|
||||
"GREEN" ,
|
||||
"LIGHT BLUE" ,
|
||||
"LIGHT GREY" ,
|
||||
"MAGENTA" ,
|
||||
"MAROON" ,
|
||||
"NAVY" ,
|
||||
"ORANGE" ,
|
||||
"PURPLE" ,
|
||||
"RED" ,
|
||||
"TURQUOISE" ,
|
||||
"VIOLET" ,
|
||||
"WHITE" ,
|
||||
"YELLOW" ,
|
||||
NULL),
|
||||
NULL), NULL, wxVERTICAL, 150));
|
||||
|
||||
char *styleString = NULL;
|
||||
switch (region->penStyle)
|
||||
{
|
||||
case wxSHORT_DASH:
|
||||
styleString = "Short Dash";
|
||||
break;
|
||||
case wxLONG_DASH:
|
||||
styleString = "Long Dash";
|
||||
break;
|
||||
case wxDOT:
|
||||
styleString = "Dot";
|
||||
break;
|
||||
case wxDOT_DASH:
|
||||
styleString = "Dot Dash";
|
||||
break;
|
||||
case wxSOLID:
|
||||
default:
|
||||
styleString = "Solid";
|
||||
break;
|
||||
}
|
||||
styleStrings[i] = copystring(styleString);
|
||||
form->Add(wxMakeFormString("Style", &(styleStrings[i]), wxFORM_CHOICE,
|
||||
new wxList(wxMakeConstraintStrings(
|
||||
"Solid" ,
|
||||
"Short Dash" ,
|
||||
"Long Dash" ,
|
||||
"Dot" ,
|
||||
"Dot Dash" ,
|
||||
NULL),
|
||||
NULL), NULL, wxVERTICAL, 100));
|
||||
node = node->Next();
|
||||
i ++;
|
||||
if (node && node->Next())
|
||||
form->Add(wxMakeFormNewLine());
|
||||
}
|
||||
wxDialogBox *dialog = new wxDialogBox(m_canvas->GetParent(), "Divided object properties", 10, 10, 500, 500);
|
||||
if (GraphicsLabelFont)
|
||||
dialog->SetLabelFont(GraphicsLabelFont);
|
||||
if (GraphicsButtonFont)
|
||||
dialog->SetButtonFont(GraphicsButtonFont);
|
||||
form->AssociatePanel(dialog);
|
||||
form->dialog = dialog;
|
||||
|
||||
dialog->Fit();
|
||||
dialog->Centre(wxBOTH);
|
||||
|
||||
wxEndBusyCursor();
|
||||
|
||||
dialog->Show(TRUE);
|
||||
|
||||
node = GetRegions().First();
|
||||
i = 0;
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
|
||||
if (styleStrings[i])
|
||||
{
|
||||
if (strcmp(styleStrings[i], "Solid") == 0)
|
||||
region->penStyle = wxSOLID;
|
||||
else if (strcmp(styleStrings[i], "Dot") == 0)
|
||||
region->penStyle = wxDOT;
|
||||
else if (strcmp(styleStrings[i], "Short Dash") == 0)
|
||||
region->penStyle = wxSHORT_DASH;
|
||||
else if (strcmp(styleStrings[i], "Long Dash") == 0)
|
||||
region->penStyle = wxLONG_DASH;
|
||||
else if (strcmp(styleStrings[i], "Dot Dash") == 0)
|
||||
region->penStyle = wxDOT_DASH;
|
||||
delete[] styleStrings[i];
|
||||
}
|
||||
region->m_actualPenObject = NULL;
|
||||
node = node->Next();
|
||||
i ++;
|
||||
}
|
||||
delete[] styleStrings;
|
||||
Draw(dc);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxDividedShape::OnRightClick(float x, float y, int keys, int attachment)
|
||||
{
|
||||
if (keys & KEY_CTRL)
|
||||
{
|
||||
EditRegions();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxRectangleShape::OnRightClick(x, y, keys, attachment);
|
||||
}
|
||||
}
|
||||
|
||||
wxDividedShapeControlPoint::wxDividedShapeControlPoint(wxShapeCanvas *the_canvas, wxShape *object,
|
||||
int region, float size, float the_m_xoffset, float the_m_yoffset, int the_type):
|
||||
wxControlPoint(the_canvas, object, size, the_m_xoffset, the_m_yoffset, the_type)
|
||||
{
|
||||
regionId = region;
|
||||
}
|
||||
|
||||
wxDividedShapeControlPoint::~wxDividedShapeControlPoint()
|
||||
{
|
||||
}
|
||||
|
||||
// Implement resizing of divided object division
|
||||
void wxDividedShapeControlPoint::OnDragLeft(bool draw, float x, float y, int keys, int attachment)
|
||||
{
|
||||
wxClientDC dc(GetCanvas());
|
||||
GetCanvas()->PrepareDC(dc);
|
||||
|
||||
dc.SetLogicalFunction(wxXOR);
|
||||
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
|
||||
dc.SetPen(dottedPen);
|
||||
dc.SetBrush((* wxTRANSPARENT_BRUSH));
|
||||
|
||||
wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
|
||||
float x1 = (float)(dividedObject->GetX() - (dividedObject->GetWidth()/2.0));
|
||||
float y1 = y;
|
||||
float x2 = (float)(dividedObject->GetX() + (dividedObject->GetWidth()/2.0));
|
||||
float y2 = y;
|
||||
dc.DrawLine(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
void wxDividedShapeControlPoint::OnBeginDragLeft(float x, float y, int keys, int attachment)
|
||||
{
|
||||
wxClientDC dc(GetCanvas());
|
||||
GetCanvas()->PrepareDC(dc);
|
||||
|
||||
wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
|
||||
dc.SetLogicalFunction(wxXOR);
|
||||
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
|
||||
dc.SetPen(dottedPen);
|
||||
dc.SetBrush((* wxTRANSPARENT_BRUSH));
|
||||
|
||||
float x1 = (float)(dividedObject->GetX() - (dividedObject->GetWidth()/2.0));
|
||||
float y1 = y;
|
||||
float x2 = (float)(dividedObject->GetX() + (dividedObject->GetWidth()/2.0));
|
||||
float y2 = y;
|
||||
dc.DrawLine(x1, y1, x2, y2);
|
||||
m_canvas->CaptureMouse();
|
||||
}
|
||||
|
||||
void wxDividedShapeControlPoint::OnEndDragLeft(float x, float y, int keys, int attachment)
|
||||
{
|
||||
wxClientDC dc(GetCanvas());
|
||||
GetCanvas()->PrepareDC(dc);
|
||||
|
||||
wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
|
||||
wxNode *node = dividedObject->GetRegions().Nth(regionId);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data();
|
||||
wxShapeRegion *nextRegion = NULL; // Region below this one
|
||||
|
||||
dc.SetLogicalFunction(wxCOPY);
|
||||
|
||||
m_canvas->ReleaseMouse();
|
||||
|
||||
// Find the old top and bottom of this region,
|
||||
// and calculate the new proportion for this region
|
||||
// if legal.
|
||||
|
||||
float currentY = (float)(dividedObject->GetY() - (dividedObject->GetHeight() / 2.0));
|
||||
float maxY = (float)(dividedObject->GetY() + (dividedObject->GetHeight() / 2.0));
|
||||
|
||||
// Save values
|
||||
float thisRegionTop = 0.0;
|
||||
float thisRegionBottom = 0.0;
|
||||
float nextRegionBottom = 0.0;
|
||||
|
||||
node = dividedObject->GetRegions().First();
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
|
||||
float proportion = region->m_regionProportionY;
|
||||
float yy = currentY + (dividedObject->GetHeight()*proportion);
|
||||
float actualY = (float)(maxY < yy ? maxY : yy);
|
||||
|
||||
if (region == thisRegion)
|
||||
{
|
||||
thisRegionTop = currentY;
|
||||
thisRegionBottom = actualY;
|
||||
if (node->Next())
|
||||
nextRegion = (wxShapeRegion *)node->Next()->Data();
|
||||
}
|
||||
if (region == nextRegion)
|
||||
{
|
||||
nextRegionBottom = actualY;
|
||||
}
|
||||
|
||||
currentY = actualY;
|
||||
node = node->Next();
|
||||
}
|
||||
if (!nextRegion)
|
||||
return;
|
||||
|
||||
// Check that we haven't gone above this region or below
|
||||
// next region.
|
||||
if ((y <= thisRegionTop) || (y >= nextRegionBottom))
|
||||
return;
|
||||
|
||||
dividedObject->EraseLinks(dc);
|
||||
|
||||
// Now calculate the new proportions of this region and the next region.
|
||||
float thisProportion = (float)((y - thisRegionTop)/dividedObject->GetHeight());
|
||||
float nextProportion = (float)((nextRegionBottom - y)/dividedObject->GetHeight());
|
||||
thisRegion->SetProportions(0.0, thisProportion);
|
||||
nextRegion->SetProportions(0.0, nextProportion);
|
||||
m_yoffset = (float)(y - dividedObject->GetY());
|
||||
|
||||
// Now reformat text
|
||||
int i = 0;
|
||||
node = dividedObject->GetRegions().First();
|
||||
while (node)
|
||||
{
|
||||
wxShapeRegion *region = (wxShapeRegion *)node->Data();
|
||||
if (region->GetText())
|
||||
{
|
||||
char *s = copystring(region->GetText());
|
||||
dividedObject->FormatText(dc, s, i);
|
||||
delete[] s;
|
||||
}
|
||||
node = node->Next();
|
||||
i++;
|
||||
}
|
||||
dividedObject->SetRegionSizes();
|
||||
dividedObject->Draw(dc);
|
||||
dividedObject->GetEventHandler()->OnMoveLinks(dc);
|
||||
}
|
||||
|
@@ -1,77 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: divided.h
|
||||
// Purpose: wxDividedShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_DIVIDED_H_
|
||||
#define _OGL_DIVIDED_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "basic.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definition of a region
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Box divided into horizontal regions
|
||||
*
|
||||
*/
|
||||
|
||||
extern wxFont *g_oglNormalFont;
|
||||
class wxDividedShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDividedShape)
|
||||
|
||||
public:
|
||||
wxDividedShape(float w = 0.0, float h = 0.0);
|
||||
~wxDividedShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
|
||||
void SetSize(float w, float h, bool recursive = TRUE);
|
||||
|
||||
void MakeControlPoints();
|
||||
void ResetControlPoints();
|
||||
|
||||
void MakeMandatoryControlPoints();
|
||||
void ResetMandatoryControlPoints();
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
void Copy(wxDividedShape ©);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
// Set all region sizes according to proportions and
|
||||
// this object total size
|
||||
void SetRegionSizes();
|
||||
|
||||
// Edit region colours/styles
|
||||
void EditRegions();
|
||||
|
||||
// Attachment points correspond to regions in the divided box
|
||||
bool GetAttachmentPosition(int attachment, float *x, float *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
bool AttachmentIsValid(int attachment);
|
||||
int GetNumberOfAttachments();
|
||||
|
||||
// Invoke editor on CTRL-right click
|
||||
void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_DIVIDED_H_
|
||||
|
@@ -1,119 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: drawn.h
|
||||
// Purpose: wxDrawnShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_DRAWN_H_
|
||||
#define _OGL_DRAWN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "drawn.h"
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
|
||||
class wxPseudoMetaFile: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPseudoMetaFile)
|
||||
public:
|
||||
wxPseudoMetaFile();
|
||||
wxPseudoMetaFile(wxPseudoMetaFile& mf);
|
||||
~wxPseudoMetaFile();
|
||||
|
||||
void Draw(wxDC& dc, float xoffset, float yoffset);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
void Clear();
|
||||
|
||||
void Copy(wxPseudoMetaFile& copy);
|
||||
|
||||
void Scale(float sx, float sy);
|
||||
void ScaleTo(float w, float h); // Scale to fit size
|
||||
void Translate(float x, float y);
|
||||
|
||||
// Rotate about the given axis by theta radians from the x axis.
|
||||
void Rotate(float x, float y, float theta);
|
||||
|
||||
bool LoadFromMetaFile(char *filename, float *width, float *height);
|
||||
|
||||
void GetBounds(float *minX, float *minY, float *maxX, float *maxY);
|
||||
|
||||
inline wxList& GetOutlineColours() const { return (wxList&) m_outlineColours; }
|
||||
inline wxList& GetFillColours() const { return (wxList&) m_fillColours; }
|
||||
inline void SetRotateable(bool rot) { m_rotateable = rot; }
|
||||
inline bool GetRotateable() const { return m_rotateable; }
|
||||
|
||||
public:
|
||||
bool m_rotateable;
|
||||
float m_width;
|
||||
float m_height;
|
||||
wxList m_ops; // List of drawing operations (see drawnp.h)
|
||||
wxList m_gdiObjects; // List of pens, brushes and fonts for this object.
|
||||
|
||||
// Pen/brush specifying outline/fill colours
|
||||
// to override operations.
|
||||
wxPen* m_outlinePen;
|
||||
wxBrush* m_fillBrush;
|
||||
wxList m_outlineColours; // List of the GDI operations that comprise the outline
|
||||
wxList m_fillColours; // List of the GDI operations that fill the shape
|
||||
float m_currentRotation;
|
||||
};
|
||||
|
||||
class wxDrawnShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDrawnShape)
|
||||
public:
|
||||
wxDrawnShape();
|
||||
~wxDrawnShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *GetFunctor();
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxDrawnShape& copy);
|
||||
|
||||
// Returns a new instance, and does the copy for this class. Define for each class.
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
void Scale(float sx, float sy);
|
||||
void Translate(float x, float y);
|
||||
// Rotate about the given axis by theta radians from the x axis.
|
||||
void Rotate(float x, float y, float theta);
|
||||
|
||||
// Get current rotation
|
||||
inline float GetRotation() const { return m_rotation; }
|
||||
|
||||
void SetSize(float w, float h, bool recursive = TRUE);
|
||||
bool LoadFromMetaFile(char *filename);
|
||||
|
||||
inline void SetSaveToFile(bool save) { m_saveToFile = save; }
|
||||
inline wxPseudoMetaFile& GetMetaFile() const { return (wxPseudoMetaFile&) m_metafile; }
|
||||
|
||||
private:
|
||||
wxPseudoMetaFile m_metafile;
|
||||
|
||||
// Don't save all wxDrawnShape metafiles to file: sometimes
|
||||
// we take the metafile data from a symbol library.
|
||||
bool m_saveToFile;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// _DRAWN_H_
|
||||
|
@@ -1,168 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: drawnp.h
|
||||
// Purpose: Private header for wxDrawnShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_DRAWNP_H_
|
||||
#define _OGL_DRAWNP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "drawnp.h"
|
||||
#endif
|
||||
|
||||
#include "drawn.h"
|
||||
|
||||
/*
|
||||
* Drawing operations
|
||||
*
|
||||
*/
|
||||
|
||||
#define DRAWOP_SET_PEN 1
|
||||
#define DRAWOP_SET_BRUSH 2
|
||||
#define DRAWOP_SET_FONT 3
|
||||
#define DRAWOP_SET_TEXT_COLOUR 4
|
||||
#define DRAWOP_SET_BK_COLOUR 5
|
||||
#define DRAWOP_SET_BK_MODE 6
|
||||
#define DRAWOP_SET_CLIPPING_RECT 7
|
||||
#define DRAWOP_DESTROY_CLIPPING_RECT 8
|
||||
|
||||
/*
|
||||
#define DRAWOP_CREATE_PEN 10
|
||||
#define DRAWOP_CREATE_BRUSH 11
|
||||
#define DRAWOP_CREATE_FONT 12
|
||||
*/
|
||||
|
||||
#define DRAWOP_DRAW_LINE 20
|
||||
#define DRAWOP_DRAW_POLYLINE 21
|
||||
#define DRAWOP_DRAW_POLYGON 22
|
||||
#define DRAWOP_DRAW_RECT 23
|
||||
#define DRAWOP_DRAW_ROUNDED_RECT 24
|
||||
#define DRAWOP_DRAW_ELLIPSE 25
|
||||
#define DRAWOP_DRAW_POINT 26
|
||||
#define DRAWOP_DRAW_ARC 27
|
||||
#define DRAWOP_DRAW_TEXT 28
|
||||
#define DRAWOP_DRAW_SPLINE 29
|
||||
|
||||
/*
|
||||
* Base, virtual class
|
||||
*
|
||||
*/
|
||||
|
||||
class wxDrawOp: public wxObject
|
||||
{
|
||||
public:
|
||||
int op;
|
||||
|
||||
inline wxDrawOp(int theOp) { op = theOp; }
|
||||
inline ~wxDrawOp() {}
|
||||
inline virtual void Scale(float xScale, float yScale) {};
|
||||
inline virtual void Translate(float x, float y) {};
|
||||
inline virtual void Rotate(float x, float y, float sinTheta, float cosTheta) {};
|
||||
virtual void Do(wxDC& dc, float xoffset, float yoffset) = 0;
|
||||
virtual wxDrawOp *Copy(wxPseudoMetaFile *newImage) = 0;
|
||||
virtual wxExpr *WritewxExpr(wxPseudoMetaFile *image) = 0;
|
||||
virtual void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
* Set font, brush, text colour
|
||||
*
|
||||
*/
|
||||
|
||||
class wxOpSetGDI: public wxDrawOp
|
||||
{
|
||||
public:
|
||||
int mode;
|
||||
int gdiIndex;
|
||||
wxPseudoMetaFile *image;
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0);
|
||||
void Do(wxDC& dc, float xoffset, float yoffset);
|
||||
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
|
||||
wxExpr *WritewxExpr(wxPseudoMetaFile *image);
|
||||
void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
|
||||
};
|
||||
|
||||
/*
|
||||
* Set/destroy clipping
|
||||
*
|
||||
*/
|
||||
|
||||
class wxOpSetClipping: public wxDrawOp
|
||||
{
|
||||
public:
|
||||
float x1;
|
||||
float y1;
|
||||
float x2;
|
||||
float y2;
|
||||
wxOpSetClipping(int theOp, float theX1, float theY1, float theX2, float theY2);
|
||||
void Do(wxDC& dc, float xoffset, float yoffset);
|
||||
void Scale(float xScale, float yScale);
|
||||
void Translate(float x, float y);
|
||||
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
|
||||
wxExpr *WritewxExpr(wxPseudoMetaFile *image);
|
||||
void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
|
||||
};
|
||||
|
||||
/*
|
||||
* Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
|
||||
*
|
||||
*/
|
||||
|
||||
class wxOpDraw: public wxDrawOp
|
||||
{
|
||||
public:
|
||||
float x1;
|
||||
float y1;
|
||||
float x2;
|
||||
float y2;
|
||||
float x3;
|
||||
float radius;
|
||||
char *textString;
|
||||
|
||||
wxOpDraw(int theOp, float theX1, float theY1, float theX2, float theY2,
|
||||
float radius = 0.0, char *s = NULL);
|
||||
~wxOpDraw();
|
||||
void Do(wxDC& dc, float xoffset, float yoffset);
|
||||
void Scale(float scaleX, float scaleY);
|
||||
void Translate(float x, float y);
|
||||
void Rotate(float x, float y, float sinTheta, float cosTheta);
|
||||
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
|
||||
wxExpr *WritewxExpr(wxPseudoMetaFile *image);
|
||||
void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
|
||||
};
|
||||
|
||||
/*
|
||||
* Draw polyline, spline, polygon
|
||||
*
|
||||
*/
|
||||
|
||||
class wxOpPolyDraw: public wxDrawOp
|
||||
{
|
||||
public:
|
||||
wxRealPoint *points;
|
||||
int noPoints;
|
||||
|
||||
wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints);
|
||||
~wxOpPolyDraw();
|
||||
void Do(wxDC& dc, float xoffset, float yoffset);
|
||||
void Scale(float scaleX, float scaleY);
|
||||
void Translate(float x, float y);
|
||||
void Rotate(float x, float y, float sinTheta, float cosTheta);
|
||||
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
|
||||
wxExpr *WritewxExpr(wxPseudoMetaFile *image);
|
||||
void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_DRAWNP_H_
|
||||
|
||||
|
@@ -1,286 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: lines.h
|
||||
// Purpose: wxLineShape
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_LINES_H_
|
||||
#define _OGL_LINES_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "lines.h"
|
||||
#endif
|
||||
|
||||
class wxLabelShape;
|
||||
class wxPseudoMetaFile;
|
||||
class wxLineControlPoint;
|
||||
/*
|
||||
* Arcs with multiple arrowheads
|
||||
*
|
||||
*/
|
||||
|
||||
// Types of arrowhead
|
||||
// (i) Built-in
|
||||
#define ARROW_HOLLOW_CIRCLE 1
|
||||
#define ARROW_FILLED_CIRCLE 2
|
||||
#define ARROW_ARROW 3
|
||||
#define ARROW_SINGLE_OBLIQUE 4
|
||||
#define ARROW_DOUBLE_OBLIQUE 5
|
||||
// (ii) Custom
|
||||
#define ARROW_METAFILE 20
|
||||
|
||||
// Position of arrow on line
|
||||
#define ARROW_POSITION_START 0
|
||||
#define ARROW_POSITION_END 1
|
||||
#define ARROW_POSITION_MIDDLE 2
|
||||
|
||||
// Line alignment flags
|
||||
// Vertical by default
|
||||
#define LINE_ALIGNMENT_HORIZ 1
|
||||
#define LINE_ALIGNMENT_VERT 0
|
||||
#define LINE_ALIGNMENT_TO_NEXT_HANDLE 2
|
||||
#define LINE_ALIGNMENT_NONE 0
|
||||
|
||||
class wxArrowHead: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxArrowHead)
|
||||
|
||||
public:
|
||||
wxArrowHead(WXTYPE type = 0, int end = 0, float size = 0.0, float dist = 0.0, const wxString& name = "", wxPseudoMetaFile *mf = NULL,
|
||||
long arrowId = -1);
|
||||
~wxArrowHead();
|
||||
wxArrowHead(wxArrowHead& toCopy);
|
||||
|
||||
inline WXTYPE _GetType() const { return m_arrowType; }
|
||||
inline int GetPosition() const { return m_arrowEnd; }
|
||||
inline float GetXOffset() const { return m_xOffset; }
|
||||
inline float GetYOffset() const { return m_yOffset; }
|
||||
inline float GetSpacing() const { return m_spacing; }
|
||||
inline float GetSize() const { return m_arrowSize; }
|
||||
inline wxString GetName() const { return m_arrowName; }
|
||||
inline void SetXOffset(float x) { m_xOffset = x; }
|
||||
inline void SetYOffset(float y) { m_yOffset = y; }
|
||||
inline wxPseudoMetaFile *GetMetaFile() const { return m_metaFile; }
|
||||
inline long GetId() const { return m_id; }
|
||||
inline int GetArrowEnd() const { return m_arrowEnd; }
|
||||
inline float GetArrowSize() const { return m_arrowSize; }
|
||||
void SetSize(float size);
|
||||
inline void SetSpacing(float sp) { m_spacing = sp; }
|
||||
|
||||
protected:
|
||||
WXTYPE m_arrowType;
|
||||
int m_arrowEnd; // Position on line
|
||||
float m_xOffset; // Distance from arc start or end, w.r.t. point on arrowhead
|
||||
// nearest start or end. If zero, use default spacing.
|
||||
float m_yOffset; // vertical offset (w.r.t. a horizontal line). Normally zero.
|
||||
float m_spacing; // Spacing from the last arrowhead
|
||||
float m_arrowSize; // Length of arrowhead
|
||||
wxString m_arrowName; // Name of arrow
|
||||
bool m_saveToFile; // TRUE if we want to save custom arrowheads to file.
|
||||
wxPseudoMetaFile* m_metaFile; // Pseudo metafile if this is a custom arrowhead
|
||||
long m_id; // identifier
|
||||
};
|
||||
|
||||
// Line object
|
||||
class wxLineShape: public wxShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxLineShape)
|
||||
|
||||
public:
|
||||
wxLineShape();
|
||||
~wxLineShape();
|
||||
|
||||
// Called when a connected object has moved, to move the link to
|
||||
// correct position
|
||||
// moveControlPoints must be disabled when a control point is being
|
||||
// dragged.
|
||||
void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||
bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
void OnDrawControlPoints(wxDC& dc);
|
||||
void OnEraseControlPoints(wxDC& dc);
|
||||
void OnErase(wxDC& dc);
|
||||
virtual inline void OnMoveControlPoint(int WXUNUSED(which), float WXUNUSED(x), float WXUNUSED(y)) {}
|
||||
void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
|
||||
void GetBoundingBoxMin(float *w, float *h);
|
||||
void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
|
||||
virtual void SetEnds(float x1, float y1, float x2, float y2);
|
||||
virtual void GetEnds(float *x1, float *y1, float *x2, float *y2);
|
||||
inline virtual wxShape *GetFrom() { return m_from; }
|
||||
inline virtual wxShape *GetTo() { return m_to; }
|
||||
inline virtual int GetAttachmentFrom() { return m_attachmentFrom; }
|
||||
inline virtual int GetAttachmentTo() { return m_attachmentTo; }
|
||||
|
||||
virtual void SetFrom(wxShape *object);
|
||||
virtual void SetTo(wxShape *object);
|
||||
virtual void DrawArrows(wxDC& dc);
|
||||
|
||||
// Finds the x, y points at the two ends of the line.
|
||||
// This function can be used by e.g. line-routing routines to
|
||||
// get the actual points on the two node images where the lines will be drawn
|
||||
// to/from.
|
||||
void FindLineEndPoints(float *fromX, float *fromY, float *toX, float *toY);
|
||||
|
||||
// Format one region at this position
|
||||
void DrawRegion(wxDC& dc, wxShapeRegion *region, float x, float y);
|
||||
|
||||
// Erase one region at this position
|
||||
void EraseRegion(wxDC& dc, wxShapeRegion *region, float x, float y);
|
||||
|
||||
// Get the reference point for a label. Region x and y
|
||||
// are offsets from this.
|
||||
// position is 0 (middle), 1 (start), 2 (end)
|
||||
void GetLabelPosition(int position, float *x, float *y);
|
||||
|
||||
// Straighten verticals and horizontals
|
||||
virtual void Straighten(wxDC& dc);
|
||||
|
||||
// Not implemented
|
||||
inline void SetMaintainStraightLines(bool flag) { m_maintainStraightLines = flag; }
|
||||
inline bool GetMaintainStraightLines() const { return m_maintainStraightLines; }
|
||||
|
||||
// Make handle control points
|
||||
void MakeControlPoints();
|
||||
void ResetControlPoints();
|
||||
|
||||
// Make a given number of control points
|
||||
virtual void MakeLineControlPoints(int n);
|
||||
virtual wxNode *InsertLineControlPoint(wxDC* dc);
|
||||
virtual bool DeleteLineControlPoint();
|
||||
virtual void Initialise();
|
||||
inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
|
||||
|
||||
// Override dragging behaviour - don't want to be able to drag lines!
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
|
||||
// Override select, to create/delete temporary label-moving objects
|
||||
void Select(bool select = TRUE, wxDC* dc = NULL);
|
||||
|
||||
// Set to spline (TRUE) or line (FALSE)
|
||||
inline void SetSpline(bool spl) { m_isSpline = spl; }
|
||||
inline bool IsSpline() const { return m_isSpline; }
|
||||
|
||||
void Unlink();
|
||||
void SetAttachments(int from_attach, int to_attach);
|
||||
|
||||
bool HitTest(float x, float y, int *attachment, float *distance);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
virtual char *GetFunctor();
|
||||
virtual void WritePrologAttributes(wxExpr *clause);
|
||||
virtual void ReadPrologAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
virtual void FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming);
|
||||
|
||||
// Find which position we're talking about at this (x, y).
|
||||
// Returns ARROW_POSITION_START, ARROW_POSITION_MIDDLE, ARROW_POSITION_END
|
||||
int FindLinePosition(float x, float y);
|
||||
|
||||
// This is really to distinguish between lines and other images.
|
||||
// For lines, want to pass drag to canvas, since lines tend to prevent
|
||||
// dragging on a canvas (they get in the way.)
|
||||
virtual bool Draggable() const { return FALSE; }
|
||||
|
||||
// Does the copying for this object
|
||||
void Copy(wxLineShape& copy);
|
||||
wxShape *PrivateCopy();
|
||||
|
||||
// New OGL stuff
|
||||
wxArrowHead *AddArrow(WXTYPE type, int end = ARROW_POSITION_END,
|
||||
float arrowSize = 10.0, float xOffset = 0.0, const wxString& name = "",
|
||||
wxPseudoMetaFile *mf = NULL, long arrowId = -1);
|
||||
|
||||
// Add an arrowhead in the position indicated by the reference
|
||||
// list of arrowheads, which contains all legal arrowheads for this
|
||||
// line, in the correct order.
|
||||
// E.g. reference list: a b c d e
|
||||
// Current line list: a d
|
||||
// Add c, then line list is: a c d
|
||||
// If no legal arrowhead position, return FALSE.
|
||||
// Assume reference list is for one end only, since it potentially defines
|
||||
// the ordering for any one of the 3 positions. So we don't check
|
||||
// the reference list for arrowhead position.
|
||||
bool AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
|
||||
|
||||
// Delete arrowhead(s)
|
||||
void ClearArrowsAtPosition(int end = -1);
|
||||
bool ClearArrow(const wxString& name);
|
||||
wxArrowHead *FindArrowHead(int position, const wxString& name);
|
||||
wxArrowHead *FindArrowHead(long arrowId);
|
||||
bool DeleteArrowHead(int position, const wxString& name);
|
||||
bool DeleteArrowHead(long arrowId);
|
||||
void DrawArrow(wxDC& dc, wxArrowHead *arrow, float xOffset, bool proportionalOffset);
|
||||
inline void SetIgnoreOffsets(bool ignore) { m_ignoreArrowOffsets = ignore; }
|
||||
|
||||
// Find horizontal width for drawing a line with
|
||||
// arrows in minimum space. Assume arrows at
|
||||
// END only
|
||||
float FindMinimumWidth();
|
||||
|
||||
// Set alignment flags. ALIGNMENT NOT IMPLEMENTED.
|
||||
void SetAlignmentOrientation(bool isEnd, bool isHoriz);
|
||||
void SetAlignmentType(bool isEnd, int alignType);
|
||||
bool GetAlignmentOrientation(bool isEnd);
|
||||
int GetAlignmentType(bool isEnd);
|
||||
|
||||
// Find next control point in line after the start/end point
|
||||
// (depending on whether the node object is at start or end)
|
||||
wxRealPoint *GetNextControlPoint(wxShape *nodeObject);
|
||||
inline bool IsEnd(wxShape *nodeObject) const { return (m_to == nodeObject); }
|
||||
|
||||
private:
|
||||
bool m_erasing; // flag to say whether we're erasing or drawing
|
||||
// this line (really so metafiles can draw a
|
||||
// blank rectangle)
|
||||
bool m_ignoreArrowOffsets; // Don't always want to draw arrowhead offsets
|
||||
// because they may not work on tool palettes (for example)
|
||||
bool m_isSpline;
|
||||
bool m_maintainStraightLines;
|
||||
|
||||
protected:
|
||||
// Temporary list of line segment orientations
|
||||
// so we know what direction the line is supposed to be dog-legging
|
||||
// in. The values are integer: 0 for vertical, 1 for horizontal.
|
||||
wxList m_lineOrientations;
|
||||
|
||||
// Temporary pointers for start, middle and end label editing objects
|
||||
// (active only when the line is selected)
|
||||
wxLabelShape* m_labelObjects[3];
|
||||
|
||||
// These define the segmented line - not to be confused with temporary control
|
||||
// points which appear when object is selected (although in this case they'll
|
||||
// probably be the same)
|
||||
wxList* m_lineControlPoints;
|
||||
|
||||
float m_arrowSpacing; // Separation between adjacent arrows
|
||||
|
||||
wxShape* m_to;
|
||||
wxShape* m_from;
|
||||
|
||||
/*
|
||||
float m_actualTextWidth; // Space the text takes up
|
||||
float m_actualTextHeight; // (depends on text content unlike nodes)
|
||||
*/
|
||||
int m_attachmentTo; // Attachment point at one end
|
||||
int m_attachmentFrom; // Attachment point at other end
|
||||
|
||||
// Alignment flags
|
||||
int m_alignmentStart;
|
||||
int m_alignmentEnd;
|
||||
|
||||
wxList m_arcArrows;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_LINES_H_
|
@@ -1,83 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: linesp.h
|
||||
// Purpose: Lines private header file
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_LINESP_H_
|
||||
#define _OGL_LINESP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "linesp.h"
|
||||
#endif
|
||||
|
||||
class wxLineControlPoint: public wxControlPoint
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxLineControlPoint)
|
||||
|
||||
public:
|
||||
|
||||
wxLineControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, float size = 0.0,
|
||||
float x = 0.0, float y = 0.0, int the_type = 0);
|
||||
~wxLineControlPoint();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
|
||||
void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
|
||||
|
||||
public:
|
||||
|
||||
int m_type;
|
||||
wxRealPoint* m_point; // Line point
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Temporary arc label object
|
||||
*/
|
||||
|
||||
class wxLabelShape: public wxRectangleShape
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxLabelShape)
|
||||
|
||||
public:
|
||||
wxLabelShape(wxLineShape *parent = NULL, wxShapeRegion *region = NULL, float w = 0.0, float h = 0.0);
|
||||
~wxLabelShape();
|
||||
|
||||
void OnDraw(wxDC& dc);
|
||||
void OnDrawContents(wxDC& dc);
|
||||
void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
|
||||
void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
|
||||
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
|
||||
bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
|
||||
|
||||
public:
|
||||
wxLineShape* m_lineShape;
|
||||
wxShapeRegion* m_shapeRegion;
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Get the point on the given line (x1, y1) (x2, y2)
|
||||
* distance 'length' along from the end,
|
||||
* returned values in x and y
|
||||
*/
|
||||
|
||||
void GetPointOnLine(float x1, float y1, float x2, float y2,
|
||||
float length, float *x, float *y);
|
||||
|
||||
#endif
|
||||
// _OGL_LINESP_H_
|
||||
|
@@ -1,106 +0,0 @@
|
||||
#
|
||||
# File: makefile.b32
|
||||
# Author: Julian Smart
|
||||
# Created: 1996
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds OGL for BC++, 32-bit.
|
||||
|
||||
!if "$(BCCDIR)" == ""
|
||||
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||
!endif
|
||||
|
||||
!if "$(WXWIN)" == ""
|
||||
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||
!endif
|
||||
|
||||
# Change WXDIR to wherever wxWindows is found
|
||||
WXDIR = $(WXWIN)
|
||||
!include $(WXDIR)\src\makeb32.env
|
||||
|
||||
WXLIB = $(WXDIR)\lib\wx32.lib
|
||||
WXINC = $(WXDIR)\include
|
||||
CFG=$(WXWIN)\src\wxwin32.cfg
|
||||
|
||||
OGLDIR = $(WXDIR)\utils\ogl
|
||||
OGLLIB = $(WXDIR)\lib\ogl.lib
|
||||
DOCDIR = $(OGLDIR)\docs
|
||||
|
||||
INC=/DPROLOGIO=1 # /I$(WXDIR)\include\base /I$(WXDIR)\include\msw
|
||||
|
||||
LIBS=$(WXLIB) $(OGLLIB) mathwl cwl import mathwl
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v -DDEBUG=$(DEBUG)
|
||||
!else
|
||||
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS = -DDEBUG=$(DEBUG)
|
||||
!endif
|
||||
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
CFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
OBJECTS = basic.obj basic2.obj canvas.obj ogldiag.obj lines.obj misc.obj divided.obj constrnt.obj\
|
||||
composit.obj drawn.obj bitmap.obj mfutils.obj
|
||||
|
||||
all: $(OGLLIB)
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc32 $(CPPFLAGS) $(INC) -c {$< }
|
||||
|
||||
$(OGLLIB): $(OBJECTS)
|
||||
erase $(OGLLIB)
|
||||
tlib /P128 @&&!
|
||||
$(OGLLIB) &
|
||||
+$(OBJECTS:.obj =.obj +)
|
||||
!
|
||||
|
||||
# Making documents
|
||||
docs: hlp
|
||||
hlp: $(DOCDIR)/ogl.hlp
|
||||
hlp32: $(DOCDIR)/hlp32/ogl.hlp
|
||||
rtf: $(DOCDIR)/ogl.rtf
|
||||
|
||||
$(DOCDIR)/ogl.hlp: $(DOCDIR)/ogl.rtf $(DOCDIR)/ogl.hpj
|
||||
cd $(DOCDIR)
|
||||
-erase ogl.ph
|
||||
hc ogl
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.hlp: $(DOCDIR)/hlp32/ogl.rtf $(DOCDIR)/hlp32/ogl.hpj
|
||||
cd $(DOCDIR)/hlp32
|
||||
-erase ogl.ph
|
||||
start /w hcw /c /e ogl.hpj
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -winhelp
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/hlp32/ogl.rtf -twice -winhelp -macros $(DOCDIR)/t2rtf32.ini
|
||||
cd $(THISDIR)
|
||||
|
||||
wordrtf:
|
||||
cd $(DOCDIR)
|
||||
-wx /W tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -rtf
|
||||
cd $(THISDIR)
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase ..\lib\*.lib $(OGLLIB)
|
||||
|
@@ -1,105 +0,0 @@
|
||||
#
|
||||
# File: makefile.bcc
|
||||
# Author: Julian Smart
|
||||
# Created: 1996
|
||||
# Updated:
|
||||
# Copyright: (c) 1996
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds OGL for BC++, 16-bit.
|
||||
|
||||
!if "$(BCCDIR)" == ""
|
||||
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||
!endif
|
||||
|
||||
!if "$(WXWIN)" == ""
|
||||
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||
!endif
|
||||
|
||||
# Change WXDIR to wherever wxWindows is found
|
||||
WXDIR = $(WXWIN)
|
||||
!include $(WXDIR)\src\makebcc.env
|
||||
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
WXINC = $(WXDIR)\include
|
||||
CFG=$(WXWIN)\src\wxwin.cfg
|
||||
|
||||
OGLDIR = $(WXDIR)\utils\ogl
|
||||
OGLLIB = $(OGLDIR)\lib\ogl.lib
|
||||
DOCDIR = $(OGLDIR)\docs
|
||||
|
||||
INC=/DPROLOGIO=1 # /I$(WXDIR)\include\base /I$(WXDIR)\include\msw
|
||||
|
||||
LIBS=$(WXLIB) $(OGLLIB) mathwl cwl import mathwl
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v
|
||||
!else
|
||||
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS=
|
||||
!endif
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
CFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
OBJECTS = basic.obj basic2.obj canvas.obj ogldiag.obj lines.obj misc.obj divided.obj constrnt.obj\
|
||||
composit.obj drawn.obj bitmap.obj mfutils.obj
|
||||
|
||||
all: $(OGLLIB)
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc $(CPPFLAGS) $(INC) -c {$< }
|
||||
|
||||
$(OGLLIB): $(OBJECTS)
|
||||
erase $(OGLLIB)
|
||||
tlib /P128 @&&!
|
||||
$(OGLLIB) &
|
||||
+$(OBJECTS:.obj =.obj +)
|
||||
!
|
||||
|
||||
# Making documents
|
||||
docs: hlp
|
||||
hlp: $(DOCDIR)/ogl.hlp
|
||||
hlp32: $(DOCDIR)/hlp32/ogl.hlp
|
||||
rtf: $(DOCDIR)/ogl.rtf
|
||||
|
||||
$(DOCDIR)/ogl.hlp: $(DOCDIR)/ogl.rtf $(DOCDIR)/ogl.hpj
|
||||
cd $(DOCDIR)
|
||||
-erase ogl.ph
|
||||
hc ogl
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.hlp: $(DOCDIR)/hlp32/ogl.rtf $(DOCDIR)/hlp32/ogl.hpj
|
||||
cd $(DOCDIR)/hlp32
|
||||
-erase ogl.ph
|
||||
start /w hcw /c /e ogl.hpj
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -winhelp
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/hlp32/ogl.rtf -twice -winhelp -macros $(DOCDIR)/t2rtf32.ini
|
||||
cd $(THISDIR)
|
||||
|
||||
wordrtf:
|
||||
cd $(DOCDIR)
|
||||
-wx /W tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -rtf
|
||||
cd $(THISDIR)
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase ..\lib\*.lib
|
||||
|
@@ -1,161 +0,0 @@
|
||||
#
|
||||
# File: makefile.dos
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile: Builds object graphics library (DOS).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\makemsc.env
|
||||
|
||||
OGLDIR = $(WXDIR)\utils\ogl
|
||||
THISDIR = $(OGLDIR)\src
|
||||
DOCDIR = $(OGLDIR)\docs
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
LIBS=$(WXLIB) libw llibcew commdlg shell ctl3dv2
|
||||
|
||||
GRAPHICSLIB = $(WXDIR)\lib\ogl.lib
|
||||
INC = /I$(WXDIR)\include
|
||||
|
||||
# Normally set OPTIONS =
|
||||
# to disable PROLOGIO-dependent code
|
||||
OPTIONS = -DPROLOGIO
|
||||
|
||||
OBJECTS = basic.obj basic2.obj canvas.obj ogldiag.obj lines.obj misc.obj divided.obj constrnt.obj\
|
||||
composit.obj drawn.obj bitmap.obj mfutils.obj
|
||||
|
||||
all: $(GRAPHICSLIB)
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.dos $(WXLIB) FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
$(GRAPHICSLIB): $(OBJECTS)
|
||||
erase $(GRAPHICSLIB)
|
||||
lib /PAGESIZE:128 @<<
|
||||
$(GRAPHICSLIB)
|
||||
y
|
||||
$(OBJECTS)
|
||||
nul
|
||||
;
|
||||
<<
|
||||
|
||||
# NOTE: This causes a floating point stack error when optimized,
|
||||
# so DON'T optimize!
|
||||
|
||||
basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
bitmap.obj: bitmap.$(SRCSUFF) basic.h misc.h canvas.h bitmap.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
mfutils.obj: mfutils.$(SRCSUFF) mfutils.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
# Making documents
|
||||
docs: hlp
|
||||
hlp: $(DOCDIR)/ogl.hlp
|
||||
hlp32: $(DOCDIR)/hlp32/ogl.hlp
|
||||
rtf: $(DOCDIR)/ogl.rtf
|
||||
|
||||
$(DOCDIR)/ogl.hlp: $(DOCDIR)/ogl.rtf $(DOCDIR)/ogl.hpj
|
||||
cd $(DOCDIR)
|
||||
-erase ogl.ph
|
||||
hc ogl
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.hlp: $(DOCDIR)/hlp32/ogl.rtf $(DOCDIR)/hlp32/ogl.hpj
|
||||
cd $(DOCDIR)/hlp32
|
||||
-erase ogl.ph
|
||||
start /w hcw /c /e ogl.hpj
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -winhelp
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)/hlp32/ogl.rtf: $(DOCDIR)/classes.tex $(DOCDIR)/intro.tex $(DOCDIR)/ogl.tex
|
||||
cd $(DOCDIR)
|
||||
start /w tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/hlp32/ogl.rtf -twice -winhelp -macros $(DOCDIR)/t2rtf32.ini
|
||||
cd $(THISDIR)
|
||||
|
||||
wordrtf:
|
||||
cd $(DOCDIR)
|
||||
-wx /W tex2rtf $(DOCDIR)/ogl.tex $(DOCDIR)/ogl.rtf -twice -rtf
|
||||
cd $(THISDIR)
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.sbr
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.pdb
|
||||
-erase *.lib
|
||||
-erase ..\lib\*.lib
|
||||
|
||||
wxclean:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.dos clean
|
||||
cd $(THISDIR)
|
@@ -1,180 +0,0 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds OGL classes library (MS VC++).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
OBJECTSDIR = $(WXDIR)\utils\ogl
|
||||
THISDIR = $(WXDIR)\utils\ogl\src
|
||||
EXTRALIBS=$(WXDIR)\lib\ogl.lib $(WXDIR)\lib\mfutils.lib
|
||||
EXTRAINC=/I$(WXDIR)\utils\mfutils\src /I$(WXDIR)\utils\prologio\src
|
||||
EXTRAFLAGS=/DPROLOGIO=1
|
||||
DOCDIR=$(WXDIR)\docs
|
||||
LOCALDOCDIR=$(WXDIR)\utils\ogl\docs
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
PROGRAM=test
|
||||
|
||||
OBJECTS = basic.obj basic2.obj canvas.obj ogldiag.obj lines.obj misc.obj divided.obj constrnt.obj\
|
||||
composit.obj drawn.obj bitmap.obj mfutils.obj
|
||||
|
||||
LIBTARGET=$(WXDIR)\lib\ogl.lib
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
$(PROGRAM): $(PROGRAM).exe
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
wxclean:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt clean
|
||||
cd $(THISDIR)
|
||||
|
||||
$(LIBTARGET): $(OBJECTS)
|
||||
-erase $(LIBTARGET)
|
||||
$(implib) @<<
|
||||
-out:$(LIBTARGET)
|
||||
-machine:$(CPU)
|
||||
$(OBJECTS)
|
||||
<<
|
||||
|
||||
# NOTE: This causes a floating point stack error when optimized,
|
||||
# so DON'T optimize!
|
||||
basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
bitmap.obj: bitmap.$(SRCSUFF) basic.h misc.h canvas.h bitmap.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
mfutils.obj: mfutils.$(SRCSUFF) mfutils.h
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.sbr
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.pdb
|
||||
-erase $(LIBTARGET)
|
||||
|
||||
DOCSOURCES=$(LOCALDOCDIR)\ogl.tex \
|
||||
$(LOCALDOCDIR)\bugs.tex $(LOCALDOCDIR)\changes.tex\
|
||||
$(LOCALDOCDIR)\classes.tex $(LOCALDOCDIR)\intro.tex\
|
||||
$(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex
|
||||
|
||||
html: $(DOCDIR)\html\ogl\ogl.htm
|
||||
hlp: $(DOCDIR)\winhelp\ogl.hlp
|
||||
pdfrtf: $(DOCDIR)\pdf\ogl.rtf
|
||||
ps: $(DOCDIR)\ps\ogl.ps
|
||||
|
||||
$(DOCDIR)\winhelp\ogl.hlp: $(LOCALDOCDIR)\ogl.rtf $(LOCALDOCDIR)\ogl.hpj
|
||||
cd $(LOCALDOCDIR)
|
||||
-erase ogl.ph
|
||||
hc ogl
|
||||
move ogl.hlp $(DOCDIR)\winhelp\ogl.hlp
|
||||
move ogl.cnt $(DOCDIR)\winhelp\ogl.cnt
|
||||
cd $(THISDIR)
|
||||
|
||||
$(LOCALDOCDIR)\ogl.rtf: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(LOCALDOCDIR)\ogl.rtf -twice -winhelp
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)\pdf\ogl.rtf: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
-copy *.bmp $(DOCDIR)\pdf
|
||||
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\pdf\ogl.rtf -twice -rtf
|
||||
cd $(THISDIR)
|
||||
|
||||
$(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
-mkdir $(DOCDIR)\html\ogl
|
||||
cp *.gif $(DOCDIR)\html\ogl
|
||||
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
|
||||
-erase $(DOCDIR)\html\ogl\*.con
|
||||
-erase $(DOCDIR)\html\ogl\*.ref
|
||||
cd $(THISDIR)
|
||||
|
||||
$(LOCALDOCDIR)\ogl.dvi: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
-latex ogl
|
||||
-latex ogl
|
||||
-makeindx ogl
|
||||
-bibtex ogl
|
||||
-latex ogl
|
||||
-latex ogl
|
||||
cd $(THISDIR)
|
||||
|
||||
$(WXDIR)\docs\ps\ogl.ps: $(LOCALDOCDIR)\ogl.dvi
|
||||
cd $(LOCALDOCDIR)
|
||||
-dvips32 -o ogl.ps ogl
|
||||
move ogl.ps $(WXDIR)\docs\ps\ogl.ps
|
||||
cd $(THISDIR)
|
||||
|
||||
|
@@ -1,125 +0,0 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# Author: Julian Smart
|
||||
# Created: 1996
|
||||
# Updated:
|
||||
# Copyright: (c) 1996 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for object graphics library (UNIX).
|
||||
|
||||
WXDIR = ../../..
|
||||
|
||||
# All common UNIX compiler flags and options are now in
|
||||
# this central makefile.
|
||||
include $(WXDIR)/src/make.env
|
||||
|
||||
PRODIR = $(WXDIR)/utils/prologio
|
||||
PROINC = $(PRODIR)/src
|
||||
PROLIB = $(PRODIR)/lib/libproio$(GUISUFFIX).a
|
||||
|
||||
MFDIR = $(WXDIR)/utils/mfutils
|
||||
MFINC = $(MFDIR)/src
|
||||
|
||||
OGLDIR = $(WXDIR)/utils/ogl
|
||||
OGLLIB = $(OGLDIR)/lib/libogl$(GUISUFFIX).a
|
||||
|
||||
OBJECTS = $(OBJDIR)/basic.o $(OBJDIR)/basic2.o $(OBJDIR)/canvas.o $(OBJDIR)/lines.o $(OBJDIR)/misc.o\
|
||||
$(OBJDIR)/divided.o $(OBJDIR)/constrnt.o $(OBJDIR)/composit.o $(OBJDIR)/drawn.o\
|
||||
$(OBJDIR)/bitmap.o $(OBJDIR)/ogldiag.o
|
||||
|
||||
CPPFLAGS = -I$(PROINC) -I$(MFINC) $(XINCLUDE) $(INC) $(GUI) -DDEBUG='$(DEBUG)' $(DEBUGFLAGS) $(WARN) $(OPTIONS) -DPROLOGIO
|
||||
|
||||
all: $(OBJDIR) $(OGLLIB)
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx OPT=$(OPT) GUI=$(GUI)
|
||||
|
||||
motif:
|
||||
$(MAKE) -f makefile.unx GUI=-Dwx_motif OPT=$(OPT) GUISUFFIX=_motif LDLIBS='$(MOTIFLDLIBS)' XVIEW_LINK=
|
||||
|
||||
xview:
|
||||
$(MAKE) -f makefile.unx GUI=-Dwx_xview OPT=$(OPT) GUISUFFIX=_ol
|
||||
|
||||
hp:
|
||||
$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' DEBUGFLAGS='-g' OPT='' WARN='-w' \
|
||||
XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' \
|
||||
LDLIBS='$(HPLDLIBS)'
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
$(OGLLIB): $(OBJECTS)
|
||||
rm -f $@
|
||||
ar $(AROPTIONS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(OBJDIR)/basic.o: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ basic.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/basic2.o: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ basic2.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/canvas.o: canvas.$(SRCSUFF) basic.h misc.h canvas.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ canvas.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/lines.o: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ lines.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/misc.o: misc.$(SRCSUFF) basic.h misc.h constrnt.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ misc.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/divided.o: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ divided.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/constrnt.o: constrnt.$(SRCSUFF) basic.h constrnt.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ constrnt.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/composit.o: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ composit.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/drawn.o: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ drawn.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/bitmap.o: bitmap.$(SRCSUFF) basic.h misc.h canvas.h bitmap.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ bitmap.$(SRCSUFF)
|
||||
|
||||
$(OBJDIR)/ogldiag.o: ogldiag.$(SRCSUFF) basic.h misc.h canvas.h bitmap.h ogldiag.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ ogldiag.$(SRCSUFF)
|
||||
|
||||
HTMLDIR=/home/hardy/html/wx/manuals
|
||||
|
||||
docs: ps xlp
|
||||
ps: $(OGLDIR)/docs/ogl.ps
|
||||
xlp: $(OGLDIR)/docs/ogl.xlp
|
||||
html: $(HTMLDIR)/ogl/ogl_contents.html
|
||||
|
||||
$(OGLDIR)/docs/ogl.xlp: $(OGLDIR)/docs/classes.tex $(OGLDIR)/docs/ogl.tex $(OGLDIR)/docs/topics.tex $(OGLDIR)/docs/changes.tex $(OGLDIR)/docs/intro.tex
|
||||
cd ../docs; tex2rtf ogl.tex tmp.xlp -xlp -twice
|
||||
sed -e "s/WXHELPCONTENTS/OGL Manual/g" < $(OGLDIR)/docs/tmp.xlp > $(OGLDIR)/docs/ogl.xlp
|
||||
/bin/rm -f $(OGLDIR)/docs/tmp.xlp
|
||||
|
||||
$(HTMLDIR)/ogl/ogl_contents.html: $(OGLDIR)/docs/classes.tex $(OGLDIR)/docs/ogl.tex $(OGLDIR)/docs/topics.tex $(OGLDIR)/docs/changes.tex $(OGLDIR)/docs/intro.tex
|
||||
cd ../docs; tex2rtf ogl.tex $(HTMLDIR)/ogl/ogl -twice -html
|
||||
|
||||
$(OGLDIR)/docs/ogl.dvi: $(OGLDIR)/docs/ogl.tex $(OGLDIR)/docs/classes.tex $(OGLDIR)/docs/topics.tex $(OGLDIR)/docs/changes.tex $(OGLDIR)/docs/intro.tex
|
||||
cd $(OGLDIR)/docs; latex ogl; latex ogl; makeindex ogl; latex ogl; \
|
||||
|
||||
$(OGLDIR)/docs/ogl.ps: $(OGLDIR)/docs/ogl.dvi
|
||||
cd $(OGLDIR)/docs; dvips -f -r < ogl.dvi > ogl.ps
|
||||
|
||||
cleaneach:
|
||||
rm -f $(OBJECTS) $(OGLLIB) core
|
||||
|
||||
clean_motif:
|
||||
$(MAKE) -f makefile.unx GUISUFFIX=_motif cleaneach
|
||||
|
||||
clean_ol:
|
||||
$(MAKE) -f makefile.unx GUISUFFIX=_ol cleaneach
|
||||
|
||||
clean_hp:
|
||||
$(MAKE) -f makefile.unx GUISUFFIX=_hp cleaneach
|
||||
|
@@ -1,28 +0,0 @@
|
||||
# Objects makefile
|
||||
|
||||
WXDIR = ..\..\..
|
||||
|
||||
!include $(WXDIR)\src\makewat.env
|
||||
|
||||
EXTRACPPFLAGS=/DPROLOGIO
|
||||
|
||||
OBJECTSLIB = $(WXDIR)\utils\objects\lib\graphics.lib
|
||||
THISDIR = $(WXDIR)\utils\objects\src
|
||||
|
||||
NAME = graphics
|
||||
LNK = $(name).lnk
|
||||
|
||||
IFLAGS = -i=$(WXINC) -i=$(WXBASEINC) -i=..\..\mfutils\src -i=..\..\prologio\src
|
||||
|
||||
OBJECTS = basic.obj basic2.obj canvas.obj lines.obj misc.obj divided.obj constrnt.obj composit.obj drawn.obj bitmap.obj
|
||||
|
||||
all: $(OBJECTSLIB)
|
||||
|
||||
$(OBJECTSLIB): $(OBJECTS)
|
||||
*wlib /b /c /n /P=256 $(OBJECTSLIB) $(OBJECTS)
|
||||
|
||||
clean: .SYMBOLIC
|
||||
-erase *.obj *.bak *.err *.pch $(OBJECTSLIB) *.lbc
|
||||
|
||||
|
||||
|
@@ -1,211 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mfutils.h
|
||||
// Purpose: Metafile utilities: reading a placeable metafile independently
|
||||
// of Windows.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MFUTILS_H_
|
||||
#define _MFUTILS_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "mfutils.h"
|
||||
#endif
|
||||
|
||||
#include <wx/metafile.h>
|
||||
|
||||
#ifndef __WXMSW__
|
||||
#define GetRValue(rgb) ((unsigned char)(rgb))
|
||||
#define GetGValue(rgb) ((unsigned char)(((int)(rgb)) >> 8))
|
||||
#define GetBValue(rgb) ((unsigned char)((rgb)>>16))
|
||||
#endif
|
||||
|
||||
/* Metafile Functions */
|
||||
/* Win32s/Borland need these macros, although META_SETBKCOLOR is defined */
|
||||
#if !defined(META_SETBKCOLOR) || defined(WIN32)
|
||||
|
||||
#define META_SETBKCOLOR 0x0201
|
||||
#define META_SETBKMODE 0x0102
|
||||
#define META_SETMAPMODE 0x0103
|
||||
#define META_SETROP2 0x0104
|
||||
#define META_SETRELABS 0x0105
|
||||
#define META_SETPOLYFILLMODE 0x0106
|
||||
#define META_SETSTRETCHBLTMODE 0x0107
|
||||
#define META_SETTEXTCHAREXTRA 0x0108
|
||||
#define META_SETTEXTCOLOR 0x0209
|
||||
#define META_SETTEXTJUSTIFICATION 0x020A
|
||||
#define META_SETWINDOWORG 0x020B
|
||||
#define META_SETWINDOWEXT 0x020C
|
||||
#define META_SETVIEWPORTORG 0x020D
|
||||
#define META_SETVIEWPORTEXT 0x020E
|
||||
#define META_OFFSETWINDOWORG 0x020F
|
||||
#define META_SCALEWINDOWEXT 0x0410
|
||||
#define META_OFFSETVIEWPORTORG 0x0211
|
||||
#define META_SCALEVIEWPORTEXT 0x0412
|
||||
#define META_LINETO 0x0213
|
||||
#define META_MOVETO 0x0214
|
||||
#define META_EXCLUDECLIPRECT 0x0415
|
||||
#define META_INTERSECTCLIPRECT 0x0416
|
||||
#define META_ARC 0x0817
|
||||
#define META_ELLIPSE 0x0418
|
||||
#define META_FLOODFILL 0x0419
|
||||
#define META_PIE 0x081A
|
||||
#define META_RECTANGLE 0x041B
|
||||
#define META_ROUNDRECT 0x061C
|
||||
#define META_PATBLT 0x061D
|
||||
#define META_SAVEDC 0x001E
|
||||
#define META_SETPIXEL 0x041F
|
||||
#define META_OFFSETCLIPRGN 0x0220
|
||||
#define META_TEXTOUT 0x0521
|
||||
#define META_BITBLT 0x0922
|
||||
#define META_STRETCHBLT 0x0B23
|
||||
#define META_POLYGON 0x0324
|
||||
#define META_POLYLINE 0x0325
|
||||
#define META_ESCAPE 0x0626
|
||||
#define META_RESTOREDC 0x0127
|
||||
#define META_FILLREGION 0x0228
|
||||
#define META_FRAMEREGION 0x0429
|
||||
#define META_INVERTREGION 0x012A
|
||||
#define META_PAINTREGION 0x012B
|
||||
#define META_SELECTCLIPREGION 0x012C
|
||||
#define META_SELECTOBJECT 0x012D
|
||||
#define META_SETTEXTALIGN 0x012E
|
||||
#define META_DRAWTEXT 0x062F
|
||||
|
||||
#define META_CHORD 0x0830
|
||||
#define META_SETMAPPERFLAGS 0x0231
|
||||
#define META_EXTTEXTOUT 0x0a32
|
||||
#define META_SETDIBTODEV 0x0d33
|
||||
#define META_SELECTPALETTE 0x0234
|
||||
#define META_REALIZEPALETTE 0x0035
|
||||
#define META_ANIMATEPALETTE 0x0436
|
||||
#define META_SETPALENTRIES 0x0037
|
||||
#define META_POLYPOLYGON 0x0538
|
||||
#define META_RESIZEPALETTE 0x0139
|
||||
|
||||
#define META_DIBBITBLT 0x0940
|
||||
#define META_DIBSTRETCHBLT 0x0b41
|
||||
#define META_DIBCREATEPATTERNBRUSH 0x0142
|
||||
#define META_STRETCHDIB 0x0f43
|
||||
|
||||
#define META_EXTFLOODFILL 0x0548
|
||||
|
||||
#define META_RESETDC 0x014C
|
||||
#define META_STARTDOC 0x014D
|
||||
#define META_STARTPAGE 0x004F
|
||||
#define META_ENDPAGE 0x0050
|
||||
#define META_ABORTDOC 0x0052
|
||||
#define META_ENDDOC 0x005E
|
||||
|
||||
#define META_DELETEOBJECT 0x01f0
|
||||
|
||||
#define META_CREATEPALETTE 0x00f7
|
||||
#define META_CREATEBRUSH 0x00F8
|
||||
#define META_CREATEPATTERNBRUSH 0x01F9
|
||||
#define META_CREATEPENINDIRECT 0x02FA
|
||||
#define META_CREATEFONTINDIRECT 0x02FB
|
||||
#define META_CREATEBRUSHINDIRECT 0x02FC
|
||||
#define META_CREATEBITMAPINDIRECT 0x02FD
|
||||
#define META_CREATEBITMAP 0x06FE
|
||||
#define META_CREATEREGION 0x06FF
|
||||
|
||||
/* Background Modes */
|
||||
#define TRANSPARENT 1
|
||||
#define OPAQUE 2
|
||||
|
||||
/* Pen Styles */
|
||||
#define PS_SOLID 0
|
||||
#define PS_DASH 1
|
||||
#define PS_DOT 2
|
||||
#define PS_DASHDOT 3
|
||||
#define PS_DASHDOTDOT 4
|
||||
#define PS_NULL 5
|
||||
#define PS_INSIDEFRAME 6
|
||||
|
||||
/* PitchAndFamily family values (high 4 bits) */
|
||||
/* Win32s/Borland don't need this */
|
||||
#if !defined(__BORLANDC__) && !defined(WIN32)
|
||||
#define FF_DONTCARE 0x00
|
||||
#define FF_ROMAN 0x10
|
||||
#define FF_SWISS 0x20
|
||||
#define FF_MODERN 0x30
|
||||
#define FF_SCRIPT 0x40
|
||||
#define FF_DECORATIVE 0x50
|
||||
#endif
|
||||
|
||||
/* Brush Styles */
|
||||
#define BS_SOLID 0
|
||||
#define BS_NULL 1
|
||||
#define BS_HOLLOW BS_NULL
|
||||
#define BS_HATCHED 2
|
||||
#define BS_PATTERN 3
|
||||
#define BS_INDEXED 4
|
||||
#define BS_DIBPATTERN 5
|
||||
|
||||
/* Hatch Styles */
|
||||
#define HS_HORIZONTAL 0
|
||||
#define HS_VERTICAL 1
|
||||
#define HS_FDIAGONAL 2
|
||||
#define HS_BDIAGONAL 3
|
||||
#define HS_CROSS 4
|
||||
#define HS_DIAGCROSS 5
|
||||
|
||||
#endif // metafile functions
|
||||
|
||||
class wxMetaRecord: public wxObject
|
||||
{
|
||||
public:
|
||||
int metaFunction;
|
||||
long param1;
|
||||
long param2;
|
||||
long param3;
|
||||
long param4;
|
||||
long param5;
|
||||
long param6;
|
||||
long param7;
|
||||
long param8;
|
||||
char *stringParam;
|
||||
wxRealPoint *points;
|
||||
|
||||
wxMetaRecord(int fun)
|
||||
{
|
||||
metaFunction = fun; points = NULL; stringParam = NULL;
|
||||
param1 = 0;
|
||||
}
|
||||
~wxMetaRecord(void);
|
||||
};
|
||||
|
||||
class wxXMetaFile: public wxObject
|
||||
{
|
||||
public:
|
||||
float lastX;
|
||||
float lastY;
|
||||
bool ok;
|
||||
|
||||
float left;
|
||||
float top;
|
||||
float right;
|
||||
float bottom;
|
||||
|
||||
wxList metaRecords;
|
||||
wxList gdiObjects; // List of wxMetaRecord objects created with Create...,
|
||||
// referenced by position in list by SelectObject
|
||||
wxXMetaFile(char *file = NULL);
|
||||
~wxXMetaFile(void);
|
||||
|
||||
// After this is called, the metafile cannot be used for anything
|
||||
// since it is now owned by the clipboard.
|
||||
bool SetClipboard(int width = 0, int height = 0);
|
||||
|
||||
bool Play(wxDC *dc);
|
||||
inline bool Ok(void) const { return ok; }
|
||||
bool ReadFile(char *file);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _MFUTILS_H_
|
@@ -1,805 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: misc.cpp
|
||||
// Purpose: Miscellaneous OGL support functions
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "misc.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#include <wx/types.h>
|
||||
|
||||
#if USE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "basic.h"
|
||||
#include "basicp.h"
|
||||
#include "misc.h"
|
||||
#include "constrnt.h"
|
||||
#include "composit.h"
|
||||
|
||||
wxFont *g_oglNormalFont;
|
||||
|
||||
wxPen *black_pen;
|
||||
wxPen *white_background_pen;
|
||||
wxPen *transparent_pen;
|
||||
wxBrush *white_background_brush;
|
||||
wxPen *black_foreground_pen;
|
||||
|
||||
char *GraphicsBuffer = NULL;
|
||||
wxCursor *GraphicsBullseyeCursor = NULL;
|
||||
|
||||
wxList wxObjectCopyMapping(wxKEY_INTEGER);
|
||||
|
||||
void wxOGLInitialize()
|
||||
{
|
||||
GraphicsBullseyeCursor = new wxCursor(wxCURSOR_BULLSEYE);
|
||||
|
||||
g_oglNormalFont = new wxFont(12, wxMODERN, wxNORMAL, wxNORMAL);
|
||||
|
||||
black_pen = new wxPen("BLACK", 1, wxSOLID);
|
||||
|
||||
white_background_pen = new wxPen("WHITE", 1, wxSOLID);
|
||||
transparent_pen = new wxPen("WHITE", 1, wxTRANSPARENT);
|
||||
white_background_brush = new wxBrush("WHITE", wxSOLID);
|
||||
black_foreground_pen = new wxPen("BLACK", 1, wxSOLID);
|
||||
|
||||
OGLInitializeConstraintTypes();
|
||||
|
||||
// Initialize big buffer used when writing images
|
||||
GraphicsBuffer = new char[3000];
|
||||
|
||||
if (!oglPopupDivisionMenu)
|
||||
{
|
||||
oglPopupDivisionMenu = new wxMenu("", (wxFunction)oglGraphicsDivisionMenuProc);
|
||||
oglPopupDivisionMenu->Append(DIVISION_MENU_SPLIT_HORIZONTALLY, "Split horizontally");
|
||||
oglPopupDivisionMenu->Append(DIVISION_MENU_SPLIT_VERTICALLY, "Split vertically");
|
||||
oglPopupDivisionMenu->AppendSeparator();
|
||||
oglPopupDivisionMenu->Append(DIVISION_MENU_EDIT_LEFT_EDGE, "Edit left edge");
|
||||
oglPopupDivisionMenu->Append(DIVISION_MENU_EDIT_TOP_EDGE, "Edit top edge");
|
||||
}
|
||||
}
|
||||
|
||||
void wxOGLCleanUp()
|
||||
{
|
||||
if (GraphicsBuffer)
|
||||
{
|
||||
delete[] GraphicsBuffer;
|
||||
GraphicsBuffer = NULL;
|
||||
}
|
||||
GraphicsBuffer = NULL;
|
||||
if (oglPopupDivisionMenu)
|
||||
{
|
||||
delete oglPopupDivisionMenu;
|
||||
oglPopupDivisionMenu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
wxFont *MatchFont(int point_size)
|
||||
{
|
||||
wxFont *font = wxTheFontList->FindOrCreateFont(point_size, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
#if 0
|
||||
switch (point_size)
|
||||
{
|
||||
case 4:
|
||||
font = swiss_font_4;
|
||||
break;
|
||||
case 6:
|
||||
font = swiss_font_6;
|
||||
break;
|
||||
case 8:
|
||||
font = swiss_font_8;
|
||||
break;
|
||||
case 12:
|
||||
font = swiss_font_12;
|
||||
break;
|
||||
case 14:
|
||||
font = swiss_font_14;
|
||||
break;
|
||||
case 18:
|
||||
font = swiss_font_18;
|
||||
break;
|
||||
case 24:
|
||||
font = swiss_font_24;
|
||||
break;
|
||||
default:
|
||||
case 10:
|
||||
font = swiss_font_10;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return font;
|
||||
}
|
||||
|
||||
int FontSizeDialog(wxFrame *parent, int old_size)
|
||||
{
|
||||
if (old_size <= 0)
|
||||
old_size = 10;
|
||||
char buf[40];
|
||||
sprintf(buf, "%d", old_size);
|
||||
wxString ans = wxGetTextFromUser("Enter point size", "Font size", buf, parent);
|
||||
if (ans == "")
|
||||
return 0;
|
||||
|
||||
int new_size = atoi(ans);
|
||||
if ((new_size <= 0) || (new_size > 40))
|
||||
{
|
||||
wxMessageBox("Invalid point size!", "Error", wxOK);
|
||||
return 0;
|
||||
}
|
||||
return new_size;
|
||||
/*
|
||||
char *strings[8];
|
||||
strings[0] = "4";
|
||||
strings[1] = "6";
|
||||
strings[2] = "8";
|
||||
strings[3] = "10";
|
||||
strings[4] = "12";
|
||||
strings[5] = "14";
|
||||
strings[6] = "18";
|
||||
strings[7] = "24";
|
||||
char *ans = wxGetSingleChoice("Choose", "Choose a font size", 8, strings, parent);
|
||||
if (ans)
|
||||
{
|
||||
int size;
|
||||
sscanf(ans, "%d", &size);
|
||||
return MatchFont(size);
|
||||
}
|
||||
else return NULL;
|
||||
*/
|
||||
}
|
||||
|
||||
// Centre a list of strings in the given box. xOffset and yOffset are the
|
||||
// the positions that these lines should be relative to, and this might be
|
||||
// the same as m_xpos, m_ypos, but might be zero if formatting from left-justifying.
|
||||
void CentreText(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height,
|
||||
int formatMode)
|
||||
{
|
||||
int n = text_list->Number();
|
||||
|
||||
if (!text_list || (n == 0))
|
||||
return;
|
||||
|
||||
// First, get maximum dimensions of box enclosing text
|
||||
|
||||
float char_height = 0;
|
||||
float max_width = 0;
|
||||
float current_width = 0;
|
||||
|
||||
// Store text extents for speed
|
||||
float *widths = new float[n];
|
||||
|
||||
wxNode *current = text_list->First();
|
||||
int i = 0;
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
|
||||
widths[i] = current_width;
|
||||
|
||||
if (current_width > max_width)
|
||||
max_width = current_width;
|
||||
current = current->Next();
|
||||
i ++;
|
||||
}
|
||||
|
||||
float max_height = n*char_height;
|
||||
|
||||
float xoffset, yoffset, xOffset, yOffset;
|
||||
|
||||
if (formatMode & FORMAT_CENTRE_VERT)
|
||||
{
|
||||
if (max_height < height)
|
||||
yoffset = (float)(m_ypos - (height/2.0) + (height - max_height)/2.0);
|
||||
else
|
||||
yoffset = (float)(m_ypos - (height/2.0));
|
||||
yOffset = m_ypos;
|
||||
}
|
||||
else
|
||||
{
|
||||
yoffset = 0.0;
|
||||
yOffset = 0.0;
|
||||
}
|
||||
|
||||
if (formatMode & FORMAT_CENTRE_HORIZ)
|
||||
{
|
||||
xoffset = (float)(m_xpos - width/2.0);
|
||||
xOffset = m_xpos;
|
||||
}
|
||||
else
|
||||
{
|
||||
xoffset = 0.0;
|
||||
xOffset = 0.0;
|
||||
}
|
||||
|
||||
current = text_list->First();
|
||||
i = 0;
|
||||
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
|
||||
float x;
|
||||
if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width))
|
||||
x = (float)((width - widths[i])/2.0 + xoffset);
|
||||
else
|
||||
x = xoffset;
|
||||
float y = (float)(i*char_height + yoffset);
|
||||
|
||||
line->SetX( x - xOffset ); line->SetY( y - yOffset );
|
||||
current = current->Next();
|
||||
i ++;
|
||||
}
|
||||
|
||||
delete widths;
|
||||
}
|
||||
|
||||
// Centre a list of strings in the given box
|
||||
void CentreTextNoClipping(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height)
|
||||
{
|
||||
int n = text_list->Number();
|
||||
|
||||
if (!text_list || (n == 0))
|
||||
return;
|
||||
|
||||
// First, get maximum dimensions of box enclosing text
|
||||
|
||||
float char_height = 0;
|
||||
float max_width = 0;
|
||||
float current_width = 0;
|
||||
|
||||
// Store text extents for speed
|
||||
float *widths = new float[n];
|
||||
|
||||
wxNode *current = text_list->First();
|
||||
int i = 0;
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
|
||||
widths[i] = current_width;
|
||||
|
||||
if (current_width > max_width)
|
||||
max_width = current_width;
|
||||
current = current->Next();
|
||||
i ++;
|
||||
}
|
||||
|
||||
float max_height = n*char_height;
|
||||
|
||||
float yoffset = (float)(m_ypos - (height/2.0) + (height - max_height)/2.0);
|
||||
|
||||
float xoffset = (float)(m_xpos - width/2.0);
|
||||
|
||||
current = text_list->First();
|
||||
i = 0;
|
||||
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
|
||||
float x = (float)((width - widths[i])/2.0 + xoffset);
|
||||
float y = (float)(i*char_height + yoffset);
|
||||
|
||||
line->SetX( x - m_xpos ); line->SetY( y - m_ypos );
|
||||
current = current->Next();
|
||||
i ++;
|
||||
}
|
||||
delete widths;
|
||||
}
|
||||
|
||||
void GetCentredTextExtent(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height,
|
||||
float *actual_width, float *actual_height)
|
||||
{
|
||||
int n = text_list->Number();
|
||||
|
||||
if (!text_list || (n == 0))
|
||||
{
|
||||
*actual_width = 0;
|
||||
*actual_height = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// First, get maximum dimensions of box enclosing text
|
||||
|
||||
float char_height = 0;
|
||||
float max_width = 0;
|
||||
float current_width = 0;
|
||||
|
||||
wxNode *current = text_list->First();
|
||||
int i = 0;
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
|
||||
|
||||
if (current_width > max_width)
|
||||
max_width = current_width;
|
||||
current = current->Next();
|
||||
i ++;
|
||||
}
|
||||
|
||||
*actual_height = n*char_height;
|
||||
*actual_width = max_width;
|
||||
}
|
||||
|
||||
// Format a string to a list of strings that fit in the given box.
|
||||
// Interpret %n and 10 or 13 as a new line.
|
||||
wxList *FormatText(wxDC& dc, const wxString& text, float width, float height, int formatMode)
|
||||
{
|
||||
// First, parse the string into a list of words
|
||||
wxList word_list;
|
||||
|
||||
// Make new lines into NULL strings at this point
|
||||
int i = 0; int j = 0; int len = strlen(text);
|
||||
char word[200]; word[0] = 0;
|
||||
bool end_word = FALSE; bool new_line = FALSE;
|
||||
while (i < len)
|
||||
{
|
||||
switch (text[i])
|
||||
{
|
||||
case '%':
|
||||
{
|
||||
i ++;
|
||||
if (i == len)
|
||||
{ word[j] = '%'; j ++; }
|
||||
else
|
||||
{
|
||||
if (text[i] == 'n')
|
||||
{ new_line = TRUE; end_word = TRUE; i++; }
|
||||
else
|
||||
{ word[j] = '%'; j ++; word[j] = text[i]; j ++; i ++; }
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
new_line = TRUE; end_word = TRUE; i++;
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
new_line = TRUE; end_word = TRUE; i++;
|
||||
}
|
||||
case ' ':
|
||||
{
|
||||
end_word = TRUE;
|
||||
i ++;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
word[j] = text[i];
|
||||
j ++; i ++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == len) end_word = TRUE;
|
||||
if (end_word)
|
||||
{
|
||||
word[j] = 0;
|
||||
j = 0;
|
||||
word_list.Append((wxObject *)copystring(word));
|
||||
end_word = FALSE;
|
||||
}
|
||||
if (new_line)
|
||||
{
|
||||
word_list.Append((wxObject *)NULL);
|
||||
new_line = FALSE;
|
||||
}
|
||||
}
|
||||
// Now, make a list of strings which can fit in the box
|
||||
wxList *string_list = new wxList;
|
||||
|
||||
char buffer[400];
|
||||
buffer[0] = 0;
|
||||
wxNode *node = word_list.First();
|
||||
float x, y;
|
||||
|
||||
while (node)
|
||||
{
|
||||
char *keep_string = copystring(buffer);
|
||||
|
||||
char *s = (char *)node->Data();
|
||||
if (!s)
|
||||
{
|
||||
// FORCE NEW LINE
|
||||
if (strlen(keep_string) > 0)
|
||||
string_list->Append((wxObject *)keep_string);
|
||||
else
|
||||
delete[] keep_string;
|
||||
|
||||
buffer[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (buffer[0] != 0)
|
||||
strcat(buffer, " ");
|
||||
|
||||
strcat(buffer, s);
|
||||
dc.GetTextExtent(buffer, &x, &y);
|
||||
|
||||
// Don't fit within the bounding box if we're fitting shape to contents
|
||||
if ((x > width) && !(formatMode & FORMAT_SIZE_TO_CONTENTS))
|
||||
{
|
||||
// Deal with first word being wider than box
|
||||
if (strlen(keep_string) > 0)
|
||||
string_list->Append((wxObject *)keep_string);
|
||||
else
|
||||
delete[] keep_string;
|
||||
|
||||
buffer[0] = 0;
|
||||
strcat(buffer, s);
|
||||
delete[] s;
|
||||
}
|
||||
else
|
||||
delete[] keep_string;
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
if (buffer[0] != 0)
|
||||
string_list->Append((wxObject *)copystring(buffer));
|
||||
|
||||
return string_list;
|
||||
}
|
||||
|
||||
void DrawFormattedText(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height,
|
||||
int formatMode)
|
||||
{
|
||||
float xoffset, yoffset;
|
||||
if (formatMode & FORMAT_CENTRE_HORIZ)
|
||||
xoffset = m_xpos;
|
||||
else
|
||||
xoffset = (float)(m_xpos - (width / 2.0));
|
||||
|
||||
if (formatMode & FORMAT_CENTRE_VERT)
|
||||
yoffset = m_ypos;
|
||||
else
|
||||
yoffset = (float)(m_ypos - (height / 2.0));
|
||||
|
||||
dc.SetClippingRegion(
|
||||
(float)(m_xpos - width/2.0), (float)(m_ypos - height/2.0),
|
||||
(float)width, (float)height);
|
||||
|
||||
wxNode *current = text_list->First();
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
|
||||
|
||||
dc.DrawText(line->GetText(), xoffset + line->GetX(), yoffset + line->GetY());
|
||||
current = current->Next();
|
||||
}
|
||||
|
||||
dc.DestroyClippingRegion();
|
||||
}
|
||||
|
||||
/*
|
||||
* Find centroid given list of points comprising polyline
|
||||
*
|
||||
*/
|
||||
|
||||
void find_polyline_centroid(wxList *points, float *x, float *y)
|
||||
{
|
||||
float xcount = 0;
|
||||
float ycount = 0;
|
||||
|
||||
wxNode *node = points->First();
|
||||
while (node)
|
||||
{
|
||||
wxRealPoint *point = (wxRealPoint *)node->Data();
|
||||
xcount += point->x;
|
||||
ycount += point->y;
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
*x = (xcount/points->Number());
|
||||
*y = (ycount/points->Number());
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that (x1, y1) -> (x2, y2) hits (x3, y3) -> (x4, y4).
|
||||
* If so, ratio1 gives the proportion along the first line
|
||||
* that the intersection occurs (or something like that).
|
||||
* Used by functions below.
|
||||
*
|
||||
*/
|
||||
void check_line_intersection(float x1, float y1, float x2, float y2,
|
||||
float x3, float y3, float x4, float y4,
|
||||
float *ratio1, float *ratio2)
|
||||
{
|
||||
float denominator_term = (y4 - y3)*(x2 - x1) - (y2 - y1)*(x4 - x3);
|
||||
float numerator_term = (x3 - x1)*(y4 - y3) + (x4 - x3)*(y1 - y3);
|
||||
|
||||
float line_constant;
|
||||
float length_ratio = 1.0;
|
||||
float k_line = 1.0;
|
||||
|
||||
// Check for parallel lines
|
||||
if ((denominator_term < 0.005) && (denominator_term > -0.005))
|
||||
line_constant = -1.0;
|
||||
else
|
||||
line_constant = numerator_term/denominator_term;
|
||||
|
||||
// Check for intersection
|
||||
if ((line_constant < 1.0) && (line_constant > 0.0))
|
||||
{
|
||||
// Now must check that other line hits
|
||||
if (((y4 - y3) < 0.005) && ((y4 - y3) > -0.005))
|
||||
k_line = ((x1 - x3) + line_constant*(x2 - x1))/(x4 - x3);
|
||||
else
|
||||
k_line = ((y1 - y3) + line_constant*(y2 - y1))/(y4 - y3);
|
||||
|
||||
if ((k_line >= 0.0) && (k_line < 1.0))
|
||||
length_ratio = line_constant;
|
||||
else
|
||||
k_line = 1.0;
|
||||
}
|
||||
*ratio1 = length_ratio;
|
||||
*ratio2 = k_line;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find where (x1, y1) -> (x2, y2) hits one of the lines in xvec, yvec.
|
||||
* (*x3, *y3) is the point where it hits.
|
||||
*
|
||||
*/
|
||||
void find_end_for_polyline(float n, float xvec[], float yvec[],
|
||||
float x1, float y1, float x2, float y2, float *x3, float *y3)
|
||||
{
|
||||
int i;
|
||||
float lastx = xvec[0];
|
||||
float lasty = yvec[0];
|
||||
|
||||
float min_ratio = 1.0;
|
||||
float line_ratio;
|
||||
float other_ratio;
|
||||
|
||||
for (i = 1; i < n; i++)
|
||||
{
|
||||
check_line_intersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i],
|
||||
&line_ratio, &other_ratio);
|
||||
lastx = xvec[i];
|
||||
lasty = yvec[i];
|
||||
|
||||
if (line_ratio < min_ratio)
|
||||
min_ratio = line_ratio;
|
||||
}
|
||||
|
||||
// Do last (implicit) line if last and first floats are not identical
|
||||
if (!(xvec[0] == lastx && yvec[0] == lasty))
|
||||
{
|
||||
check_line_intersection(x1, y1, x2, y2, lastx, lasty, xvec[0], yvec[0],
|
||||
&line_ratio, &other_ratio);
|
||||
|
||||
if (line_ratio < min_ratio)
|
||||
min_ratio = line_ratio;
|
||||
}
|
||||
|
||||
*x3 = (x1 + (x2 - x1)*min_ratio);
|
||||
*y3 = (y1 + (y2 - y1)*min_ratio);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Find where the line hits the box.
|
||||
*
|
||||
*/
|
||||
|
||||
void find_end_for_box(float width, float height,
|
||||
float x1, float y1, // Centre of box (possibly)
|
||||
float x2, float y2, // other end of line
|
||||
float *x3, float *y3) // End on box edge
|
||||
{
|
||||
float xvec[5];
|
||||
float yvec[5];
|
||||
|
||||
xvec[0] = (float)(x1 - width/2.0);
|
||||
yvec[0] = (float)(y1 - height/2.0);
|
||||
xvec[1] = (float)(x1 - width/2.0);
|
||||
yvec[1] = (float)(y1 + height/2.0);
|
||||
xvec[2] = (float)(x1 + width/2.0);
|
||||
yvec[2] = (float)(y1 + height/2.0);
|
||||
xvec[3] = (float)(x1 + width/2.0);
|
||||
yvec[3] = (float)(y1 - height/2.0);
|
||||
xvec[4] = (float)(x1 - width/2.0);
|
||||
yvec[4] = (float)(y1 - height/2.0);
|
||||
|
||||
find_end_for_polyline(5, xvec, yvec, x2, y2, x1, y1, x3, y3);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find where the line hits the circle.
|
||||
*
|
||||
*/
|
||||
|
||||
void find_end_for_circle(float radius,
|
||||
float x1, float y1, // Centre of circle
|
||||
float x2, float y2, // Other end of line
|
||||
float *x3, float *y3)
|
||||
{
|
||||
float H = (float)sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
|
||||
|
||||
if (H == 0.0)
|
||||
{
|
||||
*x3 = x1;
|
||||
*y3 = y1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*y3 = radius * (y2 - y1)/H + y1;
|
||||
*x3 = radius * (x2 - x1)/H + x1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Given the line (x1, y1) -> (x2, y2), and an arrow size of given length and width,
|
||||
* return the position of the tip of the arrow and the left and right vertices of the arrow.
|
||||
*
|
||||
*/
|
||||
|
||||
void get_arrow_points(float x1, float y1, float x2, float y2,
|
||||
float length, float width,
|
||||
float *tip_x, float *tip_y,
|
||||
float *side1_x, float *side1_y,
|
||||
float *side2_x, float *side2_y)
|
||||
{
|
||||
float l = (float)sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
|
||||
|
||||
if (l < 0.01)
|
||||
l = (float) 0.01;
|
||||
|
||||
float i_bar = (x2 - x1)/l;
|
||||
float j_bar = (y2 - y1)/l;
|
||||
|
||||
float x3 = (- length*i_bar) + x2;
|
||||
float y3 = (- length*j_bar) + y2;
|
||||
|
||||
*side1_x = width*(-j_bar) + x3;
|
||||
*side1_y = width*i_bar + y3;
|
||||
|
||||
*side2_x = -width*(-j_bar) + x3;
|
||||
*side2_y = -width*i_bar + y3;
|
||||
|
||||
*tip_x = x2; *tip_y = y2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given an ellipse and endpoints of a line, returns the point at which
|
||||
* the line touches the ellipse in values x4, y4.
|
||||
* This function assumes that the centre of the ellipse is at x1, y1, and the
|
||||
* ellipse has a width of width1 and a height of height1. It also assumes you are
|
||||
* wanting to draw an arc FROM point x2, y2 TOWARDS point x3, y3.
|
||||
* This function calculates the x,y coordinates of the intersection point of
|
||||
* the arc with the ellipse.
|
||||
* Author: Ian Harrison
|
||||
*/
|
||||
|
||||
void draw_arc_to_ellipse(float x1, float y1, float width1, float height1, float x2, float y2, float x3, float y3,
|
||||
float *x4, float *y4)
|
||||
{
|
||||
float a1 = (float)(width1/2.0);
|
||||
float b1 = (float)(height1/2.0);
|
||||
|
||||
// These are required to give top left x and y coordinates for DrawEllipse
|
||||
// float top_left_x1 = (float)(x1 - a1);
|
||||
// float top_left_y1 = (float)(y1 - b1);
|
||||
/*
|
||||
// Check for vertical line
|
||||
if (fabs(x2 - x3) < 0.05)
|
||||
{
|
||||
*x4 = x3;
|
||||
if (y2 < y3)
|
||||
*y4 = (float)(y1 - b1);
|
||||
else
|
||||
*y4 = (float)(y1 + b1);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
// Check that x2 != x3
|
||||
if (fabs(x2 - x3) < 0.05)
|
||||
{
|
||||
*x4 = x2;
|
||||
if (y3 > y2)
|
||||
*y4 = (float)(y1 - sqrt((b1*b1 - (((x2-x1)*(x2-x1))*(b1*b1)/(a1*a1)))));
|
||||
else
|
||||
*y4 = (float)(y1 + sqrt((b1*b1 - (((x2-x1)*(x2-x1))*(b1*b1)/(a1*a1)))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate the x and y coordinates of the point where arc intersects ellipse
|
||||
|
||||
float A, B, C, D, E, F, G, H, K;
|
||||
float ellipse1_x, ellipse1_y;
|
||||
|
||||
A = (float)(1/(a1 * a1));
|
||||
B = (float)((y3 - y2) * (y3 - y2)) / ((x3 - x2) * (x3 - x2) * b1 * b1);
|
||||
C = (float)(2 * (y3 - y2) * (y2 - y1)) / ((x3 - x2) * b1 * b1);
|
||||
D = (float)((y2 - y1) * (y2 - y1)) / (b1 * b1);
|
||||
E = (float)(A + B);
|
||||
F = (float)(C - (2 * A * x1) - (2 * B * x2));
|
||||
G = (float)((A * x1 * x1) + (B * x2 * x2) - (C * x2) + D - 1);
|
||||
H = (float)((y3 - y2) / (x3 - x2));
|
||||
K = (float)((F * F) - (4 * E * G));
|
||||
|
||||
if (K >= 0)
|
||||
// In this case the line intersects the ellipse, so calculate intersection
|
||||
{
|
||||
if(x2 >= x1)
|
||||
{
|
||||
ellipse1_x = (float)(((F * -1) + sqrt(K)) / (2 * E));
|
||||
ellipse1_y = (float)((H * (ellipse1_x - x2)) + y2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ellipse1_x = (float)(((F * -1) - sqrt(K)) / (2 * E));
|
||||
ellipse1_y = (float)((H * (ellipse1_x - x2)) + y2);
|
||||
}
|
||||
}
|
||||
else
|
||||
// in this case, arc does not intersect ellipse, so just draw arc
|
||||
{
|
||||
ellipse1_x = x3;
|
||||
ellipse1_y = y3;
|
||||
}
|
||||
*x4 = ellipse1_x;
|
||||
*y4 = ellipse1_y;
|
||||
|
||||
/*
|
||||
// Draw a little circle (radius = 2) at the end of the arc where it hits
|
||||
// the ellipse .
|
||||
|
||||
float circle_x = ellipse1_x - 2.0;
|
||||
float circle_y = ellipse1_y - 2.0;
|
||||
m_canvas->DrawEllipse(circle_x, circle_y, 4.0, 4.0);
|
||||
*/
|
||||
}
|
||||
|
||||
// Update a list item from a list of strings
|
||||
void UpdateListBox(wxListBox *item, wxList *list)
|
||||
{
|
||||
item->Clear();
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
wxNode *node = list->First();
|
||||
while (node)
|
||||
{
|
||||
char *s = (char *)node->Data();
|
||||
item->Append(s);
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,107 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: misc.h
|
||||
// Purpose: Miscellaneous utilities for OGL
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_MISC_H_
|
||||
#define _OGL_MISC_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "misc.h"
|
||||
#endif
|
||||
|
||||
// List to use when copying objects; may need to associate elements of new objects
|
||||
// with elements of old objects, e.g. when copying constraint.s
|
||||
extern wxList wxObjectCopyMapping;
|
||||
|
||||
/*
|
||||
* TEXT FORMATTING FUNCTIONS
|
||||
*
|
||||
*/
|
||||
|
||||
// Centres the given list of wxShapeTextLine strings in the given box
|
||||
// (changing the positions in situ). Doesn't actually draw into the DC.
|
||||
void CentreText(wxDC& dc, wxList *text, float m_xpos, float m_ypos,
|
||||
float width, float height,
|
||||
int formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT);
|
||||
|
||||
// Given a string, returns a list of strings that fit within the given
|
||||
// width of box. Height is ignored.
|
||||
wxList *FormatText(wxDC& dc, const wxString& text, float width, float height, int formatMode = 0);
|
||||
|
||||
// Centres the list of wxShapeTextLine strings, doesn't clip.
|
||||
// Doesn't actually draw into the DC.
|
||||
void CentreTextNoClipping(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height);
|
||||
|
||||
// Gets the maximum width and height of the given list of wxShapeTextLines.
|
||||
void GetCentredTextExtent(wxDC& dc, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height,
|
||||
float *actual_width, float *actual_height);
|
||||
|
||||
// Actually draw the preformatted list of wxShapeTextLines.
|
||||
void DrawFormattedText(wxDC& context, wxList *text_list,
|
||||
float m_xpos, float m_ypos, float width, float height,
|
||||
int formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT);
|
||||
|
||||
// Give it a list of points, finds the centre.
|
||||
void find_polyline_centroid(wxList *points, float *x, float *y);
|
||||
|
||||
void check_line_intersection(float x1, float y1, float x2, float y2,
|
||||
float x3, float y3, float x4, float y4,
|
||||
float *ratio1, float *ratio2);
|
||||
|
||||
void find_end_for_polyline(float n, float xvec[], float yvec[],
|
||||
float x1, float y1, float x2, float y2, float *x3, float *y3);
|
||||
|
||||
|
||||
void find_end_for_box(float width, float height,
|
||||
float x1, float y1, // Centre of box (possibly)
|
||||
float x2, float y2, // other end of line
|
||||
float *x3, float *y3); // End on box edge
|
||||
|
||||
void find_end_for_circle(float radius,
|
||||
float x1, float y1, // Centre of circle
|
||||
float x2, float y2, // Other end of line
|
||||
float *x3, float *y3);
|
||||
|
||||
void get_arrow_points(float x1, float y1, float x2, float y2,
|
||||
float length, float width,
|
||||
float *tip_x, float *tip_y,
|
||||
float *side1_x, float *side1_y,
|
||||
float *side2_x, float *side2_y);
|
||||
|
||||
/*
|
||||
* Given an ellipse and endpoints of a line, returns the point at which
|
||||
* the line touches the ellipse in values x4, y4.
|
||||
* This function assumes that the centre of the ellipse is at x1, y1, and the
|
||||
* ellipse has a width of a1 and a height of b1. It also assumes you are
|
||||
* wanting to draw an arc FROM point x2, y2 TOWARDS point x3, y3.
|
||||
* This function calculates the x,y coordinates of the intersection point of
|
||||
* the arc with the ellipse.
|
||||
* Author: Ian Harrison
|
||||
*/
|
||||
|
||||
void draw_arc_to_ellipse(float x1, float y1, float a1, float b1, float x2, float y2, float x3, float y3,
|
||||
float *x4, float *y4);
|
||||
|
||||
extern wxFont *g_oglNormalFont;
|
||||
extern wxPen *black_pen;
|
||||
|
||||
extern wxPen *white_background_pen;
|
||||
extern wxPen *transparent_pen;
|
||||
extern wxBrush *white_background_brush;
|
||||
extern wxPen *black_foreground_pen;
|
||||
|
||||
extern wxCursor *GraphicsBullseyeCursor;
|
||||
|
||||
extern wxFont *MatchFont(int point_size);
|
||||
|
||||
#endif
|
||||
// _OGL_MISC_H_
|
@@ -1,26 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ogl.h
|
||||
// Purpose: OGL main include
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_OGL_H_
|
||||
#define _OGL_OGL_H_
|
||||
|
||||
#include "basic.h" // Basic shapes
|
||||
#include "lines.h" // Lines and splines
|
||||
#include "divided.h" // Vertically-divided rectangle
|
||||
#include "composit.h" // Composite images
|
||||
#include "canvas.h" // wxShapeCanvas for displaying objects
|
||||
#include "ogldiag.h" // wxDiagram
|
||||
|
||||
extern void wxOGLInitialize();
|
||||
extern void wxOGLCleanUp();
|
||||
|
||||
#endif
|
||||
// _OGL_OGL_H_
|
@@ -1,580 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ogldiag.cpp
|
||||
// Purpose: wxDiagram
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "ogldiag.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROLOGIO
|
||||
#include <wx/wxexpr.h>
|
||||
#endif
|
||||
|
||||
#if USE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include <fstream.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "basic.h"
|
||||
#include "basicp.h"
|
||||
#include "canvas.h"
|
||||
#include "ogldiag.h"
|
||||
#include "lines.h"
|
||||
#include "composit.h"
|
||||
#include "misc.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDiagram, wxObject)
|
||||
|
||||
// Object canvas
|
||||
wxDiagram::wxDiagram()
|
||||
{
|
||||
m_diagramCanvas = NULL;
|
||||
m_quickEditMode = FALSE;
|
||||
m_snapToGrid = TRUE;
|
||||
m_gridSpacing = 5.0;
|
||||
m_shapeList = new wxList;
|
||||
m_mouseTolerance = DEFAULT_MOUSE_TOLERANCE;
|
||||
}
|
||||
|
||||
wxDiagram::~wxDiagram()
|
||||
{
|
||||
if (m_shapeList)
|
||||
delete m_shapeList;
|
||||
}
|
||||
|
||||
void wxDiagram::SetSnapToGrid(bool snap)
|
||||
{
|
||||
m_snapToGrid = snap;
|
||||
}
|
||||
|
||||
void wxDiagram::SetGridSpacing(float spacing)
|
||||
{
|
||||
m_gridSpacing = spacing;
|
||||
}
|
||||
|
||||
void wxDiagram::Snap(float *x, float *y)
|
||||
{
|
||||
if (m_snapToGrid)
|
||||
{
|
||||
*x = m_gridSpacing * ((int)(*x/m_gridSpacing + 0.5));
|
||||
*y = m_gridSpacing * ((int)(*y/m_gridSpacing + 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxDiagram::Redraw(wxDC& dc)
|
||||
{
|
||||
if (m_shapeList)
|
||||
{
|
||||
if (GetCanvas())
|
||||
GetCanvas()->SetCursor(wxHOURGLASS_CURSOR);
|
||||
wxNode *current = m_shapeList->First();
|
||||
|
||||
while (current)
|
||||
{
|
||||
wxShape *object = (wxShape *)current->Data();
|
||||
if (!object->GetParent())
|
||||
object->Draw(dc);
|
||||
|
||||
current = current->Next();
|
||||
}
|
||||
if (GetCanvas())
|
||||
GetCanvas()->SetCursor(wxSTANDARD_CURSOR);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDiagram::Clear(wxDC& dc)
|
||||
{
|
||||
dc.Clear();
|
||||
}
|
||||
|
||||
// Insert object after addAfter, or at end of list.
|
||||
void wxDiagram::AddShape(wxShape *object, wxShape *addAfter)
|
||||
{
|
||||
wxNode *nodeAfter = NULL;
|
||||
if (addAfter)
|
||||
nodeAfter = m_shapeList->Member(addAfter);
|
||||
|
||||
if (!m_shapeList->Member(object))
|
||||
{
|
||||
if (nodeAfter)
|
||||
{
|
||||
if (nodeAfter->Next())
|
||||
m_shapeList->Insert(nodeAfter->Next(), object);
|
||||
else
|
||||
m_shapeList->Append(object);
|
||||
}
|
||||
else
|
||||
m_shapeList->Append(object);
|
||||
object->SetCanvas(GetCanvas());
|
||||
}
|
||||
}
|
||||
|
||||
void wxDiagram::InsertShape(wxShape *object)
|
||||
{
|
||||
m_shapeList->Insert(object);
|
||||
object->SetCanvas(GetCanvas());
|
||||
}
|
||||
|
||||
void wxDiagram::RemoveShape(wxShape *object)
|
||||
{
|
||||
m_shapeList->DeleteObject(object);
|
||||
}
|
||||
|
||||
// Should this delete the actual objects too? I think not.
|
||||
void wxDiagram::RemoveAllShapes()
|
||||
{
|
||||
m_shapeList->Clear();
|
||||
}
|
||||
|
||||
void wxDiagram::DeleteAllShapes()
|
||||
{
|
||||
wxNode *node = m_shapeList->First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *shape = (wxShape *)node->Data();
|
||||
if (!shape->GetParent())
|
||||
{
|
||||
RemoveShape(shape);
|
||||
delete shape;
|
||||
node = m_shapeList->First();
|
||||
}
|
||||
else
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
void wxDiagram::ShowAll(bool show)
|
||||
{
|
||||
wxNode *current = m_shapeList->First();
|
||||
|
||||
while (current)
|
||||
{
|
||||
wxShape *object = (wxShape *)current->Data();
|
||||
object->Show(show);
|
||||
|
||||
current = current->Next();
|
||||
}
|
||||
}
|
||||
|
||||
void wxDiagram::DrawOutline(wxDC& dc, float x1, float y1, float x2, float y2)
|
||||
{
|
||||
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
|
||||
dc.SetPen(dottedPen);
|
||||
dc.SetBrush((* wxTRANSPARENT_BRUSH));
|
||||
|
||||
wxPoint points[5];
|
||||
|
||||
points[0].x = x1;
|
||||
points[0].y = y1;
|
||||
|
||||
points[1].x = x2;
|
||||
points[1].y = y1;
|
||||
|
||||
points[2].x = x2;
|
||||
points[2].y = y2;
|
||||
|
||||
points[3].x = x1;
|
||||
points[3].y = y2;
|
||||
|
||||
points[4].x = x1;
|
||||
points[4].y = y1;
|
||||
dc.DrawLines(5, points);
|
||||
}
|
||||
|
||||
// Make sure all text that should be centred, is centred.
|
||||
void wxDiagram::RecentreAll(wxDC& dc)
|
||||
{
|
||||
wxNode *object_node = m_shapeList->First();
|
||||
while (object_node)
|
||||
{
|
||||
wxShape *obj = (wxShape *)object_node->Data();
|
||||
obj->Recentre(dc);
|
||||
object_node = object_node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
// Input/output
|
||||
#ifdef PROLOGIO
|
||||
bool wxDiagram::SaveFile(const wxString& filename)
|
||||
{
|
||||
wxBeginBusyCursor();
|
||||
|
||||
wxExprDatabase *database = new wxExprDatabase;
|
||||
|
||||
// First write the diagram type
|
||||
wxExpr *header = new wxExpr("diagram");
|
||||
OnHeaderSave(*database, *header);
|
||||
|
||||
database->Append(header);
|
||||
|
||||
wxNode *node = m_shapeList->First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *shape = (wxShape *)node->Data();
|
||||
|
||||
if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
|
||||
{
|
||||
wxExpr *expr = NULL;
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
expr = new wxExpr("line");
|
||||
else
|
||||
expr = new wxExpr("shape");
|
||||
|
||||
OnShapeSave(*database, *shape, *expr);
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
OnDatabaseSave(*database);
|
||||
|
||||
char tempFile[400];
|
||||
wxGetTempFileName("diag", tempFile);
|
||||
ofstream stream(tempFile);
|
||||
if (stream.bad())
|
||||
{
|
||||
wxEndBusyCursor();
|
||||
delete database;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
database->Write(stream);
|
||||
stream.close();
|
||||
delete database;
|
||||
|
||||
/*
|
||||
// Save backup
|
||||
if (FileExists(filename))
|
||||
{
|
||||
char buf[400];
|
||||
#ifdef __X__
|
||||
sprintf(buf, "%s.bak", filename);
|
||||
#endif
|
||||
#ifdef __WXMSW__
|
||||
sprintf(buf, "_diagram.bak");
|
||||
#endif
|
||||
if (FileExists(buf)) wxRemoveFile(buf);
|
||||
if (!wxRenameFile(filename, buf))
|
||||
{
|
||||
wxCopyFile(filename, buf);
|
||||
wxRemoveFile(filename);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Copy the temporary file to the correct filename
|
||||
if (!wxRenameFile(tempFile, filename))
|
||||
{
|
||||
wxCopyFile(tempFile, filename);
|
||||
wxRemoveFile(tempFile);
|
||||
}
|
||||
|
||||
wxEndBusyCursor();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::LoadFile(const wxString& filename)
|
||||
{
|
||||
wxBeginBusyCursor();
|
||||
|
||||
wxExprDatabase database(PrologInteger, "id");
|
||||
if (!database.Read(filename))
|
||||
{
|
||||
wxEndBusyCursor();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DeleteAllShapes();
|
||||
|
||||
database.BeginFind();
|
||||
wxExpr *header = database.FindClauseByFunctor("diagram");
|
||||
|
||||
if (header)
|
||||
OnHeaderLoad(database, *header);
|
||||
|
||||
// Scan through all clauses and register the ids
|
||||
wxNode *node = database.First();
|
||||
while (node)
|
||||
{
|
||||
wxExpr *clause = (wxExpr *)node->Data();
|
||||
long id = -1;
|
||||
clause->GetAttributeValue("id", id);
|
||||
RegisterId(id);
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
ReadNodes(database);
|
||||
ReadContainerGeometry(database);
|
||||
ReadLines(database);
|
||||
|
||||
OnDatabaseLoad(database);
|
||||
|
||||
wxEndBusyCursor();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxDiagram::ReadNodes(wxExprDatabase& database)
|
||||
{
|
||||
// Find and create the node images
|
||||
database.BeginFind();
|
||||
wxExpr *clause = database.FindClauseByFunctor("shape");
|
||||
while (clause)
|
||||
{
|
||||
char *type = NULL;
|
||||
long parentId = -1;
|
||||
|
||||
clause->AssignAttributeValue("type", &type);
|
||||
clause->AssignAttributeValue("parent", &parentId);
|
||||
wxClassInfo *classInfo = wxClassInfo::FindClass(type);
|
||||
if (classInfo)
|
||||
{
|
||||
wxShape *shape = (wxShape *)classInfo->CreateObject();
|
||||
OnShapeLoad(database, *shape, *clause);
|
||||
|
||||
shape->SetCanvas(GetCanvas());
|
||||
shape->Show(TRUE);
|
||||
|
||||
m_shapeList->Append(shape);
|
||||
|
||||
// If child of composite, link up
|
||||
if (parentId > -1)
|
||||
{
|
||||
wxExpr *parentExpr = database.HashFind("shape", parentId);
|
||||
if (parentExpr && parentExpr->GetClientData())
|
||||
{
|
||||
wxShape *parent = (wxShape *)parentExpr->GetClientData();
|
||||
shape->SetParent(parent);
|
||||
parent->GetChildren().Append(shape);
|
||||
}
|
||||
}
|
||||
|
||||
clause->SetClientData(shape);
|
||||
}
|
||||
if (type)
|
||||
delete[] type;
|
||||
|
||||
clause = database.FindClauseByFunctor("shape");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void wxDiagram::ReadLines(wxExprDatabase& database)
|
||||
{
|
||||
database.BeginFind();
|
||||
wxExpr *clause = database.FindClauseByFunctor("line");
|
||||
while (clause)
|
||||
{
|
||||
wxString type("");
|
||||
long parentId = -1;
|
||||
|
||||
clause->GetAttributeValue("type", type);
|
||||
clause->GetAttributeValue("parent", parentId);
|
||||
wxClassInfo *classInfo = wxClassInfo::FindClass((char*) (const char*) type);
|
||||
if (classInfo)
|
||||
{
|
||||
wxLineShape *shape = (wxLineShape *)classInfo->CreateObject();
|
||||
shape->Show(TRUE);
|
||||
|
||||
OnShapeLoad(database, *shape, *clause);
|
||||
|
||||
long image_to = -1; long image_from = -1;
|
||||
clause->GetAttributeValue("to", image_to);
|
||||
clause->GetAttributeValue("from", image_from);
|
||||
|
||||
wxExpr *image_to_expr = database.HashFind("shape", image_to);
|
||||
|
||||
if (!image_to_expr)
|
||||
{
|
||||
// Error
|
||||
}
|
||||
wxExpr *image_from_expr = database.HashFind("shape", image_from);
|
||||
|
||||
if (!image_from_expr)
|
||||
{
|
||||
// Error
|
||||
}
|
||||
|
||||
if (image_to_expr && image_from_expr)
|
||||
{
|
||||
wxShape *image_to_object = (wxShape *)image_to_expr->GetClientData();
|
||||
wxShape *image_from_object = (wxShape *)image_from_expr->GetClientData();
|
||||
|
||||
if (image_to_object && image_from_object)
|
||||
{
|
||||
image_from_object->AddLine(shape, image_to_object, shape->GetAttachmentFrom(), shape->GetAttachmentTo());
|
||||
}
|
||||
}
|
||||
clause->SetClientData(shape);
|
||||
|
||||
m_shapeList->Append(shape);
|
||||
}
|
||||
|
||||
clause = database.FindClauseByFunctor("line");
|
||||
}
|
||||
}
|
||||
|
||||
// Containers have divisions that reference adjoining divisions,
|
||||
// so we need a separate pass to link everything up.
|
||||
// Also used by Symbol Library.
|
||||
void wxDiagram::ReadContainerGeometry(wxExprDatabase& database)
|
||||
{
|
||||
database.BeginFind();
|
||||
wxExpr *clause = database.FindClauseByFunctor("shape");
|
||||
while (clause)
|
||||
{
|
||||
wxShape *image = (wxShape *)clause->GetClientData();
|
||||
if (image && image->IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
{
|
||||
wxCompositeShape *composite = (wxCompositeShape *)image;
|
||||
wxExpr *divisionExpr = NULL;
|
||||
|
||||
// Find the list of divisions in the composite
|
||||
clause->GetAttributeValue("divisions", &divisionExpr);
|
||||
if (divisionExpr)
|
||||
{
|
||||
int i = 0;
|
||||
wxExpr *idExpr = divisionExpr->Nth(i);
|
||||
while (idExpr)
|
||||
{
|
||||
long divisionId = idExpr->IntegerValue();
|
||||
wxExpr *childExpr = database.HashFind("shape", divisionId);
|
||||
if (childExpr && childExpr->GetClientData())
|
||||
{
|
||||
wxDivisionShape *child = (wxDivisionShape *)childExpr->GetClientData();
|
||||
composite->GetDivisions().Append(child);
|
||||
|
||||
// Find the adjoining shapes
|
||||
long leftSideId = -1;
|
||||
long topSideId = -1;
|
||||
long rightSideId = -1;
|
||||
long bottomSideId = -1;
|
||||
childExpr->GetAttributeValue("left_side", leftSideId);
|
||||
childExpr->GetAttributeValue("top_side", topSideId);
|
||||
childExpr->GetAttributeValue("right_side", rightSideId);
|
||||
childExpr->GetAttributeValue("bottom_side", bottomSideId);
|
||||
if (leftSideId > -1)
|
||||
{
|
||||
wxExpr *leftExpr = database.HashFind("shape", leftSideId);
|
||||
if (leftExpr && leftExpr->GetClientData())
|
||||
{
|
||||
wxDivisionShape *leftSide = (wxDivisionShape *)leftExpr->GetClientData();
|
||||
child->SetLeftSide(leftSide);
|
||||
}
|
||||
}
|
||||
if (topSideId > -1)
|
||||
{
|
||||
wxExpr *topExpr = database.HashFind("shape", topSideId);
|
||||
if (topExpr && topExpr->GetClientData())
|
||||
{
|
||||
wxDivisionShape *topSide = (wxDivisionShape *)topExpr->GetClientData();
|
||||
child->SetTopSide(topSide);
|
||||
}
|
||||
}
|
||||
if (rightSideId > -1)
|
||||
{
|
||||
wxExpr *rightExpr = database.HashFind("shape", rightSideId);
|
||||
if (rightExpr && rightExpr->GetClientData())
|
||||
{
|
||||
wxDivisionShape *rightSide = (wxDivisionShape *)rightExpr->GetClientData();
|
||||
child->SetRightSide(rightSide);
|
||||
}
|
||||
}
|
||||
if (bottomSideId > -1)
|
||||
{
|
||||
wxExpr *bottomExpr = database.HashFind("shape", bottomSideId);
|
||||
if (bottomExpr && bottomExpr->GetClientData())
|
||||
{
|
||||
wxDivisionShape *bottomSide = (wxDivisionShape *)bottomExpr->GetClientData();
|
||||
child->SetBottomSide(bottomSide);
|
||||
}
|
||||
}
|
||||
}
|
||||
i ++;
|
||||
idExpr = divisionExpr->Nth(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clause = database.FindClauseByFunctor("shape");
|
||||
}
|
||||
}
|
||||
|
||||
// Allow for modifying file
|
||||
bool wxDiagram::OnDatabaseLoad(wxExprDatabase& db)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnDatabaseSave(wxExprDatabase& db)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
shape.WritePrologAttributes(&expr);
|
||||
db.Append(&expr);
|
||||
|
||||
if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
{
|
||||
wxNode *node = shape.GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxShape *childShape = (wxShape *)node->Data();
|
||||
wxExpr *childExpr = new wxExpr("shape");
|
||||
OnShapeSave(db, *childShape, *childExpr);
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
shape.ReadPrologAttributes(&expr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnHeaderSave(wxExprDatabase& db, wxExpr& expr)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnHeaderLoad(wxExprDatabase& db, wxExpr& expr)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void wxDiagram::SetCanvas(wxShapeCanvas *can)
|
||||
{
|
||||
m_diagramCanvas = can;
|
||||
}
|
||||
|
||||
|
@@ -1,94 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: ogldiag.h
|
||||
// Purpose: OGL - wxDiagram class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _OGL_OGLDIAG_H_
|
||||
#define _OGL_OGLDIAG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "ogldiag.h"
|
||||
#endif
|
||||
|
||||
#include "basic.h"
|
||||
|
||||
class wxDiagram: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDiagram)
|
||||
|
||||
public:
|
||||
|
||||
wxDiagram();
|
||||
virtual ~wxDiagram();
|
||||
|
||||
void SetCanvas(wxShapeCanvas *can);
|
||||
|
||||
inline wxShapeCanvas *GetCanvas() const { return m_diagramCanvas; }
|
||||
|
||||
virtual void Redraw(wxDC& dc);
|
||||
virtual void Clear(wxDC& dc);
|
||||
virtual void DrawOutline(wxDC& dc, float x1, float y1, float x2, float y2);
|
||||
|
||||
// Add object to end of object list (if addAfter is NULL)
|
||||
// or just after addAfter.
|
||||
virtual void AddShape(wxShape *object, wxShape *addAfter = NULL);
|
||||
|
||||
// Add object to front of object list
|
||||
virtual void InsertShape(wxShape *object);
|
||||
|
||||
void SetSnapToGrid(bool snap);
|
||||
void SetGridSpacing(float spacing);
|
||||
inline float GetGridSpacing() { return m_gridSpacing; }
|
||||
inline bool GetSnapToGrid() const { return m_snapToGrid; }
|
||||
void Snap(float *x, float *y);
|
||||
|
||||
inline void SetQuickEditMode(bool qem) { m_quickEditMode = qem; }
|
||||
inline bool GetQuickEditMode() const { return m_quickEditMode; }
|
||||
|
||||
virtual void RemoveShape(wxShape *object);
|
||||
virtual void RemoveAllShapes();
|
||||
virtual void DeleteAllShapes();
|
||||
virtual void ShowAll(bool show);
|
||||
|
||||
inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; }
|
||||
inline int GetMouseTolerance() const { return m_mouseTolerance; }
|
||||
inline wxList *GetShapeList() const { return m_shapeList; }
|
||||
|
||||
// Make sure all text that should be centred, is centred.
|
||||
void RecentreAll(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
virtual bool SaveFile(const wxString& filename);
|
||||
virtual bool LoadFile(const wxString& filename);
|
||||
|
||||
virtual void ReadNodes(wxExprDatabase& database);
|
||||
virtual void ReadLines(wxExprDatabase& database);
|
||||
virtual void ReadContainerGeometry(wxExprDatabase& database);
|
||||
|
||||
// Allow for modifying file
|
||||
virtual bool OnDatabaseLoad(wxExprDatabase& db);
|
||||
virtual bool OnDatabaseSave(wxExprDatabase& db);
|
||||
virtual bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
|
||||
virtual bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
|
||||
virtual bool OnHeaderSave(wxExprDatabase& db, wxExpr& expr);
|
||||
virtual bool OnHeaderLoad(wxExprDatabase& db, wxExpr& expr);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
wxShapeCanvas* m_diagramCanvas;
|
||||
bool m_quickEditMode;
|
||||
bool m_snapToGrid;
|
||||
float m_gridSpacing;
|
||||
int m_mouseTolerance;
|
||||
wxList* m_shapeList;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _OGL_OGLDIAG_H_
|
Before Width: | Height: | Size: 225 B |
@@ -1,106 +0,0 @@
|
||||
\chapter{Introduction}\label{introduction}
|
||||
\pagenumbering{arabic}%
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
|
||||
The Property Sheet Classes help the programmer to specify complex dialogs and
|
||||
their relationship with their associated data. By specifying data as a
|
||||
wxPropertySheet containing wxProperty objects, the programmer can use
|
||||
a range of available or custom wxPropertyView classes to allow the user to
|
||||
edit this data. Classes derived from wxPropertyView act as mediators between the
|
||||
wxPropertySheet and the actual window (and associated panel items).
|
||||
|
||||
For example, the wxPropertyListView is a kind of wxPropertyView which displays
|
||||
data in a Visual Basic-style property list (see \helpref{the next section}{appearance} for
|
||||
screen shots). This is a listbox containing names and values, with
|
||||
an edit control and other optional controls via which the user edits the selected
|
||||
data item.
|
||||
|
||||
wxPropertyFormView is another kind of wxPropertyView which mediates between
|
||||
the data and a panel or dialog box which has already been created. This makes it a contender for
|
||||
the replacement of wxForm, since programmer-controlled layout is going to be much more
|
||||
satisfactory. If automatic layout is desired, then wxPropertyListView could be used instead.
|
||||
|
||||
The main intention of this class library was to provide property {\it list} behaviour, but
|
||||
it has been generalised as much as possible so that the concept of a property sheet and its viewers
|
||||
can reduce programming effort in a range of user interface tasks.
|
||||
|
||||
For further details on the classes and how they are used, please see \helpref{Property classes overview}{propertyoverview}.
|
||||
|
||||
\section{The appearance and behaviour of a property list view}\label{appearance}
|
||||
|
||||
The property list, as seen in an increasing number of development tools
|
||||
such as Visual Basic and Delphi, is a convenient and compact method for
|
||||
displaying and editing a number of items without the need for one
|
||||
control per item, and without the need for designing a special form. The
|
||||
controls are as follows:
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item A listbox showing the properties and their current values, which has double-click
|
||||
properties dependent on the nature of the current property;
|
||||
\item a text editing area at the top of the display, allowing the user to edit
|
||||
the currently selected property if appropriate;
|
||||
\item `confirm' and `cancel' buttons to confirm or cancel an edit (for the property, not the
|
||||
whole sheet);
|
||||
\item an optional list that appears when the user can make a choice from several known possible values;
|
||||
\item a small Edit button to invoke `detailed editing' (perhaps showing or hiding the above value list, or
|
||||
maybe invoking a common dialog);
|
||||
\item optional OK/Close, Cancel and Help buttons for the whole dialog.
|
||||
\end{itemize}
|
||||
|
||||
The concept of `detailed editing' versus quick editing gives the user a choice
|
||||
of editing mode, so novice and expert behaviour can be catered for, or the user can just
|
||||
use what he feels comfortable with.
|
||||
|
||||
Behaviour alters depending on the kind of property being edited. For example, a boolean value has
|
||||
the following behaviour:
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item Double-clicking on the item toggles between TRUE and FALSE.
|
||||
\item Showing the value list enables the user to select TRUE or FALSE.
|
||||
\item The user may be able to type in the word TRUE or FALSE, or the edit control
|
||||
may be read-only to disallow this since it is error-prone.
|
||||
\end{itemize}
|
||||
|
||||
A list of strings may pop up a dialog for editing them, a simple string just allows text editing,
|
||||
double-clicking a colour property may show a colour selector, double-clicking on a filename property may
|
||||
show a file selector (in addition to being able to type in the name in the edit control), etc.
|
||||
|
||||
Note that the `type' of property, such as string or integer, does not
|
||||
necessarily determine the behaviour of the property. The programmer has
|
||||
to be able to specify different behaviours for the same type, depending
|
||||
on the meaning of the property. For example, a colour and a filename may
|
||||
both be strings, but their editing behaviour should be different. This
|
||||
is why objects of type wxPropertyValidator need to be used, to define
|
||||
behaviour for a given class of properties or even specific property
|
||||
name. Objects of class wxPropertyView contain a list of property
|
||||
registries, which enable reuse of bunches of these validators in
|
||||
different circumstances. Or a wxProperty can be explicitly set to use a
|
||||
particular validator object.
|
||||
|
||||
The following screen shot of the property classes test program shows the
|
||||
user editing a string, which is constrained to be one of three possible
|
||||
values.
|
||||
|
||||
$$\image{8cm;0cm}{prop1.eps}$$\\
|
||||
|
||||
The second picture shows the user having entered a integer that
|
||||
was outside the range specified to the validator. Note that in this picture,
|
||||
the value list is hidden because it is not used when editing an integer.
|
||||
|
||||
$$\image{8cm;0cm}{prop2.eps}$$
|
||||
|
||||
\chapter{Files}\label{files}
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
|
||||
The property class library comprises the following files:
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item wx\_prop.h: base property class header
|
||||
\item wx\_plist.h: wxPropertyListView and associated classes
|
||||
\item wx\_pform.h: wxPropertyListView and associated classes
|
||||
\item wx\_prop.cc: base property class implementation
|
||||
\item wx\_plist.cc: wxPropertyListView and associated class implementions
|
||||
\item wx\_pform.cc: wxPropertyFormView and associated class implementions
|
||||
\end{itemize}
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 138 B |
@@ -1,22 +0,0 @@
|
||||
\chapter{Change log}\label{changes}
|
||||
\pagenumbering{arabic}%
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
|
||||
November 26th 1995, Version 1.1
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item Added wxListOfStringsListValidator - allows adding, deleting, editing
|
||||
strings.
|
||||
\item Added wxPropertyValue::ClearList, wxPropertyValue::Delete,
|
||||
wxPropertyValue::wxPropertyValue(wxStringList *).
|
||||
\item Added wxPropertyValue::Set/GetModified, wxPropertySheet::SetAllModified.
|
||||
\item Added wxPropertyView::OnPropertyChanged support, for immediate feedback.
|
||||
\end{itemize}
|
||||
|
||||
October 1995, Version 1.0
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item First release.
|
||||
\end{itemize}
|
||||
|
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 164 B |
@@ -1,17 +0,0 @@
|
||||
[OPTIONS]
|
||||
BMROOT=c:\wx\utils\wxprop\docs ; Assume that bitmaps are where the source is
|
||||
TITLE=Property Classes Manual
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
||||
[FILES]
|
||||
Prop.rtf
|
||||
|
||||
[CONFIG]
|
||||
CreateButton("Up", "&Up", "JumpId(`Prop.hlp', `Contents')")
|
||||
BrowseButtons()
|
||||
|
||||
[MAP]
|
||||
|
||||
[BITMAPS]
|
||||
|
@@ -1,55 +0,0 @@
|
||||
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}
|
||||
\input psbox.tex
|
||||
% Remove this for processing with dvi2ps instead of dvips
|
||||
%\special{!/@scaleunit 1 def}
|
||||
\parskip=10pt
|
||||
\parindent=0pt
|
||||
\title{User Manual for wxWindows Property Sheet Classes Version 2.0}
|
||||
\winhelponly{\author{by Julian Smart, Anthemion Software\\$$\image{}{prop1}$$}}
|
||||
\winhelpignore{\author{Julian Smart, Anthemion Software}
|
||||
\date{October 1997}
|
||||
}
|
||||
\makeindex
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\pagestyle{fancyplain}
|
||||
\bibliographystyle{plain}
|
||||
\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
|
||||
\chapter*{Copyright notice}
|
||||
\setheader{{\it COPYRIGHT}}{}{}{}{}{{\it COPYRIGHT}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
|
||||
\begin{center}
|
||||
Copyright (c) 1997 Julian Smart, Anthemion Software
|
||||
\end{center}
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that the
|
||||
above copyright notice, author statement and this permission notice appear in
|
||||
all copies of this software and related documentation.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS-IS'' AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
|
||||
IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
IN NO EVENT SHALL JULIAN SMART OR ANTHEMION SOFTWARE BE LIABLE FOR ANY SPECIAL,
|
||||
INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED
|
||||
OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
\input{body.tex}
|
||||
\input{classes.tex}
|
||||
\input{changes.tex}
|
||||
|
||||
\newpage
|
||||
|
||||
\addcontentsline{toc}{chapter}{Index}
|
||||
\setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
\printindex
|
||||
\end{document}
|
Before Width: | Height: | Size: 29 KiB |
@@ -1,539 +0,0 @@
|
||||
%!PS-Adobe-2.0 EPSF-2.0
|
||||
%%Title: prop1.eps
|
||||
%%Creator: XV Version 2.20 Rev: 4/24/92 - by John Bradley
|
||||
%%BoundingBox: 167 292 445 500
|
||||
%%Pages: 1
|
||||
%%DocumentFonts:
|
||||
%%EndComments
|
||||
%%EndProlog
|
||||
|
||||
%%Page: 1 1
|
||||
|
||||
% remember original state
|
||||
/origstate save def
|
||||
|
||||
% build a temporary dictionary
|
||||
20 dict begin
|
||||
|
||||
% lower left corner
|
||||
167 292 translate
|
||||
|
||||
% size of image (on paper, in 1/72inch coords)
|
||||
278 208 scale
|
||||
|
||||
% define 'colorimage' if it isn't defined
|
||||
% ('colortogray' and 'mergeprocs' come from xwd2ps
|
||||
% via xgrab)
|
||||
/colorimage where % do we know about 'colorimage'?
|
||||
{ pop } % yes: pop off the 'dict' returned
|
||||
{ % no: define one
|
||||
/colortogray { % define an RGB->I function
|
||||
/rgbdata exch store % call input 'rgbdata'
|
||||
rgbdata length 3 idiv
|
||||
/npixls exch store
|
||||
/rgbindx 0 store
|
||||
/grays npixls string store % str to hold the result
|
||||
0 1 npixls 1 sub {
|
||||
grays exch
|
||||
rgbdata rgbindx get 20 mul % Red
|
||||
rgbdata rgbindx 1 add get 32 mul % Green
|
||||
rgbdata rgbindx 2 add get 12 mul % Blue
|
||||
add add 64 idiv % I = .5G + .31R + .18B
|
||||
put
|
||||
/rgbindx rgbindx 3 add store
|
||||
} for
|
||||
grays
|
||||
} bind def
|
||||
|
||||
% Utility procedure for colorimage operator.
|
||||
% This procedure takes two procedures off the
|
||||
% stack and merges them into a single procedure.
|
||||
|
||||
/mergeprocs { % def
|
||||
dup length
|
||||
3 -1 roll
|
||||
dup
|
||||
length
|
||||
dup
|
||||
5 1 roll
|
||||
3 -1 roll
|
||||
add
|
||||
array cvx
|
||||
dup
|
||||
3 -1 roll
|
||||
0 exch
|
||||
putinterval
|
||||
dup
|
||||
4 2 roll
|
||||
putinterval
|
||||
} bind def
|
||||
|
||||
/colorimage { % def
|
||||
pop pop % remove 'false 3' operands
|
||||
{colortogray} mergeprocs
|
||||
image
|
||||
} bind def
|
||||
} ifelse % end of 'false' case
|
||||
|
||||
|
||||
|
||||
% define the colormap
|
||||
/cmap 42 string def
|
||||
|
||||
|
||||
% load up the colormap
|
||||
currentfile cmap readhexstring
|
||||
000000 bf0000 00bf00 bfbf00 0000bf 00bfbf c0c0c0 808080 ff0000 00ff00
|
||||
ffff00 0000ff 00ffff ffffff
|
||||
pop pop % lose return values from readhexstring
|
||||
|
||||
|
||||
% rlecmapimage expects to have 'w h bits matrix' on stack
|
||||
/rlecmapimage {
|
||||
/buffer 1 string def
|
||||
/rgbval 3 string def
|
||||
/block 384 string def
|
||||
|
||||
% proc to read a block from file, and return RGB data
|
||||
{ currentfile buffer readhexstring pop
|
||||
/bcount exch 0 get store
|
||||
bcount 128 ge
|
||||
{ % it's a non-run block
|
||||
0 1 bcount 128 sub
|
||||
{ currentfile buffer readhexstring pop pop
|
||||
|
||||
% look up value in color map
|
||||
/rgbval cmap buffer 0 get 3 mul 3 getinterval store
|
||||
|
||||
% and put it in position i*3 in block
|
||||
block exch 3 mul rgbval putinterval
|
||||
} for
|
||||
block 0 bcount 127 sub 3 mul getinterval
|
||||
}
|
||||
|
||||
{ % else it's a run block
|
||||
currentfile buffer readhexstring pop pop
|
||||
|
||||
% look up value in colormap
|
||||
/rgbval cmap buffer 0 get 3 mul 3 getinterval store
|
||||
|
||||
0 1 bcount { block exch 3 mul rgbval putinterval } for
|
||||
|
||||
block 0 bcount 1 add 3 mul getinterval
|
||||
} ifelse
|
||||
} % end of proc
|
||||
false 3 colorimage
|
||||
} bind def
|
||||
|
||||
|
||||
278 208 8 % dimensions of data
|
||||
[278 0 0 -208 0 208] % mapping matrix
|
||||
rlecmapimage
|
||||
|
||||
7f067f0614060000
|
||||
81060d7f0d7f0d110d810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d068106047f047f040c040106810700
|
||||
82060d068106048204060d820d060783070d0702010203098102047f047a040106810700
|
||||
|
||||
82060d068106048704060b060001020781070283020702098109028102047f0446040e0d
|
||||
81000d0d0d81000481040d0d0d81000481040682060700
|
||||
82060d0681060482040806810600820002078507020902070201028109047f044604810d
|
||||
060b068307000d060b068207000482040d060b068207000481040682060700
|
||||
82060d0681060481040685060800040307820702098409020702098109040104050d2d04
|
||||
030d0204010d1a04050d6604810d060b068307000d06810600070001068207000482040d
|
||||
060b068207000481040682060700
|
||||
82060d068106048704060b0604000a0789070209020702070209040104010d0204010d1d
|
||||
04010d0b04010d0104010d0104010d1204010d0704010d1004010d5504810d060b068307
|
||||
000d06810600070001068207000482040d06010601000306010001068207000481040682
|
||||
060700
|
||||
82060d068106048204070681060001000107010286070209020702040104010d0204010d
|
||||
1d04010d0b04010d0504010d1204010d0704010d1004010d5504810d060b068307000d06
|
||||
820600060506810006830607000482040d06020601000106010002068207000481040682
|
||||
060700
|
||||
82060d0681060485040d0607060d010d8407020002090109820200040104010d0204010d
|
||||
81040d010d0104030d0104040d0204030d0104020d81040d010d81040d820d040d810d04
|
||||
0304010d0504040d0204030d0204030d0104020d0604010d0404030d0204020d0104020d
|
||||
5404810d060b068307000d06820600060506810006830607000482040d06030603000306
|
||||
8207000481040682060700
|
||||
82060d068106048104070507010006020204050d0104010d0104010d0104010d81040d81
|
||||
0d0481040d820d040d810d0481040d820d040d810d0481040d810d0481040d820d040d81
|
||||
0d040404030d0204020d81040d820d040d810d0481040d820d040d810d0481040d820d04
|
||||
0d810d040604010d0304010d0104010d81040d820d040d820d040d810d045404810d060b
|
||||
068307000d06820600060506810006830607000482040d06040601000406820700048104
|
||||
0682060700
|
||||
82060d068106048104050505010006030204010d0504010d0104010d0104010d81040d81
|
||||
0d0481040d820d040d040d81040d810d0481040d810d0481040d820d040d810d04070401
|
||||
0d0104010d0104010d81040d040d81040d040d81040d810d040604010d0304050d010401
|
||||
0d0204010d5504810d060b068307000d06820600060506810006830607000482040d0603
|
||||
06030003068207000481040682060700
|
||||
82060d0681060481040c010c8205080c830c05030a020a81030a810a040104010d050401
|
||||
0d0104010d0104010d81040d810d0481040d820d040d810d040304010d0104010d010401
|
||||
0d81040d810d040704010d0104010d0104010d81040d810d040304010d0404010d070401
|
||||
0d0304010d0604010d0104010d5504810d060b068307000d068206000605068100068306
|
||||
07000482040d06020601000106010002068207000481040682060700
|
||||
82060d068106048c040c05070507050c05030a030a840a03000a040104010d0504010d01
|
||||
04010d0104010d81040d810d0481040d820d040d810d0481040d820d040d810d0481040d
|
||||
810d040104020d0504010d0104010d0104010d0104010d81040d810d0481040d820d040d
|
||||
810d0481040d820d040d810d040604010d0304010d0104010d81040d820d040d820d040d
|
||||
810d045404810d060106050003068307000d06820600060506810006830607000482040d
|
||||
06010601000306010001068207000481040682060700
|
||||
82060d0681060482040c08020886070c05030a030a010a82030a040104010d0504010d02
|
||||
04030d0104040d0204030d0104010d0204010d0104010d0704030d0204010d0104010d01
|
||||
04030d0204030d0204010d0604010d0404030d0204020d0204010d5404810d0601060500
|
||||
03068307000d06810600070001068207000482040d060b068207000481040682060700
|
||||
82060d0681060482040c080208010c8205030a810a0384030a030a041404010d1404010d
|
||||
7f041804810d060b068307000d060b068207000482040d060b0682070004810406820607
|
||||
00
|
||||
82060d0681060482040c080308850c05030a030a010a82000a041404010d1204020d7f04
|
||||
1904810d070c0782000d070c0781000482040d070c0781000481040682060700
|
||||
82060d0681060483040c05080208850c05030a030a810a0382030a047f0446041f000104
|
||||
0f0001040106810700
|
||||
82060d0681060481040c050c8205030a050a7f047b040106810700
|
||||
82060d068106047f047f040c040106810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d0637067f073907810d061c06810700
|
||||
82060d06030616000306160001068107007f00360082060d0681060015000406810700
|
||||
82060d06020681000d140d820700068206000d140d8507000607000d7f0d350d84060d06
|
||||
000d140d820700060206810700
|
||||
82060d06020682000d06120601078100068306000d061206010784000607000d7f0d350d
|
||||
84060d06000d130d01078100060206810700
|
||||
82060d06020682000d06120601078100068306000d061206010784000607000d7f0d350d
|
||||
84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06120601078100068306000d061206010784000607000d7f0d350d
|
||||
84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d0603068100060606810006030601078100068306000d0612060107
|
||||
84000607000d820d000d7f0d320d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06030683000600060306810006040601078100068306000d061206
|
||||
010785000607000d0081000d7f0d320d84060d06000d810d061106010781000602068107
|
||||
00
|
||||
82060d06020682000d06040683000600060106810006050601078100068306000d060b06
|
||||
8100060406010785000607000d000100810d0081000d820d000d810d0081000d810d0002
|
||||
007f0d220d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06050685000600060006060601078100068306000d060a06830006
|
||||
00060306010785000607000d0081000d810d0082000d000100810d0082000d0081000d81
|
||||
0d0081000d7f0d200d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d0606068300060006070601078100068306000d0609068300060006
|
||||
0406010785000607000d0081000d810d0082000d000100810d0082000d0081000d810d00
|
||||
81000d7f0d200d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d0607068300060006060601078100068306000d0604068100060106
|
||||
83000600060506010785000607000d0081000d010d0200810d000100010d0100010d0100
|
||||
7f0d210d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06060685000600060006050601078100068306000d060306870006
|
||||
0006000600060606010785000607000d0081000d010d0200810d000100010d0100010d01
|
||||
007f0d210d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06050681000601068300060006040601078100068306000d060406
|
||||
850006000600060706010784000607000d810d0081000d810d0081000d010d0100020d03
|
||||
007f0d220d84060d06000d810d0603060100810600820006008100060406010781000602
|
||||
06810700
|
||||
82060d06020682000d06040681000603068300060006030601078100068306000d060506
|
||||
83000600060806010784000607000d7f0d350d84060d06000d810d060306010081060082
|
||||
000600810006040601078100060206810700
|
||||
82060d06020682000d060306010005060100040601078100068306000d06060681000609
|
||||
06010784000607000d7f0d350d84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06120601078100068306000d061206010784000607000d7f0d350d
|
||||
84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d06120601078100068306000d061206010784000607000d7f0d350d
|
||||
84060d06000d810d06110601078100060206810700
|
||||
82060d06020682000d0714078100068306000d07140784000607000d7f0d350d85060d06
|
||||
000d0714078100060206810700
|
||||
82060d06020682000d0714078100068306000d07140784000607000d7f0d350d84060d06
|
||||
000715078100060206810700
|
||||
82060d06030616000306160001068207000d7f0d350d82060d0681060015000406810700
|
||||
|
||||
82060d0637068107067f063706810d061c06810700
|
||||
82060d0637067f0d3a0d1d06810700
|
||||
82060d0601067f077f070a07810d060106810700
|
||||
82060d0601068107007f007f00070082060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d010d0300010d0400020d03007f0d720d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0082000d0081000d810d0082000d0081000d
|
||||
810d0081000d7f0d700d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0082000d0081000d810d0082000d0004007f
|
||||
0d710d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0082000d0081000d810d0082000d0081000d
|
||||
7f0d740d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0082000d0081000d810d0082000d0081000d
|
||||
810d0081000d7f0d700d82060d060106810700
|
||||
82060d0601068207000d010d0300010d0100010d0100010d03007f0d720d82060d060106
|
||||
810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d060106ff0700040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040aff040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a8c040a040a040a040a040a060d060106810700
|
||||
82060d0601068307000a047f047f04050482060d060106810700
|
||||
82060d060106820700047f047f040504830a060d060106810700
|
||||
82060d0601068307000a0482040d047f047f04020482060d060106810700
|
||||
82060d0601068207000481040d810d047f047f040104830a060d060106810700
|
||||
82060d0601068307000a0d020d81040d810d0482040d0481040d810d0481040d020d7f04
|
||||
720482060d060106810700
|
||||
82060d0601068207000481040d810d0481040d820d040d010d81040d820d040d810d0481
|
||||
040d810d047f046f04830a060d060106810700
|
||||
82060d0601068407000a040d810d0481040d820d040d010d81040d820d040d810d048104
|
||||
0d810d047f04700482060d060106810700
|
||||
82060d0601068207000481040d810d040104020d81040d010d0104010d0104010d7f0470
|
||||
04830a060d060106810700
|
||||
82060d0601068407000a040d810d040104020d81040d010d0104010d0104010d7f047104
|
||||
82060d060106810700
|
||||
82060d060106820700040104010d0104010d0204010d0204030d7f047104830a060d0601
|
||||
06810700
|
||||
82060d0601068307000a047f047f04050482060d060106810700
|
||||
82060d060106820700047f047f040504830a060d060106810700
|
||||
82060d060106ff07000a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a
|
||||
040a040a040a040a040a040a040a040a040a040a040a040a040a04ff0a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a040a04
|
||||
0a040a040a040a040a040a048c0a040a040a040a040a04060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d010d81000d810d0081000d7f0d7e0d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0081000d7f0d7e0d82060d060106810700
|
||||
82060d0601068307000d000200810d000300010d0300010d0300020d03007f0d690d8206
|
||||
0d060106810700
|
||||
82060d0601068207000d810d0081000d810d0081000d810d0082000d0081000d010d0100
|
||||
010d0100810d0081000d810d0081000d7f0d670d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0081000d810d0082000d0081000d010d0500
|
||||
810d0004007f0d680d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0081000d810d0082000d0081000d010d0100
|
||||
040d01007f0d6c0d82060d060106810700
|
||||
82060d0601068207000d810d0081000d810d0081000d810d0082000d0081000d010d0100
|
||||
010d0100810d0081000d810d0081000d7f0d670d82060d060106810700
|
||||
82060d0601068207000d010d0100810d0081000d810d0082000d0081000d020d0300020d
|
||||
03007f0d690d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068207000d7f0d7f0d060d82060d060106810700
|
||||
82060d0601068107067f067f060806810d060106810700
|
||||
82060d0601067f0d7f0d0b0d0206810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d0601067f077f070b070206810700
|
||||
82060d0601068107007f007f000800810d060106810700
|
||||
82060d0601068207000d7f0d760d0e060100810d060106810700
|
||||
82060d0601068207000d7f0d760d81060d0b0d81070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d1c0d0100120d01000e0d81000d6b0d0400400d82060d060a0681
|
||||
070082000d060106810700
|
||||
82060d0601068207000d010d81000d190d81000d120d81000d7b0d85000d000d000d3f0d
|
||||
82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d810d000300030d0200010d0100010d0100020d0100810d008400
|
||||
0d000d0081000d090d0300010d82000d0081000d020d0200020d0200040d0300020d0200
|
||||
5f0d81000d020d0100810d0082000d0081000d810d0081000d010d02002c0d82060d0603
|
||||
06810006040681070082000d060106810700
|
||||
82060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d820d
|
||||
000d810d0081000d810d0081000d820d000d070d81000d010d81000d810d0081000d820d
|
||||
000d820d000d010d81000d020d81000d020d81000d010d81000d820d000d010d81000d5d
|
||||
0d81000d030d0100030d81000d010d81000d820d000d010d81000d2a0d82060d06020602
|
||||
00040681070082000d060106810700
|
||||
82060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d820d
|
||||
000d010d81000d820d000d010d81000d070d81000d040d81000d010d81000d820d000d01
|
||||
0d81000d020d81000d020d81000d040d04005e0d81000d030d81000d030d81000d010d81
|
||||
000d810d0003002b0d82060d0601060400030681070082000d060106810700
|
||||
82060d0601068207000d010d81000d010d81000d820d000d010d81000d820d000d810d00
|
||||
81000d820d000d010d81000d820d000d010d81000d070d81000d040d81000d010d81000d
|
||||
820d000d010d81000d020d81000d020d81000d040d81000d610d81000d030d81000d030d
|
||||
81000d810d0081000d820d000d2e0d82060d068106000500020681070082000d06010681
|
||||
0700
|
||||
82060d0601068207000d020d0200030d0200030d0100810d0081000d810d000200810d00
|
||||
0100810d000100080d0300810d000100810d000100010d0200020d0400020d0300020d03
|
||||
005d0d0200020d0300030d0100810d0081000d810d0002002b0d82060d060a0681070082
|
||||
000d060106810700
|
||||
82060d0601068207000d1a0d81000d7f0d590d82060d060a0681070082000d0601068107
|
||||
00
|
||||
82060d0601068207000d170d02007f0d5b0d82060d060a0681070082000d060106810700
|
||||
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d8106070c070100810d060106810700
|
||||
82060d0601068207000d7f0d760d1000810d060106810700
|
||||
82060d0601068207000d7f0d760d92060d060d060d060d060d060d060d060d000d060106
|
||||
810700
|
||||
82060d0601068207000d7f0d770d91060d060d060d060d060d060d060d06000d06010681
|
||||
0700
|
||||
82060d0601068207000d030d81000d7f0d2d0d81000d020d0300390d92060d060d060d06
|
||||
0d060d060d060d060d000d060106810700
|
||||
82060d0601068207000d7f0d320d0100030d81000d3c0d91060d060d060d060d060d060d
|
||||
060d06000d060106810700
|
||||
82060d0601068207000d010d0200040d0200010d0100810d0081000d7f0d1c0d83000d00
|
||||
0d020d81000d3b0d92060d060d060d060d060d060d060d060d000d060106810700
|
||||
82060d0601068207000d030d81000d020d81000d010d81000d810d0081000d820d000d7f
|
||||
0d1a0d81000d820d000d020d02003b0d91060d060d060d060d060d060d060d06000d0601
|
||||
06810700
|
||||
82060d0601068207000d030d81000d030d0300010d81000d010d81000d7f0d1a0d040005
|
||||
0d81000d380d92060d060d060d060d060d060d060d060d000d060106810700
|
||||
82060d0601068207000d030d81000d020d81000d010d81000d820d000d010d81000d7f0d
|
||||
1d0d81000d010d81000d010d81000d380d0e060100810d060106810700
|
||||
82060d0601068207000d010d0400010d0800810d0001007f0d1c0d0200020d02003a0d81
|
||||
060d0b0d81070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d810d0081000d060d81000d030d0100040d01007f0d170d020003
|
||||
0d0300390d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d81000d0d0d81000d040d81000d7f0d150d81000d010d8100
|
||||
0d010d81000d3b0d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d82000d0081000d010d0200050d81000d040d81000d7f0d18
|
||||
0d81000d020d81000d3b0d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d0100010d81000d020d81000d040d81000d040d81000d7f0d
|
||||
170d81000d030d02003a0d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d81000d010d81000d020d81000d040d81000d040d81000d7f
|
||||
0d160d81000d070d81000d380d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d81000d010d81000d020d81000d040d81000d040d81000d7f
|
||||
0d150d81000d040d81000d010d81000d380d82060d060a0681070082000d060106810700
|
||||
|
||||
82060d0601068207000d810d000300020d0400010d0400010d04007f0d140d0400020d02
|
||||
003a0d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d030d81000d0a0d0100050d81000d7f0d5b0d82060d060a068107
|
||||
0082000d060106810700
|
||||
82060d0601068207000d110d81000d7f0d620d82060d060a0681070082000d0601068107
|
||||
00
|
||||
82060d0601068207000d010d0300010d0100010d0100030d81000d020d0200040d020001
|
||||
0d0100810d0081000d7f0d070d0200010d0100810d0081000d020d0200330d82060d060a
|
||||
0681070082000d060106810700
|
||||
82060d0601068207000d040d81000d010d81000d010d81000d020d81000d040d81000d02
|
||||
0d81000d010d81000d810d0081000d820d000d7f0d050d81000d010d81000d810d008100
|
||||
0d820d000d820d000d010d81000d310d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d040d81000d010d81000d010d81000d020d81000d040d81000d03
|
||||
0d0300010d81000d010d81000d7f0d050d81000d010d81000d820d000d010d81000d810d
|
||||
000300320d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d040d81000d010d81000d810d0081000d020d81000d040d81000d
|
||||
020d81000d010d81000d820d000d010d81000d7f0d050d81000d010d81000d820d000d01
|
||||
0d81000d820d000d350d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d040d81000d020d0100810d0082000d000300010d0400010d0800
|
||||
810d0001007f0d060d0200010d0200810d000100010d0300320d82060d060a0681070082
|
||||
000d060106810700
|
||||
82060d0601068207000d040d81000d7f0d6f0d82060d060a0681070082000d0601068107
|
||||
00
|
||||
82060d0601068207000d010d02007f0d710d82060d060a0681070082000d060106810700
|
||||
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d7f0d760d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d810d0081000d060d81000d7f0d690d82060d060a068107008200
|
||||
0d060106810700
|
||||
82060d0601068207000d010d81000d0b0d81000d7f0d640d82060d060a0681070082000d
|
||||
060106810700
|
||||
82060d0601068207000d010d82000d0081000d010d0200020d0400010d0200820d000d02
|
||||
0d0200010d0100810d0081000d7f0d050d0100810d0081000d020d0200010d0100810d00
|
||||
81000d020d02002c0d82060d060a0681070082000d060106810700
|
||||
82060d0601068207000d010d0100010d81000d020d81000d020d81000d040d85000d000d
|
||||
000d820d000d010d81000d810d0081000d820d000d7f0d050d0100010d81000d820d000d
|
||||
010d81000d810d0081000d820d000d820d000d010d81000d2a0d82060d060a0681070082
|
||||
000d060106810700
|
||||
82060d0601068207000d010d81000d010d81000d020d81000d020d81000d040d85000d00
|
||||
0d000d010d0300010d81000d010d81000d7f0d050d81000d010d81000d820d000d010d81
|
||||
000d820d000d010d81000d810d0003002b0d82060d060a0681070082000d060106810700
|
||||
|
||||
82060d0601068207000d010d81000d010d81000d020d81000d020d81000d010d81000d86
|
||||
0d000d000d000d820d000d010d81000d820d000d010d81000d7f0d050d81000d010d8100
|
||||
0d820d000d010d81000d820d000d010d81000d820d000d2e0d82060d060a068107008200
|
||||
0d060106810700
|
||||
82060d0601068207000d810d000300020d0400020d0200010d0600810d000400810d0002
|
||||
007f0d060d0200810d000100010d0200010d0200810d000100010d03002b0d8106070c07
|
||||
0100810d060106810700
|
||||
82060d0601068207000d240d81000d7f0d4f0d1000810d060106810700
|
||||
82060d0601068207000d230d02007f0d4f0d0e060100810d060106810700
|
||||
82060d0601068207000d7f0d760d81060d0b0d81070082000d060106810700
|
||||
82060d060106820700047f04760482060d060a0681070082000d060106810700
|
||||
82060d060106820700047f04760482060d060a0681070082000d060106810700
|
||||
82060d060106820700047f04760482060d060a0681070082000d060106810700
|
||||
82060d060106820700047f04760482060d060a0681070082000d060106810700
|
||||
82060d060106820700043404810d041304010d7f04290482060d06810600050002068107
|
||||
0082000d060106810700
|
||||
82060d060106820700041d04810d042b04810d046204810d04430482060d060106040003
|
||||
0681070082000d060106810700
|
||||
82060d060106820700040204030d0204020d0104010d81040d810d040204030d81040d03
|
||||
0d0204010d81040d810d040104020d0204020d0204010d81040d810d040204020d030401
|
||||
0d82040d046104040d0104020d81040d010d0104020d330482060d060206020004068107
|
||||
0082000d060106810700
|
||||
82060d060106820700040104810d040104810d0482040d040104810d0481040d810d0482
|
||||
040d0482040d040404810d040504010d0304810d040104810d040204810d040204010d01
|
||||
04810d0482040d040104810d0482040d0481040d810d046204810d040404810d04010481
|
||||
0d0482040d040104810d04310482060d060306810006040681070082000d060106810700
|
||||
|
||||
82060d060106820700040104810d040404810d040104810d0482040d040104810d040104
|
||||
020d0204810d040504810d040404030d0304810d040204810d040104810d0481040d030d
|
||||
0104810d040104810d046204810d040404850d040d040d0482040d040104810d04310482
|
||||
060d060a0681070082000d060106810700
|
||||
82060d060106820700040104810d040404810d040104810d0482040d040104810d040404
|
||||
810d0482040d040104810d040104810d040304810d040104810d040204810d040204810d
|
||||
040104810d0482040d040404810d040104810d046204810d040104810d0486040d040d04
|
||||
0d0482040d040104810d04310482060d060a0681070082000d060106810700
|
||||
82060d060106820700040204030d0204020d0104020d81040d010d81040d020d0304020d
|
||||
0204030d0204050d81040d030d81040d010d81040d010d0104030d0204040d6304020d03
|
||||
04830d040d040204020d330482060d060a0681070082000d060106810700
|
||||
82060d060106820700047f04760482060d060a0681070082000d060106810700
|
||||
82060d060106820700047f0476048106070c070100810d060106810700
|
||||
82060d060106820700047f0476041000810d060106810700
|
||||
82060d0601068107067f0677061000810d060106810700
|
||||
82060d0601067f0d7f0d0b0d0206810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
82060d067f067f061006810700
|
||||
8106077f077f0712070000
|
||||
7f007f001500
|
||||
|
||||
%
|
||||
% Compression made this file 6.27% of the uncompressed size.
|
||||
%
|
||||
|
||||
|
||||
showpage
|
||||
|
||||
% stop using temporary dictionary
|
||||
end
|
||||
|
||||
% restore original state
|
||||
origstate restore
|
||||
|
||||
%%Trailer
|
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 42 KiB |
@@ -1,664 +0,0 @@
|
||||
%!PS-Adobe-2.0 EPSF-2.0
|
||||
%%Title: prop2.eps
|
||||
%%Creator: XV Version 2.20 Rev: 4/24/92 - by John Bradley
|
||||
%%BoundingBox: 167 221 466 500
|
||||
%%Pages: 1
|
||||
%%DocumentFonts:
|
||||
%%EndComments
|
||||
%%EndProlog
|
||||
|
||||
%%Page: 1 1
|
||||
|
||||
% remember original state
|
||||
/origstate save def
|
||||
|
||||
% build a temporary dictionary
|
||||
20 dict begin
|
||||
|
||||
% lower left corner
|
||||
167 221 translate
|
||||
|
||||
% size of image (on paper, in 1/72inch coords)
|
||||
299 279 scale
|
||||
|
||||
% define 'colorimage' if it isn't defined
|
||||
% ('colortogray' and 'mergeprocs' come from xwd2ps
|
||||
% via xgrab)
|
||||
/colorimage where % do we know about 'colorimage'?
|
||||
{ pop } % yes: pop off the 'dict' returned
|
||||
{ % no: define one
|
||||
/colortogray { % define an RGB->I function
|
||||
/rgbdata exch store % call input 'rgbdata'
|
||||
rgbdata length 3 idiv
|
||||
/npixls exch store
|
||||
/rgbindx 0 store
|
||||
/grays npixls string store % str to hold the result
|
||||
0 1 npixls 1 sub {
|
||||
grays exch
|
||||
rgbdata rgbindx get 20 mul % Red
|
||||
rgbdata rgbindx 1 add get 32 mul % Green
|
||||
rgbdata rgbindx 2 add get 12 mul % Blue
|
||||
add add 64 idiv % I = .5G + .31R + .18B
|
||||
put
|
||||
/rgbindx rgbindx 3 add store
|
||||
} for
|
||||
grays
|
||||
} bind def
|
||||
|
||||
% Utility procedure for colorimage operator.
|
||||
% This procedure takes two procedures off the
|
||||
% stack and merges them into a single procedure.
|
||||
|
||||
/mergeprocs { % def
|
||||
dup length
|
||||
3 -1 roll
|
||||
dup
|
||||
length
|
||||
dup
|
||||
5 1 roll
|
||||
3 -1 roll
|
||||
add
|
||||
array cvx
|
||||
dup
|
||||
3 -1 roll
|
||||
0 exch
|
||||
putinterval
|
||||
dup
|
||||
4 2 roll
|
||||
putinterval
|
||||
} bind def
|
||||
|
||||
/colorimage { % def
|
||||
pop pop % remove 'false 3' operands
|
||||
{colortogray} mergeprocs
|
||||
image
|
||||
} bind def
|
||||
} ifelse % end of 'false' case
|
||||
|
||||
|
||||
|
||||
% define the colormap
|
||||
/cmap 42 string def
|
||||
|
||||
|
||||
% load up the colormap
|
||||
currentfile cmap readhexstring
|
||||
000000 bf0000 00bf00 bfbf00 0000bf 00bfbf c0c0c0 808080 ff0000 00ff00
|
||||
ffff00 0000ff 00ffff ffffff
|
||||
pop pop % lose return values from readhexstring
|
||||
|
||||
|
||||
% rlecmapimage expects to have 'w h bits matrix' on stack
|
||||
/rlecmapimage {
|
||||
/buffer 1 string def
|
||||
/rgbval 3 string def
|
||||
/block 384 string def
|
||||
|
||||
% proc to read a block from file, and return RGB data
|
||||
{ currentfile buffer readhexstring pop
|
||||
/bcount exch 0 get store
|
||||
bcount 128 ge
|
||||
{ % it's a non-run block
|
||||
0 1 bcount 128 sub
|
||||
{ currentfile buffer readhexstring pop pop
|
||||
|
||||
% look up value in color map
|
||||
/rgbval cmap buffer 0 get 3 mul 3 getinterval store
|
||||
|
||||
% and put it in position i*3 in block
|
||||
block exch 3 mul rgbval putinterval
|
||||
} for
|
||||
block 0 bcount 127 sub 3 mul getinterval
|
||||
}
|
||||
|
||||
{ % else it's a run block
|
||||
currentfile buffer readhexstring pop pop
|
||||
|
||||
% look up value in colormap
|
||||
/rgbval cmap buffer 0 get 3 mul 3 getinterval store
|
||||
|
||||
0 1 bcount { block exch 3 mul rgbval putinterval } for
|
||||
|
||||
block 0 bcount 1 add 3 mul getinterval
|
||||
} ifelse
|
||||
} % end of proc
|
||||
false 3 colorimage
|
||||
} bind def
|
||||
|
||||
|
||||
299 279 8 % dimensions of data
|
||||
[299 0 0 -279 0 279] % mapping matrix
|
||||
rlecmapimage
|
||||
|
||||
7f0003007f072607
|
||||
07077f067f0618068100070707
|
||||
070781060d7f0d7f0d150d820700070707
|
||||
070782060d067f067f061406820700070707
|
||||
070782060d067f067f061406820700070707
|
||||
070782060d068106077f077f0710070106820700070707
|
||||
070782060d068106078207060d820d060783070d0702010203098102077f077e07010682
|
||||
0700070707
|
||||
070782060d068106078707060b060001020781070283020702098109028102077f074a07
|
||||
0e0d81000d0d0d81000781070d0d0d81000781070683060700070707
|
||||
070782060d0681060782070806810600820002078507020902070201028109077f074a07
|
||||
810d060b068307000d060b068207000782070d060b068207000781070683060700070707
|
||||
|
||||
070782060d06810607810706850608000403078207020984090207020981090701070506
|
||||
2d070306020701061a0705066a07810d060b068307000d06810600070001068207000782
|
||||
070d060b068207000781070683060700070707
|
||||
070782060d068106078707060b0604000a07890702090207020702090701070106020701
|
||||
061d0701060b07010601070106010701061207010607070106100701065907810d060b06
|
||||
8307000d06810600070001068207000782070d0601060100030601000106820700078107
|
||||
0683060700070707
|
||||
070782060d0681060701070106020001070102860702090207020701070106020701061d
|
||||
0701060b070106050701061207010607070106100701065907810d060b068307000d0682
|
||||
0600060506810006830607000782070d0602060100010601000206820700078107068306
|
||||
0700070707
|
||||
070782060d0681060785070d0607060d010d840702000209010982020007010701060207
|
||||
010681070601060107030601070406020703060107020681070601068107068206070681
|
||||
060703070106050704060207030602070306010702060607010604070306020702060107
|
||||
02065807810d060b068307000d06820600060506810006830607000782070d0603060300
|
||||
03068207000781070683060700070707
|
||||
070782060d06810607070701000602020705060107010601070106010701068107068106
|
||||
078107068206070681060781070682060706810607810706810607810706820607068106
|
||||
070407030602070206810706820607068106078107068206070681060781070682060706
|
||||
81060706070106030701060107010681070682060706820607068106075807810d060b06
|
||||
8307000d06820600060506810006830607000782070d0604060100040682070007810706
|
||||
83060700070707
|
||||
070782060d06810607810705050501000603020701060507010601070106010701068107
|
||||
068106078107068206070604068107068106078107068106078107068206070681060707
|
||||
070106010701060107010681070604068107060406810706810607060701060307050601
|
||||
070106020701065907810d060b068307000d06820600060506810006830607000782070d
|
||||
060306030003068207000781070683060700070707
|
||||
070782060d0681060781070c010c8205080c830c05030a020a81030a810a070107010605
|
||||
070106010701060107010681070681060781070682060706810607030701060107010601
|
||||
070106810706810607070701060107010601070106810706810607030701060407010607
|
||||
0701060307010606070106010701065907810d060b068307000d06820600060506810006
|
||||
830607000782070d06020601000106010002068207000781070683060700070707
|
||||
070782060d068106078c070c05070507050c05030a030a840a03000a0701070106050701
|
||||
060107010601070106810706810607810706820607068106078107068206070681060781
|
||||
070681060701070206050701060107010601070106010701068107068106078107068206
|
||||
070681060781070682060706810607060701060307010601070106810706820607068206
|
||||
07068106075807810d060106050003068307000d06820600060506810006830607000782
|
||||
070d06010601000306010001068207000781070683060700070707
|
||||
070782060d0681060782070c08020886070c05030a030a010a82030a0701070106050701
|
||||
060207030601070406020703060107010602070106010701060707030602070106010701
|
||||
06010703060207030602070106060701060407030602070206020701065807810d060106
|
||||
050003068307000d06810600070001068207000782070d060b0682070007810706830607
|
||||
00070707
|
||||
070782060d0681060782070c080208010c8205030a810a0384030a030a07140701061407
|
||||
01067f071c07810d060b068307000d060b068207000782070d060b068207000781070683
|
||||
060700070707
|
||||
070782060d0681060782070c080308850c05030a030a010a82000a071407010612070206
|
||||
7f071d07810d070c0782000d070c0781000782070d070c07810007810706830607000707
|
||||
07
|
||||
070782060d0681060783070c05080208850c05030a030a810a0382030a077f074a071f00
|
||||
01070f0001070106820700070707
|
||||
070782060d0681060781070c050c8205030a050a7f077f070106820700070707
|
||||
070782060d068106077f077f0710070106820700070707
|
||||
070782060d067f067f061406820700070707
|
||||
070782060d067f067f061406820700070707
|
||||
070782060d0637067f073d07810d061c06820700070707
|
||||
070782060d06030616000306160001068107007f003a0082060d06810600150004068207
|
||||
00070707
|
||||
070782060d06020681000d140d820700068206000d140d8507000607000d7f0d390d8406
|
||||
0d06000d140d820700060206820700070707
|
||||
070782060d06020682000d06120601078100068306000d061206010784000607000d7f0d
|
||||
390d84060d06000d130d01078100060206820700070707
|
||||
070782060d06020682000d06120601078100068306000d061206010784000607000d7f0d
|
||||
390d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d06120601078100068306000d061206010784000607000d7f0d
|
||||
390d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0603068100060606810006030601078100068306000d061206
|
||||
010784000607000d010d0100020d0200020d0200020d02007f0d230d84060d06000d810d
|
||||
06110601078100060206820700070707
|
||||
070782060d06020682000d060306020003060200040601078100068306000d060b068100
|
||||
060406010784000607000d810d000100010d0100810d0082000d0082000d0082000d0082
|
||||
000d0081000d7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d060406020001060200050601078100068306000d060a060200
|
||||
0406010785000607000d000200010d0100810d0082000d0082000d0082000d0082000d00
|
||||
81000d7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0605060500060601078100068306000d060906030004060107
|
||||
87000607000d000d0081000d810d0082000d0082000d0082000d0082000d0082000d0081
|
||||
000d7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0606060300070601078100068306000d060806030005060107
|
||||
84000607000d010d0100010d0100810d0082000d0082000d0082000d0082000d0081000d
|
||||
7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0606060300070601078100068306000d060306010001060300
|
||||
0606010784000607000d010d0100010d0100810d0082000d0082000d0082000d0082000d
|
||||
0081000d7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0605060500060601078100068306000d060306060007060107
|
||||
84000607000d010d0100010d0100810d0082000d0082000d0082000d0082000d0081000d
|
||||
7f0d210d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d060406020001060200050601078100068306000d0604060400
|
||||
0806010784000607000d010d0100020d0200020d0200020d02007f0d230d84060d06000d
|
||||
810d060306010781060782070607810706040601078100060206820700070707
|
||||
070782060d06020682000d060306020003060200040601078100068306000d0605060200
|
||||
0906010784000607000d7f0d390d84060d06000d810d0603060107810607820706078107
|
||||
06040601078100060206820700070707
|
||||
070782060d06020682000d060306010005060100040601078100068306000d0606068100
|
||||
060906010784000607000d7f0d390d84060d06000d810d06110601078100060206820700
|
||||
070707
|
||||
070782060d06020682000d06120601078100068306000d061206010784000607000d7f0d
|
||||
390d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d06120601078100068306000d061206010784000607000d7f0d
|
||||
390d84060d06000d810d06110601078100060206820700070707
|
||||
070782060d06020682000d0714078100068306000d07140784000607000d7f0d390d8506
|
||||
0d06000d0714078100060206820700070707
|
||||
070782060d06020682000d0714078100068306000d07140784000607000d7f0d390d8406
|
||||
0d06000715078100060206820700070707
|
||||
070782060d06030616000306160001068207000d7f0d390d82060d068106001500040682
|
||||
0700070707
|
||||
070782060d0637068107067f063b06810d061c06820700070707
|
||||
070782060d0637067f0d3e0d1d06820700070707
|
||||
070782060d0601067f077f070e07810d060106820700070707
|
||||
070782060d0601068107007f007f000b0082060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d040d0100120d01007f0d150d0200550d82060d0601068207
|
||||
00070707
|
||||
070782060d0601068207000d030d81000d140d81000d7f0d130d81000d010d81000d530d
|
||||
82060d060106820700070707
|
||||
070782060d0601068207000d020d0300010d0100810d0081000d010d0200030d0100820d
|
||||
000d7f0d130d81000d010d81000d530d82060d060106820700070707
|
||||
070782060d0601068207000d030d81000d030d0100030d81000d010d81000d820d000d81
|
||||
0d0081000d7f0d130d81000d010d81000d530d82060d060106820700070707
|
||||
070782060d0601068207000d030d81000d030d81000d030d0400010d81000d010d81000d
|
||||
7f0d130d81000d010d81000d530d82060d060106820700070707
|
||||
070782060d0601068207000d030d81000d030d81000d030d81000d040d81000d010d8100
|
||||
0d7f0d130d81000d010d81000d530d82060d060106820700070707
|
||||
070782060d0601068207000d020d0300010d0300030d0300020d04007f0d140d0200550d
|
||||
82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d1c0d0100120d01000e0d81000d6b0d0400090d0100480d82
|
||||
060d060106820700070707
|
||||
070782060d0601068207000d010d81000d190d81000d120d81000d7c0d81000d820d000d
|
||||
090d81000d470d82060d060106820700070707
|
||||
070782060d0601068207000d810d000300030d0200010d0100010d0100020d0100810d00
|
||||
84000d000d0081000d090d0300010d82000d0081000d020d0200020d0200040d0300020d
|
||||
02005e0d83000d000d020d0200040d81000d030d0300020d0200390d82060d0601068207
|
||||
00070707
|
||||
070782060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d
|
||||
820d000d810d0081000d810d0081000d820d000d070d81000d010d81000d810d0081000d
|
||||
820d000d820d000d010d81000d020d81000d020d81000d010d81000d820d000d010d8100
|
||||
0d5c0d0200020d81000d010d81000d020d81000d020d81000d040d81000d010d81000d37
|
||||
0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d
|
||||
820d000d010d81000d820d000d010d81000d070d81000d040d81000d010d81000d820d00
|
||||
0d010d81000d020d81000d020d81000d040d04005d0d83000d000d020d0300030d81000d
|
||||
030d0200020d0400380d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d010d81000d820d000d010d81000d820d000d81
|
||||
0d0081000d820d000d010d81000d820d000d010d81000d070d81000d040d81000d010d81
|
||||
000d820d000d010d81000d020d81000d020d81000d040d81000d600d81000d030d81000d
|
||||
010d81000d020d81000d060d81000d820d000d3b0d82060d060106820700070707
|
||||
070782060d0601068207000d020d0200030d0200030d0100810d0081000d810d00020081
|
||||
0d000100810d000100080d0300810d000100810d000100010d0200020d0400020d030002
|
||||
0d03005c0d0200030d0500810d000300010d0300030d0300380d82060d06010682070007
|
||||
0707
|
||||
070782060d0601068207000d1a0d81000d7f0d6d0d82060d060106820700070707
|
||||
070782060d0601068207000d170d02007f0d6f0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700040304810d047f043204010d4f0482060d0601068207000707
|
||||
07
|
||||
070782060d060106820700047f043904810d044e0482060d060106820700070707
|
||||
070782060d060106820700040104020d0404020d0104010d81040d810d047f042404810d
|
||||
044e0482060d060106820700070707
|
||||
070782060d060106820700040304810d040204810d040104810d0481040d810d0482040d
|
||||
047f041a04040d0304810d044e0482060d060106820700070707
|
||||
070782060d060106820700040304810d040304030d0104810d040104810d047f04230481
|
||||
0d044e0482060d060106820700070707
|
||||
070782060d060106820700040304810d040204810d040104810d0482040d040104810d04
|
||||
7f042304810d044e0482060d060106820700070707
|
||||
070782060d060106820700040104040d0104080d81040d010d7f042104040d4d0482060d
|
||||
060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d060106820700047f047f040a0482060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d810d0081000d060d81000d030d0100040d01007f0d170d02
|
||||
00030d03004d0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d0d0d81000d040d81000d7f0d150d81000d010d
|
||||
81000d010d81000d4f0d82060d060106820700070707
|
||||
070782060d0601068207000d010d82000d0081000d010d0200050d81000d040d81000d7f
|
||||
0d180d81000d020d81000d4f0d82060d060106820700070707
|
||||
070782060d0601068207000d010d0100010d81000d020d81000d040d81000d040d81000d
|
||||
7f0d170d81000d030d02004e0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d010d81000d020d81000d040d81000d040d8100
|
||||
0d7f0d160d81000d070d81000d4c0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d010d81000d020d81000d040d81000d040d8100
|
||||
0d7f0d150d81000d040d81000d010d81000d4c0d82060d060106820700070707
|
||||
070782060d0601068207000d810d000300020d0400010d0400010d04007f0d140d040002
|
||||
0d02004e0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d030d81000d0a0d0100050d81000d7f0d6f0d82060d060106
|
||||
820700070707
|
||||
070782060d0601068207000d110d81000d7f0d760d82060d060106820700070707
|
||||
070782060d0601068207000d010d0300010d0100010d0100030d81000d020d0200040d02
|
||||
00010d0100810d0081000d7f0d070d0200010d0100810d0081000d020d0200470d82060d
|
||||
060106820700070707
|
||||
070782060d0601068207000d040d81000d010d81000d010d81000d020d81000d040d8100
|
||||
0d020d81000d010d81000d810d0081000d820d000d7f0d050d81000d010d81000d810d00
|
||||
81000d820d000d820d000d010d81000d450d82060d060106820700070707
|
||||
070782060d0601068207000d040d81000d010d81000d010d81000d020d81000d040d8100
|
||||
0d030d0300010d81000d010d81000d7f0d050d81000d010d81000d820d000d010d81000d
|
||||
810d000300460d82060d060106820700070707
|
||||
070782060d0601068207000d040d81000d010d81000d810d0081000d020d81000d040d81
|
||||
000d020d81000d010d81000d820d000d010d81000d7f0d050d81000d010d81000d820d00
|
||||
0d010d81000d820d000d490d82060d060106820700070707
|
||||
070782060d0601068207000d040d81000d020d0100810d0082000d000300010d0400010d
|
||||
0800810d0001007f0d060d0200010d0200810d000100010d0300460d82060d0601068207
|
||||
00070707
|
||||
070782060d0601068207000d040d81000d7f0d7f0d030d82060d060106820700070707
|
||||
070782060d0601068207000d010d02007f0d7f0d050d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d810d0081000d060d81000d7f0d7d0d82060d060106820700
|
||||
070707
|
||||
070782060d0601068207000d010d81000d0b0d81000d7f0d780d82060d06010682070007
|
||||
0707
|
||||
070782060d0601068207000d010d82000d0081000d010d0200020d0400010d0200820d00
|
||||
0d020d0200010d0100810d0081000d7f0d050d0100810d0081000d020d0200010d010081
|
||||
0d0081000d020d0200400d82060d060106820700070707
|
||||
070782060d0601068207000d010d0100010d81000d020d81000d020d81000d040d85000d
|
||||
000d000d820d000d010d81000d810d0081000d820d000d7f0d050d0100010d81000d820d
|
||||
000d010d81000d810d0081000d820d000d820d000d010d81000d3e0d82060d0601068207
|
||||
00070707
|
||||
070782060d0601068207000d010d81000d010d81000d020d81000d020d81000d040d8500
|
||||
0d000d000d010d0300010d81000d010d81000d7f0d050d81000d010d81000d820d000d01
|
||||
0d81000d820d000d010d81000d810d0003003f0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d010d81000d020d81000d020d81000d010d8100
|
||||
0d860d000d000d000d820d000d010d81000d820d000d010d81000d7f0d050d81000d010d
|
||||
81000d820d000d010d81000d820d000d010d81000d820d000d420d82060d060106820700
|
||||
070707
|
||||
070782060d0601068207000d810d000300020d0400020d0200010d0600810d000400810d
|
||||
0002007f0d060d0200810d000100010d0200010d0200810d000100010d03003f0d82060d
|
||||
060106820700070707
|
||||
070782060d0601068207000d240d81000d7f0d630d82060d060106820700070707
|
||||
070782060d0601068207000d230d02007f0d630d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d340d81000d130d01007f0d3d0d82060d0601068207000707
|
||||
07
|
||||
070782060d0601068207000d1d0d81000d2b0d81000d620d81000d570d82060d06010682
|
||||
0700070707
|
||||
070782060d0601068207000d020d0300020d0200010d0100810d0081000d020d0300810d
|
||||
000300020d0100810d0081000d010d0200020d0200020d0100810d0081000d020d020003
|
||||
0d0100820d000d610d0400010d0200810d000100010d0200470d82060d06010682070007
|
||||
0707
|
||||
070782060d0601068207000d010d81000d010d81000d820d000d010d81000d810d008100
|
||||
0d820d000d820d000d040d81000d050d0100030d81000d010d81000d020d81000d020d01
|
||||
00010d81000d820d000d010d81000d820d000d810d0081000d620d81000d040d81000d01
|
||||
0d81000d820d000d010d81000d450d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d
|
||||
010d0200020d81000d050d81000d040d0300030d81000d020d81000d010d81000d810d00
|
||||
0300010d81000d010d81000d620d81000d040d85000d000d000d820d000d010d81000d45
|
||||
0d82060d060106820700070707
|
||||
070782060d0601068207000d010d81000d040d81000d010d81000d820d000d010d81000d
|
||||
040d81000d820d000d010d81000d010d81000d030d81000d010d81000d020d81000d020d
|
||||
81000d010d81000d820d000d040d81000d010d81000d620d81000d010d81000d860d000d
|
||||
000d000d820d000d010d81000d450d82060d060106820700070707
|
||||
070782060d0601068207000d020d0300020d0200010d0200810d000100810d000200030d
|
||||
0200020d0300020d0500810d000300810d000100810d000100010d0300020d0400630d02
|
||||
00030d83000d000d020d0200470d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
070782060d0601068207000d7f0d7f0d0a0d82060d060106820700070707
|
||||
7f077f0726078100070107
|
||||
03077f0d7f0d210d820700070107
|
||||
0307820d06077f077f071c07840d060700070107
|
||||
0307830d0607047f047f041c0483060700070107
|
||||
0307830d0607047f047f041c0483060700070107
|
||||
0307830d0607047f047f040a040e0d8100048404060700070107
|
||||
0307830d0607047f047f040a04810d060b06820700048404060700070107
|
||||
0307830d06070481040d040d3a04010d7f044604810d060b068207000484040607000701
|
||||
07
|
||||
0307830d06070481040d810d040104010d1d04010d1904010d7f044604810d0601060107
|
||||
030601070106820700048404060700070107
|
||||
0307830d06070481040d810d040104010d1d04010d1904010d7f044604810d0602060107
|
||||
01060107010d83060700048404060700070107
|
||||
0307830d06070481040d810d040104010d81040d010d0104030d0104040d0204030d0104
|
||||
020d81040d010d81040d820d040d810d040304010d0104010d0104030d0104010d81040d
|
||||
810d0481040d810d0481040d020d0604030d0104020d81040d010d0104030d0104020d7f
|
||||
041a04810d0603060307010d0106820700048404060700070107
|
||||
0307830d06070481040d040d0104010d0104010d0104010d81040d810d0481040d820d04
|
||||
0d810d0481040d820d040d810d0481040d810d0481040d820d040d810d040304010d0104
|
||||
010d0404010d81040d820d040d810d0481040d820d040d810d0481040d810d040304010d
|
||||
0104010d81040d810d0481040d810d0481040d810d0481040d820d040d810d047f041a04
|
||||
810d0604060107010d0206820700048404060700070107
|
||||
0307830d06070481040d810d040404010d0104010d0104010d81040d810d0481040d820d
|
||||
040d040d81040d810d0481040d810d0481040d820d040d810d040404030d0204040d8104
|
||||
0d820d040d810d0481040d820d040d040d0404050d81040d810d0481040d810d0481040d
|
||||
810d0481040d820d040d810d047f041a04810d0603060307030682070004840406070007
|
||||
0107
|
||||
0307830d06070481040d810d040404010d0104010d0104010d81040d810d0481040d820d
|
||||
040d810d040304010d0104010d0104010d81040d810d040404030d0104010d0104010d81
|
||||
040d820d040d810d0481040d820d040d810d040704010d0404010d0104010d0104010d01
|
||||
04010d81040d810d047f041a04810d0602060107010d0107020682070004840406070007
|
||||
0107
|
||||
0307830d06070481040d810d040404010d0104010d0104010d81040d810d0481040d820d
|
||||
040d810d0481040d820d040d810d0481040d810d040104020d0704010d0204010d010401
|
||||
0d81040d820d040d820d040d010d81040d810d0481040d810d040304010d0104010d8104
|
||||
0d810d0481040d810d0481040d810d0481040d820d040d810d047f041a04810d06010601
|
||||
07010d010601070106820700048404060700070107
|
||||
0307830d06070481040d810d040404010d0204030d0104040d0204030d0104010d020401
|
||||
0d0104010d0804010d0304040d81040d810d0481040d030d0104030d0604030d0104010d
|
||||
0104010d0204030d0104010d7f041b04810d060206010d0306010d830607000484040607
|
||||
00070107
|
||||
0307830d0607041304010d1404010d7f045d04810d060b06820700048404060700070107
|
||||
|
||||
0307830d0607041304010d1204020d7f045e04810d070c078100048404060700070107
|
||||
0307830d0607047f047f040a040f00010483060700070107
|
||||
0307830d0607047f047f041c0483060700070107
|
||||
0307830d0607047f047f041c0483060700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d06170602037f067f060406820700070107
|
||||
0307810d06160681030a830a0600067f067f060206820700070107
|
||||
0307810d06150681030a020a83060007067f067f0683060700070107
|
||||
0307810d06150681030a030a8100078107067f067f06820700070107
|
||||
0307810d06140681030a040a820600078107067f067e06820700070107
|
||||
0307810d06140681030a050a8100078107067f067e06820700070107
|
||||
0307810d06130681030a060a820600078107067f067d06820700070107
|
||||
0307810d06130681030a070a8100078107067f067d06820700070107
|
||||
0307810d06120681030a080a820600078107067f067c06820700070107
|
||||
0307810d06120681030a010a810600010081060a010a8100078107067f067c0682070007
|
||||
0107
|
||||
0307810d06110681030a020a0400020a820600078107067f067b06820700070107
|
||||
0307810d06110681030a020a0400030a8100078107061606810006030681000605068100
|
||||
0627068100061b0681000620068100062c06040001060200140681000602060400010602
|
||||
0001068100060a06820700070107
|
||||
0307810d06100681030a030a0400030a8206000781070615068100060306810006050681
|
||||
000621068100060306810006230681000618068100060906810006200681000603068100
|
||||
060106810006120681000602068100060306810006010683000600060a06820700070107
|
||||
|
||||
0307810d06100681030a030a0400040a8100078107061606810006010681000606068100
|
||||
062106810006030681000623068100061806810006090681000620068100060306810006
|
||||
0106810006120681000602068100060306810006010683000600060a06820700070107
|
||||
0307810d060f0681030a040a0400040a8206000781070615068100060106810006010602
|
||||
000106830006000601068100068106000100040602008106008100068206000601068100
|
||||
068106008100068106008100060206030002060200050602000106820006008100060306
|
||||
840006000600810006810600810006810600010002060300010602000106010003060300
|
||||
020602000106010082060006820600068206000681060001000206020001068200060081
|
||||
000606060300010681000601068100060306020001068200060081000601060300030603
|
||||
000106810006010683000600060a06820700070107
|
||||
0307810d060f0681030a040a810300010081030a040a8100078107061506810006010681
|
||||
000604068500060006000601068300060006010681000602068100068206000684060006
|
||||
000601068300060006840600060006030681000601068300060006010681000606068200
|
||||
060081000682060006020682000600810006840600060006820600060106830006000601
|
||||
068300060006010683000600060306810006010683000600060106830006000682060006
|
||||
820600068406000600060106830006000601068200060081000682060006050681000601
|
||||
068300060006010681000606068200060081000684060006000601068100060206810006
|
||||
01068300060006010683000600060a06820700070107
|
||||
0307810d060e0681030a050a810600010081060a040a8206000781070615068300060006
|
||||
020603008406000600060106820006000300030681000682060006840600060006010681
|
||||
000682060006010681000603068100060106820006000300040603008206000601068100
|
||||
060206830006000601068300060006810600030082060006010682000600030082060006
|
||||
030681000601068200060003008206000689060006000600060006000300810600030082
|
||||
060006010681000602060100040683000600060106810006030603008206000601068300
|
||||
060006010681000606068300060006010683000600060a06820700070107
|
||||
0307810d060e0681030a060a0200070a8100078107061506830006000601068100060106
|
||||
850006000600060106830006000606068100068206000684060006000601068100060106
|
||||
810006820600060306810006010683000600060606810006010683000600060106810006
|
||||
020683000600060106830006000682060006030681000601068300060006030681000603
|
||||
068100060106830006000603068100068a06000600060006000600060306810006030681
|
||||
000601068100060906830006000601068100060206810006010683000600060106830006
|
||||
0006010681000606068300060006010683000600060a06820700070107
|
||||
0307810d060d0681030a070a830300030a060a8206000781070615068100060206810006
|
||||
010685000600060006810600830006000601068100060206810006820600068406000600
|
||||
068106008300060006840600060006030681000601068300060006010681000602068100
|
||||
060106830006000601068100060206830006000601068300060006820600060106830006
|
||||
000601068300060006010683000600060306810006010683000600060106830006000601
|
||||
068100060106810006820600060106830006000601068300060006010681000605068100
|
||||
060106830006000601068100060206810006010683000600060106830006000601068100
|
||||
0602068100060106830006000601068100060c06820700070107
|
||||
0307810d060d0681030a070a830600060a070a8100078107061506810006030603008206
|
||||
000681060083000600068106000100040681000682060006820600068106008300060006
|
||||
810600810006010681000602060300020602000506030082060006010681000602068300
|
||||
060006010681000682060006810600010002060300010602000106810006030603000206
|
||||
020002068100068206000601068100060106020002060200010681000601068100060606
|
||||
020002060200050603008206000601068100068106000200040602000206020001068100
|
||||
060a06820700070107
|
||||
0307810d060c0681030a090a81000a080a820600078107067c0681000677068207000701
|
||||
07
|
||||
0307810d060c0681030a150a810007810706780603007906820700070107
|
||||
0307810d060b0681030a090a8106008200060a070a820600078107067f06750682070007
|
||||
0107
|
||||
0307810d060b0681030a090a0300090a8100078107067f067506820700070107
|
||||
0307810d060a0681030a0a0a0300090a820600078107067f067406820700070107
|
||||
0307810d060a0681030a0a0a8106008200060a090a8100078107067f0674068207000701
|
||||
07
|
||||
0307810d060a0681030a190a81000701077f067406820700070107
|
||||
0307810d060a0681030a180a8206000701077f067406820700070107
|
||||
0307810d060b0681030a160a8206000702077f067406820700070107
|
||||
0307810d060c06810300160004077f067406820700070107
|
||||
0307810d060e061a077f067506820700070107
|
||||
0307810d060f0618077f067606820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d066b0648006a06820700070107
|
||||
0307810d066a064a006906820700070107
|
||||
0307810d066a060100450d8107008100066806820700070107
|
||||
0307810d066a060100440d010701006906820700070107
|
||||
0307810d066a060100010d18069100060006000600060006000600060006000617060107
|
||||
01006906820700070107
|
||||
0307810d066a060100010d4206010701006906820700070107
|
||||
0307810d066a060100010d18068100060d068100061706010701006906820700070107
|
||||
0307810d066a060100010d1b060300020681000601068100061906010701006906820700
|
||||
070107
|
||||
0307810d066a060100010d18068300060006020681000682060006820600068206000617
|
||||
06010701006906820700070107
|
||||
0307810d066a060100010d1a0681000602068100068406000600061b0601070100690682
|
||||
0700070107
|
||||
0307810d066a060100010d18068300060006020681000681060081000602068100061706
|
||||
010701006906820700070107
|
||||
0307810d066a060100010d1a0681000602068100068106008100061c0601070100690682
|
||||
0700070107
|
||||
0307810d066a060100010d18068300060006020681000684060006000601068100061706
|
||||
010701006906820700070107
|
||||
0307810d066a060100010d1a06810006020681000682060006820600061a060107010069
|
||||
06820700070107
|
||||
0307810d066a060100010d18068300060006020681000682060006010683000600061706
|
||||
010701006906820700070107
|
||||
0307810d066a060100010d1b060300020681000602068100061806010701006906820700
|
||||
070107
|
||||
0307810d066a060100010d18068100060d068100061706010701006906820700070107
|
||||
0307810d066a060100010d4206010701006906820700070107
|
||||
0307810d066a060100010d18069100060006000600060006000600060006000617060107
|
||||
01006906820700070107
|
||||
0307810d066a060100810d07440701006906820700070107
|
||||
0307810d066a060100460701006906820700070107
|
||||
0307810d066a064a006906820700070107
|
||||
0307810d066b0648006a06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
0307810d067f067f061f06820700070107
|
||||
7f077f0726078100070107
|
||||
02077f007f0024000207
|
||||
7f077f072a07
|
||||
7f077f072a07
|
||||
7f077f072a07
|
||||
7f077f072a07
|
||||
7f077f072a07
|
||||
7f077f072a07
|
||||
|
||||
%
|
||||
% Compression made this file 5.68% of the uncompressed size.
|
||||
%
|
||||
|
||||
|
||||
showpage
|
||||
|
||||
% stop using temporary dictionary
|
||||
end
|
||||
|
||||
% restore original state
|
||||
origstate restore
|
||||
|
||||
%%Trailer
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,39 +0,0 @@
|
||||
|
||||
Prototype dialog editor and property sheet classes
|
||||
--------------------------------------------------
|
||||
|
||||
Julian Smart, October 4th 1995
|
||||
------------------------------
|
||||
|
||||
Here's what I've done so far on a lightweight dialog editor. The 16-bit
|
||||
Windows binaries in the bin directory are dialoged.exe (the dialog
|
||||
editor) and test.exe (a small property sheet demo).
|
||||
|
||||
Main points:
|
||||
|
||||
- You can create a new dialog box and add items to it.
|
||||
- You can move items around, and right-click
|
||||
to edit a few properties (very incomplete).
|
||||
- Can't write out .wxr files yet. Loading code is in
|
||||
wxWindows, but writing code is absent: should be put
|
||||
into wxWindows.
|
||||
- No attempt at resources other than dialogs yet.
|
||||
Should have menu editor too.
|
||||
- Should *somehow* have a protocol to allow
|
||||
existing resources e.g. in wxCLIPS/wxPython
|
||||
to be edited in situ.
|
||||
This should be made simpler by the existance of
|
||||
the plug-in event handler mechanism, which means you
|
||||
can temporarily handle all the events yourself.
|
||||
- See dialoged.cc: the main program is tiny because
|
||||
it's meant to be embeddable.
|
||||
- The wxPropertySheet (set of) classes are very
|
||||
general and should be put into wxWin and documented.
|
||||
|
||||
Comments, chivvying and help all appreciated. Maybe if
|
||||
I documented what I had, it would be easier for others
|
||||
to do some work on it.
|
||||
|
||||
Regards,
|
||||
|
||||
Julian
|
@@ -1,21 +0,0 @@
|
||||
runTwice = yes
|
||||
titleFontSize = 12
|
||||
authorFontSize = 10
|
||||
chapterFontSize = 12
|
||||
sectionFontSize = 12
|
||||
subsectionFontSize = 12
|
||||
headerRule = yes
|
||||
footerRule = yes
|
||||
useHeadingStyles = yes
|
||||
contentsDepth = 2
|
||||
listItemIndent=40
|
||||
generateHPJ = yes
|
||||
htmlBrowseButtons = bitmap
|
||||
winHelpVersion = 3
|
||||
winHelpContents = yes
|
||||
winHelpTitle = "Property Classes Manual"
|
||||
truncateFilenames = yes
|
||||
\overview [2] {\rtfonly{See also }\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}}
|
||||
\htmlonly{\image{}{books.gif}}\helpref{#1}{#2}
|
||||
\sethotspotcolour{on}\sethotspotunderline{on}}
|
||||
|
Before Width: | Height: | Size: 137 B |
@@ -1,17 +0,0 @@
|
||||
[OPTIONS]
|
||||
BMROOT=d:\wx2\wxwind~1\utils\wxprop\docs ; Assume that bitmaps are where the source is
|
||||
TITLE=Property Classes Manual
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
||||
[FILES]
|
||||
wxprop.rtf
|
||||
|
||||
[CONFIG]
|
||||
CreateButton("Up", "&Up", "JumpId(`wxprop.hlp', `Contents')")
|
||||
BrowseButtons()
|
||||
|
||||
[MAP]
|
||||
|
||||
[BITMAPS]
|
||||
|
@@ -1 +0,0 @@
|
||||
I'm just here to force the creation of a LIB directory.
|
Before Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 198 B |
@@ -1,74 +0,0 @@
|
||||
#
|
||||
# File: makefile.b32
|
||||
# Author: Patrick Halke
|
||||
# Created: 1995
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds 32bit wxProperty library for Windows
|
||||
# and Borland C++ 4.x
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
!include $(WXDIR)\src\makeb32.env
|
||||
|
||||
WXINC = $(WXDIR)\include
|
||||
TARGET=test
|
||||
TESTOBJECTS=test.obj
|
||||
LIBTARGET= $(WXLIBDIR)\wxprop.lib
|
||||
LIBS=$(WXLIB)\wx32.lib $(LIBTARGET) cw32 import32
|
||||
|
||||
!ifndef DEBUG
|
||||
DEBUG=0
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v -DDEBUG=$(DEBUG)
|
||||
!else
|
||||
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS = -DDEBUG=$(DEBUG)
|
||||
!endif
|
||||
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc32 $(CPPFLAGS) -c {$< }
|
||||
|
||||
.c.obj:
|
||||
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||
|
||||
OBJECTS = prop.obj proplist.obj propform.obj
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
$(LIBTARGET): $(OBJECTS)
|
||||
erase $(LIBTARGET)
|
||||
tlib $(LIBTARGET) /P32 @&&!
|
||||
+$(OBJECTS:.obj =.obj +)
|
||||
!
|
||||
|
||||
prop.obj: prop.$(SRCSUFF) prop.h
|
||||
proplist.obj: proplist.$(SRCSUFF) prop.h proplist.h
|
||||
propform.obj: propform.$(SRCSUFF) prop.h propform.h
|
||||
|
||||
$(TARGET).exe: $(TESTOBJECTS) $(LIBTARGET) $(TARGET).def $(TARGET).res
|
||||
tlink32 $(LINKFLAGS) @&&!
|
||||
c0w32.obj $(TESTOBJECTS)
|
||||
$(TARGET)
|
||||
nul
|
||||
$(LIBS) $(LIBTARGET)
|
||||
$(TARGET).def
|
||||
!
|
||||
brc32 -K $(TARGET).res
|
||||
|
||||
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||
|
||||
test.obj: test.$(SRCSUFF) test.h
|
||||
|
||||
clean:
|
||||
-erase *.obj $(LIBTARGET) *.exe *.res *.map *.rws
|
@@ -1,95 +0,0 @@
|
||||
#
|
||||
# File: makefile.bcc
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds wxProperty library
|
||||
|
||||
# Change WXDIR to wherever wxWindows is found
|
||||
WXDIR = $(WXWIN)
|
||||
!include $(WXDIR)\src\makebcc.env
|
||||
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
WXINC = $(WXDIR)\include
|
||||
CFG = $(WXWIN)\src\wxwin.cfg
|
||||
BCCDIR = d:\bc4
|
||||
|
||||
WXPROPDIR = $(WXDIR)\utils\wxprop
|
||||
WXPROPINC = $(WXPROPDIR)\src
|
||||
WXPROPLIB = $(WXPROPDIR)\lib\wxprop.lib
|
||||
|
||||
FAFALIB = $(WXDIR)\contrib\fafa\fafa.lib
|
||||
ITSYLIB = $(WXDIR)\contrib\itsybits\itsy.lib
|
||||
|
||||
DOCDIR = $(WXPROPDIR)\docs
|
||||
DOCUTILSDIR = $(WXDIR)\utils\tex2rtf\src
|
||||
THISDIR = $(WXPROPDIR)\src
|
||||
|
||||
# Default is to output RTF for WinHelp
|
||||
!ifndef WINHELP
|
||||
WINHELP=-winhelp
|
||||
!endif
|
||||
|
||||
INC=/I$(WXDIR)\include\base /I$(WXDIR)\include\msw
|
||||
|
||||
LIBS=$(WXLIB) $(WXPROPLIB) mathwl cwl import
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v
|
||||
!else
|
||||
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS=
|
||||
!endif
|
||||
CFLAGS=$(DEBUG_FLAGS) $(OPT) /DUSE_DEFINE @$(CFG)
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) /DUSE_DEFINE @$(CFG)
|
||||
|
||||
OBJECTS = wx_prop.obj wx_plist.obj wx_pform.obj
|
||||
|
||||
all: $(WXPROPLIB) # test.exe
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc $(CPPFLAGS) -c {$< }
|
||||
.c.obj:
|
||||
bcc $(CPPFLAGS) -P- -c {$< }
|
||||
|
||||
$(WXPROPLIB): $(OBJECTS)
|
||||
erase $(WXPROPLIB)
|
||||
tlib /P128 @&&!
|
||||
$(WXPROPLIB) &
|
||||
+$(OBJECTS:.obj =.obj +)
|
||||
!
|
||||
|
||||
test.obj: test.h wx_prop.h test.$(SRCSUFF)
|
||||
|
||||
wx_prop.obj: wx_prop.h wx_prop.$(SRCSUFF)
|
||||
|
||||
wx_plist.obj: wx_prop.h wx_plist.h wx_plist.$(SRCSUFF)
|
||||
|
||||
wx_pform.obj: wx_prop.h wx_pform.h wx_pform.$(SRCSUFF)
|
||||
|
||||
test.res : test.rc $(WXDIR)\include\msw\wx.rc $(WXPROPLIB)
|
||||
rc /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa -r test
|
||||
|
||||
test.exe: test.obj test.def test.res $(WXPROPLIB)
|
||||
tlink $(LINKFLAGS) @&&!
|
||||
c0wl.obj test.obj
|
||||
test
|
||||
nul
|
||||
$(LIBS)
|
||||
test.def
|
||||
!
|
||||
rc -K test.res
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase ..\lib\*.lib
|
||||
|