From 3dd4e4e05cc46ffc653730715e527af7b18b9caf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 8 Nov 1998 22:35:18 +0000 Subject: [PATCH] OGL fixes for wxMotif; added Set/GetClientData to wxMenu in wxMSW/wxMotif/wxStubs. Sorry, I may be overwriting changes Robert made due to a file copying error. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/zipdist.bat | 2 + docs/motif/todo.txt | 20 +++- include/wx/colordlg.h | 5 + include/wx/motif/menu.h | 5 + include/wx/motif/region.h | 1 + include/wx/motif/window.h | 37 ++++++- include/wx/msw/menu.h | 5 + include/wx/stubs/menu.h | 5 + samples/mdi/mdi.cpp | 2 +- samples/minimal/minimal.cpp | 2 +- src/make.env | 2 +- src/motif/makefile.unx | 12 +- src/motif/menu.cpp | 1 + src/motif/window.cpp | 29 ++++- src/msw/menu.cpp | 2 + src/stubs/menu.cpp | 1 + src/zlib/deflate.c | 4 +- src/zlib/zutil.h | 2 +- utils/ogl/distrib/ogl.rsp | 2 +- utils/ogl/samples/ogledit/makefile.unx | 75 ++----------- utils/ogl/samples/ogledit/ogledit.cpp | 11 +- utils/ogl/samples/ogledit/ogledit.rc | 2 +- utils/ogl/samples/ogledit/palette.cpp | 24 ++-- utils/ogl/samples/ogledit/view.cpp | 2 +- utils/ogl/src/basic.cpp | 10 +- utils/ogl/src/basic2.cpp | 3 +- utils/ogl/src/bmpshape.cpp | 2 - utils/ogl/src/canvas.cpp | 2 - utils/ogl/src/composit.cpp | 4 +- utils/ogl/src/constrnt.cpp | 2 - utils/ogl/src/divided.cpp | 2 - utils/ogl/src/drawn.cpp | 3 +- utils/ogl/src/lines.cpp | 5 +- utils/ogl/src/makefile.unx | 147 ++++++------------------- utils/ogl/src/misc.cpp | 2 - utils/ogl/src/ogldiag.cpp | 2 - 36 files changed, 198 insertions(+), 239 deletions(-) diff --git a/distrib/msw/zipdist.bat b/distrib/msw/zipdist.bat index 46ee70da51..d03062d0f7 100755 --- a/distrib/msw/zipdist.bat +++ b/distrib/msw/zipdist.bat @@ -25,6 +25,8 @@ zip32 -@ %dest\wx200hlp.zip < %src\distrib\msw\wx_hlp.rsp zip32 -@ %dest\wx200htm.zip < %src\distrib\msw\wx_html.rsp zip32 -@ %dest\wx200pdf.zip < %src\distrib\msw\wx_pdf.rsp +zip32 -@ %dest\ogl3.zip < %src\utils\ogl\distrib\ogl.rsp + cd %dest echo wxWindows archived. diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index 3221be70b6..3efb2ae282 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -1,7 +1,7 @@ wxMotif TODO ------------ -Updated: 20/10/98 +Updated: 8/11/98 -------------------------------o------------------------- @@ -87,7 +87,23 @@ Low Priority - Get Dialog Editor working under Motif. - New wxHelp version: try using the XmHTML widget at - http://www.xs4all.nl/~ripley/XmHTML/ + http://www.xs4all.nl/~ripley/XmHTML/. + + We need to: + - make a minimal distribution under wx/src/xmhtml, just enough + to compile the source. + - add XMHTML_C_SRC to src/motif/makefile.unx with the source files + listed. + - make sure we can compile the sources, passing the correct + flags for zlib/png compilation. + - make a wxHTMLWindow class from e.g. examples/example_2.c. Should + probably make the cache and history facilities part of the class. + - add the driver code to src/motif/helphtml.cpp (a frame, toolbar, + history list). + + Note that a quicker route to a help system may be to use the + code in the contrib dir of XmHTML to control a Netscape session -- + but Netscape can be a colour resource hog. - Optimize screen refresh for non-native widgets, e.g. wxWindow created with Create(), using technique in flicker patch for 1.68 diff --git a/include/wx/colordlg.h b/include/wx/colordlg.h index 977c8e5bde..a8ca97c25b 100644 --- a/include/wx/colordlg.h +++ b/include/wx/colordlg.h @@ -15,5 +15,10 @@ #include "wx/generic/colrdlgg.h" #endif +#ifndef __WXMSW__ +#define wxColourDialog wxGenericColourDialog +#define sm_classwxColourDialog sm_classwxColourDialog +#endif + #endif // _WX_COLORDLG_H_BASE_ diff --git a/include/wx/motif/menu.h b/include/wx/motif/menu.h index f89f733d11..e0b40fc05b 100644 --- a/include/wx/motif/menu.h +++ b/include/wx/motif/menu.h @@ -62,6 +62,10 @@ public: bool Checked(int id) const; inline bool IsChecked(int id) const { return IsChecked(id); }; + // Client data + inline void SetClientData(void* clientData) { m_clientData = clientData; } + inline void* GetClientData() const { return m_clientData; } + // item properties // title void SetTitle(const wxString& label); @@ -120,6 +124,7 @@ public: wxList m_menuItems; wxEvtHandler * m_parent; wxEvtHandler * m_eventHandler; + void* m_clientData; //// Motif-specific int m_numColumns; diff --git a/include/wx/motif/region.h b/include/wx/motif/region.h index d4a78f1a43..4741405bde 100644 --- a/include/wx/motif/region.h +++ b/include/wx/motif/region.h @@ -18,6 +18,7 @@ #include "wx/list.h" #include "wx/gdiobj.h" +#include "wx/gdicmn.h" class WXDLLEXPORT wxRect; class WXDLLEXPORT wxPoint; diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index 50321c953d..4c8dc2b3b4 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -81,6 +81,33 @@ WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr; WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; +//----------------------------------------------------------------------------- +// wxClientData +//----------------------------------------------------------------------------- + +class wxClientData +{ +public: + wxClientData() { } + virtual ~wxClientData() { } +}; + +//----------------------------------------------------------------------------- +// wxStringClientData +//----------------------------------------------------------------------------- + +class wxStringClientData: public wxClientData +{ +public: + wxStringClientData() { } + wxStringClientData( wxString &data ) { m_data = data; } + void SetData( wxString &data ) { m_data = data; } + wxString GetData() const { return m_data; } + +private: + wxString m_data; +}; + class WXDLLEXPORT wxWindow: public wxEvtHandler { DECLARE_ABSTRACT_CLASS(wxWindow) @@ -279,6 +306,12 @@ public: void SetValidator(const wxValidator& validator); inline wxValidator *GetValidator() const; + virtual void SetClientObject( wxClientData *data ); + virtual wxClientData *GetClientObject(); + + virtual void SetClientData( void *data ); + virtual void *GetClientData(); + // Set/get the window's style inline void SetWindowStyleFlag(long flag); inline long GetWindowStyleFlag() const; @@ -369,7 +402,7 @@ public: // Does this window want to accept keyboard focus? virtual bool AcceptsFocus() const; - virtual void PrepareDC( wxDC &WXUNUSED(dc) ) {}; + virtual void PrepareDC( wxDC &dc ) {}; public: @@ -538,6 +571,8 @@ protected: wxColour m_backgroundColour ; wxColour m_foregroundColour ; wxAcceleratorTable m_acceleratorTable; + wxClientData* m_clientObject; + void* m_clientData; #if wxUSE_DRAG_AND_DROP wxDropTarget *m_pDropTarget; // the current drop target or NULL diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index f5d0a6a1a6..a7ede6fe16 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -54,6 +54,10 @@ public: // delete an item void Delete(int id); /* If it's a submenu, menu is not destroyed. VZ: why? */ + // Client data + inline void SetClientData(void* clientData) { m_clientData = clientData; } + inline void* GetClientData() const { return m_clientData; } + // menu item control void Enable(int id, bool Flag); bool Enabled(int id) const; @@ -120,6 +124,7 @@ public: wxEvtHandler * m_parent; wxEvtHandler * m_eventHandler; wxWindow *m_pInvokingWindow; + void* m_clientData; }; // ---------------------------------------------------------------------------- diff --git a/include/wx/stubs/menu.h b/include/wx/stubs/menu.h index 8f1323723c..fa3936557c 100644 --- a/include/wx/stubs/menu.h +++ b/include/wx/stubs/menu.h @@ -62,6 +62,10 @@ public: bool Checked(int id) const; inline bool IsChecked(int id) const { return IsChecked(id); }; + // Client data + inline void SetClientData(void* clientData) { m_clientData = clientData; } + inline void* GetClientData() const { return m_clientData; } + // item properties // title void SetTitle(const wxString& label); @@ -97,6 +101,7 @@ public: wxList m_menuItems; wxEvtHandler * m_parent; wxEvtHandler * m_eventHandler; + void* m_clientData; }; // ---------------------------------------------------------------------------- diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index 6409aa52f0..4dbb0c058b 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -57,7 +57,7 @@ bool MyApp::OnInit(void) frame = new MyFrame((wxFrame *) NULL, -1, (char *) "MDI Demo", wxPoint(-1, -1), wxSize(500, 400), wxDEFAULT_FRAME | wxHSCROLL | wxVSCROLL); - // Give it an icon (this is ignored in MDI mode: uses resources) + // Give it an icon #ifdef __WXMSW__ frame->SetIcon(wxIcon("mdi_icn")); #else diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index a7778131b8..602c65241f 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -38,7 +38,7 @@ // ressources // ---------------------------------------------------------------------------- // the application icon -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif diff --git a/src/make.env b/src/make.env index 14d45519e3..a3d6a48b49 100644 --- a/src/make.env +++ b/src/make.env @@ -83,7 +83,7 @@ LDLIBS = $(EXTRALDLIBS) $(GUILDLIBS) .SUFFIXES: .o .cpp .c .c.o : - $(CC) -c $(CFLAGS) -o $@ $< + $(CCC) -c $(CFLAGS) -o $@ $< .cpp.o : $(CC) -c $(CPPFLAGS) -o $@ $< diff --git a/src/motif/makefile.unx b/src/motif/makefile.unx index b525da7c7f..f1c5a48a1f 100644 --- a/src/motif/makefile.unx +++ b/src/motif/makefile.unx @@ -158,14 +158,24 @@ LIB_CPP_SRC=\ # listctrl.cpp \ # imaglist.cpp \ # statusbr.cpp \ + +ZLIB_SRC=\ + ../zlib/adler32.c ../zlib/deflate.c ../zlib/infblock.c\ + ../zlib/inflate.c ../zlib/zutil.c ../zlib/compress.c \ + ../zlib/infcodes.c ../zlib/inftrees.c ../zlib/trees.c \ + ../zlib/crc32.c ../zlib/gzio.c ../zlib/inffast.c\ + ../zlib/infutil.c ../zlib/uncompr.c LIB_C_SRC=\ \ ../common/y_tab.c \ ../common/extended.c +# Only need to compile zlib files if we don't +# already have a zlib library installed on our system +# (or we wish to statically link them for some reason) EXTRA_C_SRC=\ - xmcombo/xmcombo.c + xmcombo/xmcombo.c # $(ZLIB_SRC) EXTRA_CPP_SRC=\ mdi/lib/XsComponent.C\ diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index dcaaa94df4..d10b977174 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -74,6 +74,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func) m_topLevelMenu = (wxMenu*) NULL; m_ownedByMenuBar = FALSE; m_menuParent = (wxMenu*) NULL; + m_clientData = (void*) NULL; if (m_title != "") { diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 4274c6513a..d19fdf801b 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -108,6 +108,8 @@ wxWindow::wxWindow() #if wxUSE_DRAG_AND_DROP m_pDropTarget = NULL; #endif + m_clientObject = (wxClientData*) NULL; + m_clientData = NULL; /// Motif-specific m_mainWidget = (WXWidget) 0; @@ -239,8 +241,8 @@ wxWindow::~wxWindow() // dangling pointers. wxPendingDelete.DeleteObject(this); - if ( m_windowValidator ) - delete m_windowValidator; + if ( m_windowValidator ) delete m_windowValidator; + if (m_clientObject) delete m_clientObject; } // Destroy the window (delayed, if a managed window) @@ -282,6 +284,8 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, m_maxSizeY = -1; m_defaultItem = NULL; m_windowParent = NULL; + m_clientObject = (wxClientData*) NULL; + m_clientData = NULL; // Motif-specific m_canAddEventHandler = FALSE; @@ -1929,6 +1933,27 @@ void wxWindow::SetValidator(const wxValidator& validator) m_windowValidator->SetWindow(this) ; } +void wxWindow::SetClientObject( wxClientData *data ) +{ + if (m_clientObject) delete m_clientObject; + m_clientObject = data; +} + +wxClientData *wxWindow::GetClientObject() +{ + return m_clientObject; +} + +void wxWindow::SetClientData( void *data ) +{ + m_clientData = data; +} + +void *wxWindow::GetClientData() +{ + return m_clientData; +} + // Find a window by id or name wxWindow *wxWindow::FindWindow(long id) { diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 7ac19a8ddd..5c0c4cc9d4 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -73,6 +73,8 @@ wxMenu::wxMenu(const wxString& Title, const wxFunction func) m_hMenu = (WXHMENU) CreatePopupMenu(); m_savehMenu = 0 ; m_topLevelMenu = this; + m_clientData = (void*) NULL; + if (m_title != "") { Append(idMenuTitle, m_title) ; diff --git a/src/stubs/menu.cpp b/src/stubs/menu.cpp index be4e10eba7..1fc7c4a229 100644 --- a/src/stubs/menu.cpp +++ b/src/stubs/menu.cpp @@ -50,6 +50,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func) m_eventHandler = this; m_noItems = 0; m_menuBar = NULL; + m_clientData = (void*) NULL; if (m_title != "") { Append(-2, m_title) ; diff --git a/src/zlib/deflate.c b/src/zlib/deflate.c index 490813fe90..7fb81af14e 100644 --- a/src/zlib/deflate.c +++ b/src/zlib/deflate.c @@ -88,7 +88,7 @@ local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); local uInt longest_match OF((deflate_state *s, IPos cur_match)); #endif -#ifdef DEBUG +#ifdef __WXDEBUG__ local void check_match OF((deflate_state *s, IPos start, IPos match, int length)); #endif @@ -918,7 +918,7 @@ local uInt longest_match(s, cur_match) #endif /* FASTEST */ #endif /* ASMV */ -#ifdef DEBUG +#ifdef __WXDEBUG__ /* =========================================================================== * Check that the match at match_start is indeed a match. */ diff --git a/src/zlib/zutil.h b/src/zlib/zutil.h index 06543084cd..3a390ff989 100644 --- a/src/zlib/zutil.h +++ b/src/zlib/zutil.h @@ -29,7 +29,7 @@ #ifndef local # define local static #endif -/* compile with -Dlocal if your __WXDEBUG__ger can't find static symbols */ +/* compile with -Dlocal if your debugger can't find static symbols */ typedef unsigned char uch; typedef uch FAR uchf; diff --git a/utils/ogl/distrib/ogl.rsp b/utils/ogl/distrib/ogl.rsp index 8da08f60a8..27db43a242 100644 --- a/utils/ogl/distrib/ogl.rsp +++ b/utils/ogl/distrib/ogl.rsp @@ -16,9 +16,9 @@ utils/ogl/samples/ogledit/*.def utils/ogl/samples/ogledit/*.xbm utils/ogl/samples/ogledit/makefile* utils/ogl/samples/ogledit/*.txt - utils/ogl/samples/ogledit/*.ico utils/ogl/samples/ogledit/*.bmp +utils/ogl/samples/ogledit/*.xpm utils/ogl/samples/ogledit/bitmaps/*.bmp utils/ogl/samples/ogledit/bitmaps/*.gif utils/ogl/samples/ogledit/bitmaps/*.xbm diff --git a/utils/ogl/samples/ogledit/makefile.unx b/utils/ogl/samples/ogledit/makefile.unx index a813dbceb0..0038ddc0b4 100644 --- a/utils/ogl/samples/ogledit/makefile.unx +++ b/utils/ogl/samples/ogledit/makefile.unx @@ -1,79 +1,20 @@ # # File: makefile.unx # Author: Julian Smart -# Created: 1993 +# Created: 1998 # Updated: -# Copyright: (c) 1993, AIAI, University of Edinburgh +# Copyright: (c) 1998 Julian Smart # # "%W% %G%" # -# Makefile for docview example (UNIX). +# Makefile for OGLEdit example (UNIX). -WXDIR = ../../../.. +PROGRAM=ogledit -# All common UNIX compiler flags and options are now in -# this central makefile. -include $(WXDIR)/src/make.env +OBJECTS=$(PROGRAM).o doc.o view.o palette.o -OGLDIR = $(WXDIR)/utils/ogl -OGLINC = $(OGLDIR)/src -OGLLIB = $(OGLDIR)/lib/libogl$(GUISUFFIX).a +EXTRACPPFLAGS=-I$(WXDIR)/utils/ogl/src +EXTRALDLIBS=-logl$(GUISUFFIX) -OBJECTS = $(OBJDIR)/ogledit.$(OBJSUFF) $(OBJDIR)/view.$(OBJSUFF) $(OBJDIR)/doc.$(OBJSUFF) $(OBJDIR)/palette.$(OBJSUFF) +include ../../../../src/makeprog.env -LDFLAGS = $(XLIB) -L$(WXDIR)/lib -L$(OGLDIR)/lib -L$(MFDIR)/lib - -XVIEWLDLIBS = -logl_ol -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS) -MOTIFLDLIBS = -logl_motif -lwx_motif -lXm -lXt -lX11 -lm $(COMPLIBS) -HPLDLIBS = -logl_motif -lwx_hp -lXm -lXt -lX11 -lm $(COMPLIBS) - -CPPFLAGS = -I$(OGLINC) -I$(PROLOGINC) -I$(MFINC) $(XINCLUDE) $(INC) $(GUI) -DDEBUG='$(DEBUG)' $(DEBUGFLAGS) $(WARN) $(OPTIONS) -DPROLOGIO - -.SUFFIXES: - -all: $(OBJDIR) ogledit$(GUISUFFIX) - -wx_motif: - cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif - -wx_ol: - cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview -motif: - $(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK= - -xview: - $(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' - -hp: - $(MAKE) -f makefile,unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='' WARN='-w' \ - XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)' - -$(OBJDIR): - mkdir $(OBJDIR) - -ogledit$(GUISUFFIX): $(OBJECTS) $(WXLIB) - $(CC) $(LDFLAGS) -o ogledit$(GUISUFFIX) $(OBJECTS) $(XVIEW_LINK) $(LDLIBS) - -$(OBJDIR)/ogledit.$(OBJSUFF): ogledit.$(SRCSUFF) ogledit.h doc.h view.h palette.h - $(CC) -c $(CPPFLAGS) -o $@ ogledit.$(SRCSUFF) - -$(OBJDIR)/doc.$(OBJSUFF): doc.$(SRCSUFF) doc.h - $(CC) -c $(CPPFLAGS) -o $@ doc.$(SRCSUFF) - -$(OBJDIR)/view.$(OBJSUFF): view.$(SRCSUFF) view.h - $(CC) -c $(CPPFLAGS) -o $@ view.$(SRCSUFF) - -$(OBJDIR)/palette.$(OBJSUFF): palette.$(SRCSUFF) palette.h - $(CC) -c $(CPPFLAGS) -o $@ palette.$(SRCSUFF) - -clean_motif: - $(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany - -clean_ol: - $(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany - -clean_hp: - $(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany - -cleanany: - rm -f $(OBJECTS) ogledit(GUISUFFIX) core diff --git a/utils/ogl/samples/ogledit/ogledit.cpp b/utils/ogl/samples/ogledit/ogledit.cpp index 7aac4d1ab0..c10fa51ee0 100644 --- a/utils/ogl/samples/ogledit/ogledit.cpp +++ b/utils/ogl/samples/ogledit/ogledit.cpp @@ -33,6 +33,10 @@ #include "doc.h" #include "view.h" +#if defined(__WXGTK__) || defined(__WXMOTIF__) +#include "ogl.xpm" +#endif + // A macro needed for some compilers (AIX) that need 'main' to be defined // in the application itself. IMPLEMENT_APP(MyApp) @@ -63,12 +67,7 @@ bool MyApp::OnInit(void) frame = new MyFrame(myDocManager, NULL, "OGLEdit Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE); //// Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon("ogl_icn")); -#endif -#ifdef __X__ - frame->SetIcon(wxIcon("ogl.xbm")); -#endif + frame->SetIcon(wxICON(ogl)); //// Make a menubar wxMenu *file_menu = new wxMenu; diff --git a/utils/ogl/samples/ogledit/ogledit.rc b/utils/ogl/samples/ogledit/ogledit.rc index fc2d538d65..046f0c6f45 100644 --- a/utils/ogl/samples/ogledit/ogledit.rc +++ b/utils/ogl/samples/ogledit/ogledit.rc @@ -1,4 +1,4 @@ -ogl_icn ICON ogl.ico +ogl ICON ogl.ico TOOL1 BITMAP "bitmaps/tool1.bmp" TOOL2 BITMAP "bitmaps/tool2.bmp" diff --git a/utils/ogl/samples/ogledit/palette.cpp b/utils/ogl/samples/ogledit/palette.cpp index 255f0decbc..2150d8ec62 100644 --- a/utils/ogl/samples/ogledit/palette.cpp +++ b/utils/ogl/samples/ogledit/palette.cpp @@ -24,7 +24,7 @@ #include #endif -#include +#include #include #include @@ -35,6 +35,15 @@ #include "ogledit.h" #include "palette.h" +// Include pixmaps +#if defined(__WXGTK__) || defined(__WXMOTIF__) +#include "bitmaps/arrow.xpm" +#include "bitmaps/tool1.xpm" +#include "bitmaps/tool2.xpm" +#include "bitmaps/tool3.xpm" +#include "bitmaps/tool4.xpm" +#endif + /* * Object editor tool palette * @@ -82,13 +91,12 @@ EditorToolPalette *MyApp::CreatePalette(wxFrame *parent) wxBitmap PaletteTool3("TOOL3"); wxBitmap PaletteTool4("TOOL4"); wxBitmap PaletteArrow("ARROWTOOL"); -#endif -#ifdef __X__ - wxBitmap PaletteTool1(tool1_bits, tool1_width, tool1_height); - wxBitmap PaletteTool2(tool2_bits, tool2_width, tool2_height); - wxBitmap PaletteTool3(tool3_bits, tool3_width, tool3_height); - wxBitmap PaletteTool4(tool4_bits, tool4_width, tool4_height); - wxBitmap PaletteArrow(arrow_bits, arrow_width, arrow_height); +#elif defined(__WXGTK__) || defined(__WXMOTIF__) + wxBitmap PaletteTool1(tool1_xpm); + wxBitmap PaletteTool2(tool2_xpm); + wxBitmap PaletteTool3(tool3_xpm); + wxBitmap PaletteTool4(tool4_xpm); + wxBitmap PaletteArrow(arrow_xpm); #endif EditorToolPalette *palette = new EditorToolPalette(parent, wxPoint(0, 0), wxSize(-1, -1), wxTB_HORIZONTAL); diff --git a/utils/ogl/samples/ogledit/view.cpp b/utils/ogl/samples/ogledit/view.cpp index 9ce5b7c332..3dfb84f239 100644 --- a/utils/ogl/samples/ogledit/view.cpp +++ b/utils/ogl/samples/ogledit/view.cpp @@ -77,7 +77,7 @@ void DiagramView::OnDraw(wxDC *dc) /* You might use THIS code if you were scaling * graphics of known size to fit on the page. */ - float w, h; + int w, h; // We need to adjust for the graphic size, a formula will be added float maxX = 900; diff --git a/utils/ogl/src/basic.cpp b/utils/ogl/src/basic.cpp index 6961d45852..d93aa76a0c 100644 --- a/utils/ogl/src/basic.cpp +++ b/utils/ogl/src/basic.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include @@ -1827,8 +1825,8 @@ void wxShape::WriteRegions(wxExpr *clause) // region1 = (regionName regionText x y width height minWidth minHeight proportionX proportionY // formatMode fontSize fontFamily fontStyle fontWeight textColour) wxExpr *regionExpr = new wxExpr(wxExprList); - regionExpr->Append(new wxExpr(wxExprString, (region->m_regionName ? region->m_regionName : ""))); - regionExpr->Append(new wxExpr(wxExprString, (region->m_regionText ? region->m_regionText : ""))); + regionExpr->Append(new wxExpr(wxExprString, region->m_regionName)); + regionExpr->Append(new wxExpr(wxExprString, region->m_regionText)); regionExpr->Append(new wxExpr(region->m_x)); regionExpr->Append(new wxExpr(region->m_y)); @@ -1846,10 +1844,10 @@ void wxShape::WriteRegions(wxExpr *clause) regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetFamily() : wxDEFAULT))); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetStyle() : wxDEFAULT))); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetWeight() : wxNORMAL))); - regionExpr->Append(new wxExpr(wxExprString, region->m_textColour ? region->m_textColour : "BLACK")); + regionExpr->Append(new wxExpr(wxExprString, region->m_textColour)); // New members for pen colour/style - regionExpr->Append(new wxExpr(wxExprString, region->m_penColour ? region->m_penColour : "BLACK")); + regionExpr->Append(new wxExpr(wxExprString, region->m_penColour)); regionExpr->Append(new wxExpr((long)region->m_penStyle)); // Formatted text: diff --git a/utils/ogl/src/basic2.cpp b/utils/ogl/src/basic2.cpp index 40b86bf5f3..e3bf382081 100644 --- a/utils/ogl/src/basic2.cpp +++ b/utils/ogl/src/basic2.cpp @@ -10,6 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ +#pragma implementation "basicp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -23,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include diff --git a/utils/ogl/src/bmpshape.cpp b/utils/ogl/src/bmpshape.cpp index 1171f9ac13..b7f7a0f370 100644 --- a/utils/ogl/src/bmpshape.cpp +++ b/utils/ogl/src/bmpshape.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "basicp.h" diff --git a/utils/ogl/src/canvas.cpp b/utils/ogl/src/canvas.cpp index 9d37801bf3..857a70e130 100644 --- a/utils/ogl/src/canvas.cpp +++ b/utils/ogl/src/canvas.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include diff --git a/utils/ogl/src/composit.cpp b/utils/ogl/src/composit.cpp index 8d1e60add6..1e8331b4f6 100644 --- a/utils/ogl/src/composit.cpp +++ b/utils/ogl/src/composit.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "basicp.h" @@ -1716,7 +1714,7 @@ void wxDivisionShape::EditEdge(int side) // Popup menu void wxDivisionShape::PopupMenu(double x, double y) { - oglPopupDivisionMenu->SetClientData((char *)this); + oglPopupDivisionMenu->SetClientData((void *)this); if (m_leftSide) oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, TRUE); else diff --git a/utils/ogl/src/constrnt.cpp b/utils/ogl/src/constrnt.cpp index f4a645b688..101e4a1782 100644 --- a/utils/ogl/src/constrnt.cpp +++ b/utils/ogl/src/constrnt.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "constrnt.h" diff --git a/utils/ogl/src/divided.cpp b/utils/ogl/src/divided.cpp index 9768075e72..68fa6ca646 100644 --- a/utils/ogl/src/divided.cpp +++ b/utils/ogl/src/divided.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "basicp.h" diff --git a/utils/ogl/src/drawn.cpp b/utils/ogl/src/drawn.cpp index 498448efab..e5ea9c82ce 100644 --- a/utils/ogl/src/drawn.cpp +++ b/utils/ogl/src/drawn.cpp @@ -11,6 +11,7 @@ #ifdef __GNUG__ #pragma implementation "drawn.h" +#pragma implementation "drawnp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -24,9 +25,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "basicp.h" diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index d03b2f401a..2e390faea2 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -11,6 +11,7 @@ #ifdef __GNUG__ #pragma implementation "lines.h" +#pragma implementation "linesp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -24,9 +25,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include @@ -1424,7 +1423,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause) head_list->Append(new wxExpr((long)head->GetArrowEnd())); head_list->Append(new wxExpr(head->GetXOffset())); head_list->Append(new wxExpr(head->GetArrowSize())); - head_list->Append(new wxExpr(wxExprString, (head->GetName() ? head->GetName() : ""))); + head_list->Append(new wxExpr(wxExprString, head->GetName())); head_list->Append(new wxExpr(head->GetId())); // New members of wxArrowHead diff --git a/utils/ogl/src/makefile.unx b/utils/ogl/src/makefile.unx index 83ef912268..55a194651c 100644 --- a/utils/ogl/src/makefile.unx +++ b/utils/ogl/src/makefile.unx @@ -1,125 +1,42 @@ # # File: makefile.unx # Author: Julian Smart -# Created: 1996 +# Created: 1998 # Updated: -# Copyright: (c) 1996 Julian Smart +# Copyright: (c) 1998 # -# "%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 $@ +# Makefile for OGL library, Unix + +include ../../../src/make.env + +OGLLIB=$(WXDIR)/lib/libogl$(GUISUFFIX).a + +LIB_CPP_SRC=\ +\ + basic.o\ + basic2.o\ + canvas.o\ + ogldiag.o\ + lines.o\ + misc.o\ + divided.o\ + constrnt.o\ + composit.o\ + drawn.o\ + bmpshape.o\ + mfutils.o + +all: $(OGLLIB) + +# Define library objects +OBJECTS=\ + $(LIB_CPP_SRC:.cpp=.o) + +$(OGLLIB) : $(OBJECTS) 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 +clean: + rm -f $(OBJECTS) $(OGLLIB) diff --git a/utils/ogl/src/misc.cpp b/utils/ogl/src/misc.cpp index 4d9d814d24..c55ca31103 100644 --- a/utils/ogl/src/misc.cpp +++ b/utils/ogl/src/misc.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include diff --git a/utils/ogl/src/ogldiag.cpp b/utils/ogl/src/ogldiag.cpp index 12d08924a8..36b22e9cbc 100644 --- a/utils/ogl/src/ogldiag.cpp +++ b/utils/ogl/src/ogldiag.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include -- 2.45.2