From 34138703c3997ce676a1e713d9ff9eb020640da7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 15 Aug 1998 00:23:28 +0000 Subject: [PATCH] Changes mostly as a result of __WXSTUBS__ compilation. The stubs code now compiles under Windows with VC++. Also OGL enhancements espec. wxDrawnShape. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/symbols.txt | 15 +- include/wx/accel.h | 19 + include/wx/app.h | 13 +- include/wx/bitmap.h | 12 +- include/wx/bmpbuttn.h | 10 +- include/wx/brush.h | 12 +- include/wx/button.h | 12 +- include/wx/checkbox.h | 12 +- include/wx/checklst.h | 19 + include/wx/choicdlg.h | 6 +- include/wx/choice.h | 12 +- include/wx/clipbrd.h | 12 +- include/wx/cmndata.h | 9 +- include/wx/colordlg.h | 10 +- include/wx/colour.h | 19 + include/wx/combobox.h | 12 +- include/wx/config.h | 6 +- include/wx/control.h | 12 +- include/wx/cursor.h | 12 +- include/wx/date.h | 6 +- include/wx/datstrm.h | 6 +- include/wx/dc.h | 12 +- include/wx/dcclient.h | 12 +- include/wx/dcmemory.h | 12 +- include/wx/dcprint.h | 6 +- include/wx/dcscreen.h | 12 +- include/wx/dde.h | 12 +- include/wx/debug.h | 6 +- include/wx/defs.h | 41 +- include/wx/dialog.h | 12 +- include/wx/dirdlg.h | 12 +- include/wx/dnd.h | 10 +- include/wx/docview.h | 4 +- include/wx/dynlib.h | 4 +- include/wx/event.h | 7 +- include/wx/expr.h | 6 +- include/wx/file.h | 2 +- include/wx/filedlg.h | 12 +- include/wx/filefn.h | 6 +- include/wx/font.h | 12 +- include/wx/fontdlg.h | 14 +- include/wx/frame.h | 12 +- include/wx/fstream.h | 4 +- include/wx/gauge.h | 12 +- include/wx/gdicmn.h | 20 +- include/wx/gdiobj.h | 12 +- include/wx/grid.h | 6 +- include/wx/hash.h | 6 +- include/wx/help.h | 6 +- include/wx/helpbase.h | 6 +- include/wx/helphtml.h | 6 +- include/wx/helpwin.h | 6 +- include/wx/helpxlp.h | 6 +- include/wx/icon.h | 12 +- include/wx/imaglist.h | 10 +- include/wx/intl.h | 2 +- include/wx/ipcbase.h | 6 +- include/wx/joystick.h | 11 +- include/wx/layout.h | 6 +- include/wx/list.h | 6 +- include/wx/listbox.h | 12 +- include/wx/listctrl.h | 10 +- include/wx/log.h | 7 +- include/wx/matrix.h | 6 +- include/wx/mdi.h | 12 +- include/wx/memory.h | 6 +- include/wx/menu.h | 12 +- include/wx/metafile.h | 6 +- include/wx/minifram.h | 12 +- include/wx/module.h | 4 +- include/wx/msgdlg.h | 10 +- include/wx/mstream.h | 4 +- include/wx/msw/dc.h | 6 +- include/wx/notebook.h | 12 +- include/wx/object.h | 6 +- include/wx/objstrm.h | 4 +- include/wx/odbc.h | 4 +- include/wx/palette.h | 12 +- include/wx/panel.h | 6 +- include/wx/pen.h | 12 +- include/wx/pnghand.h | 12 +- include/wx/postscrp.h | 6 +- include/wx/print.h | 6 +- include/wx/printdlg.h | 12 +- include/wx/prntbase.h | 7 +- include/wx/process.h | 6 +- include/wx/radiobox.h | 12 +- include/wx/radiobut.h | 12 +- include/wx/region.h | 12 +- include/wx/resource.h | 6 +- include/wx/scrolbar.h | 12 +- include/wx/scrolwin.h | 6 +- include/wx/serbase.h | 4 +- include/wx/settings.h | 12 +- include/wx/setup.h | 24 +- include/wx/slider.h | 12 +- include/wx/spinbutt.h | 12 +- include/wx/splitter.h | 6 +- include/wx/statbmp.h | 12 +- include/wx/statbox.h | 12 +- include/wx/stattext.h | 12 +- include/wx/statusbr.h | 6 +- include/wx/stream.h | 4 +- include/wx/string.h | 6 +- include/wx/stubs/accel.h | 1 + include/wx/stubs/app.h | 2 + include/wx/stubs/checklst.h | 5 +- include/wx/stubs/colour.h | 5 + include/wx/stubs/cursor.h | 3 +- include/wx/stubs/dc.h | 23 +- include/wx/stubs/dcclient.h | 5 +- include/wx/stubs/dirdlg.h | 2 + include/wx/stubs/dnd.h | 238 +++++++ include/wx/stubs/font.h | 2 + include/wx/stubs/mdi.h | 4 + include/wx/stubs/metafile.h | 3 +- include/wx/stubs/notebook.h | 4 +- include/wx/stubs/palette.h | 1 - include/wx/stubs/pen.h | 6 +- include/wx/stubs/printdlg.h | 4 - include/wx/stubs/radiobut.h | 2 - include/wx/stubs/region.h | 5 - include/wx/stubs/settings.h | 4 + include/wx/stubs/setup.h | 5 +- include/wx/stubs/statusbr.h | 4 + include/wx/stubs/wave.h | 2 +- include/wx/stubs/window.h | 12 +- include/wx/tab.h | 6 +- include/wx/tabctrl.h | 12 +- include/wx/taskbar.h | 15 + include/wx/tbar95.h | 8 +- include/wx/tbarbase.h | 10 +- include/wx/tbarmsw.h | 8 +- include/wx/tbarsmpl.h | 6 +- include/wx/textctrl.h | 12 +- include/wx/textdlg.h | 6 +- include/wx/thread.h | 4 +- include/wx/time.h | 6 +- include/wx/timer.h | 12 +- include/wx/toolbar.h | 4 + include/wx/treectrl.h | 12 +- include/wx/types.h | 6 +- include/wx/utils.h | 6 +- include/wx/validate.h | 6 +- include/wx/valtext.h | 4 +- include/wx/version.h | 6 +- include/wx/window.h | 12 +- include/wx/wx.h | 6 +- include/wx/wxexpr.h | 4 +- include/wx/wxprec.h | 2 +- include/wx/zstream.h | 4 +- src/common/cmndata.cpp | 5 +- src/common/docview.cpp | 1 + src/common/file.cpp | 10 +- src/common/fileconf.cpp | 3 + src/common/filefn.cpp | 22 +- src/common/gdicmn.cpp | 6 + src/common/log.cpp | 5 +- src/common/tbarsmpl.cpp | 6 +- src/common/textfile.cpp | 4 +- src/common/timercmn.cpp | 2 + src/common/utilscmn.cpp | 2 +- src/generic/gridg.cpp | 10 +- src/generic/splitter.cpp | 2 - src/makeb32.env | 2 +- src/makeg95.env | 44 +- src/makemsc.env | 8 +- src/msw/app.cpp | 5 +- src/msw/dc.cpp | 2 +- src/msw/makefile.b32 | 3 +- src/msw/makefile.nt | 3 +- src/msw/window.cpp | 26 +- src/ntwxwin.mak | 8 +- src/stubs/accel.cpp | 1 + src/stubs/app.cpp | 10 +- src/stubs/checklst.cpp | 3 - src/stubs/colordlg.cpp | 5 +- src/stubs/control.cpp | 18 +- src/stubs/cursor.cpp | 1 + src/stubs/data.cpp | 2 + src/stubs/dc.cpp | 2 - src/stubs/dcclient.cpp | 8 +- src/stubs/dcmemory.cpp | 4 - src/stubs/dialog.cpp | 5 +- src/stubs/dirdlg.cpp | 1 - src/stubs/filedlg.cpp | 3 +- src/stubs/font.cpp | 3 + src/stubs/fontdlg.cpp | 5 +- src/stubs/frame.cpp | 8 +- src/stubs/gauge.cpp | 10 - src/stubs/imaglist.cpp | 4 +- src/stubs/listbox.cpp | 7 +- src/stubs/listctrl.cpp | 6 +- src/stubs/main.cpp | 2 +- src/stubs/makefile.nt | 955 ++++++++++++++++++++++++++ src/stubs/mdi.cpp | 2 + src/stubs/menu.cpp | 8 +- src/stubs/metafile.cpp | 5 +- src/stubs/msgdlg.cpp | 2 +- src/stubs/notebook.cpp | 6 +- src/stubs/palette.cpp | 9 - src/stubs/print.cpp | 13 +- src/stubs/printdlg.cpp | 35 +- src/stubs/region.cpp | 12 +- src/stubs/scrolbar.cpp | 2 +- src/stubs/settings.cpp | 4 +- src/stubs/slider.cpp | 2 +- src/stubs/stattext.cpp | 163 +---- src/stubs/statusbr.cpp | 30 +- src/stubs/tabctrl.cpp | 6 +- src/stubs/textctrl.cpp | 3 +- src/stubs/thread.cpp | 2 + src/stubs/timer.cpp | 8 +- src/stubs/toolbar.cpp | 13 +- src/stubs/treectrl.cpp | 7 +- src/stubs/wave.cpp | 2 + src/stubs/window.cpp | 32 +- utils/ogl/samples/ogledit/ogledit.cpp | 7 +- utils/ogl/src/basic.cpp | 38 +- utils/ogl/src/basic.h | 2 + utils/ogl/src/basic2.cpp | 76 +- utils/ogl/src/basicp.h | 7 + utils/ogl/src/drawn.cpp | 716 +++++++++++++------ utils/ogl/src/drawn.h | 66 +- utils/ogl/src/drawnp.h | 86 ++- utils/ogl/src/lines.cpp | 2 +- utils/ogl/src/lines.h | 4 +- utils/ogl/src/misc.cpp | 69 +- utils/ogl/src/misc.h | 6 + 229 files changed, 2990 insertions(+), 1225 deletions(-) create mode 100644 include/wx/accel.h create mode 100644 include/wx/checklst.h create mode 100644 include/wx/colour.h create mode 100644 include/wx/stubs/dnd.h create mode 100644 include/wx/taskbar.h create mode 100644 src/stubs/makefile.nt diff --git a/docs/symbols.txt b/docs/symbols.txt index 40c205c897..bee97d122b 100644 --- a/docs/symbols.txt +++ b/docs/symbols.txt @@ -4,17 +4,18 @@ GUIs: ----- __X__ any X, but not GTK -__WXMOTIF__ Motif -__XT__ Xt; mutually exclusive with WX_MOTIF (?) -__WXGTK__ GTK -__XVIEW__ Obsolete! -__WXMSW__ Any Windows -__MAC__ MacOS +__WXMOTIF__ Motif +__WXXT__ Xt; mutually exclusive with WX_MOTIF (?) +__WXGTK__ GTK +__WXMSW__ Any Windows +__WXMAC__ MacOS __UNIX__ any Unix +__WINDOWS__ any Windows __WIN95__ GUI for Windows 95 and above; NT 4.0 and above. __WIN32__ WIN32 API __NT__ Windows NT -__CURSES__ CURSES +__WXCURSES__ CURSES +__WXSTUBS__ Stubbed version ('template' wxWin implementation) In fact, they should better all start with __WX instead of __ only. The only GUIs implemented for 2.0 are __WXGTK__, __WXMSW__ and __WXMOTIF__ diff --git a/include/wx/accel.h b/include/wx/accel.h new file mode 100644 index 0000000000..a36d4a0a44 --- /dev/null +++ b/include/wx/accel.h @@ -0,0 +1,19 @@ +#ifndef _WX_ACCEL_H_BASE_ +#define _WX_ACCEL_H_BASE_ + +#if defined(__WXMSW__) +#include "wx/msw/accel.h" +#elif defined(__WXMOTIF__) +#include "wx/motif/accel.h" +#elif defined(__WXGTK__) +#include "wx/gtk/accel.h" +#elif defined(__WXQT__) +#include "wx/qt/accel.h" +#elif defined(__WXMAC__) +#include "wx/mac/accel.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/accel.h" +#endif + +#endif + // _WX_ACCEL_H_BASE_ diff --git a/include/wx/app.h b/include/wx/app.h index 5bfeb5db30..d454acf6fa 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __APPH_BASE__ -#define __APPH_BASE__ +#ifndef _WX_APP_H_BASE_ +#define _WX_APP_H_BASE_ #ifdef __WXMSW__ class WXDLLEXPORT wxApp; @@ -26,14 +26,17 @@ typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't #if defined(__WXMSW__) #include "wx/msw/app.h" #elif defined(__WXMOTIF__) -#include "wx/xt/app.h" +#include "wx/motif/app.h" #elif defined(__WXQT__) #include "wx/qt/app.h" #elif defined(__WXGTK__) #include "wx/gtk/app.h" +#elif defined(__WXMAC__) +#include "wx/mac/app.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/app.h" #endif - // Having a global instance of this class allows // wxApp to be aware of the app creator function. // wxApp can then call this function to create a new @@ -72,4 +75,4 @@ int main(int argc, char *argv[]) { return wxEntry(argc, argv); } #endif - // __APPH_BASE__ + // _WX_APP_H_BASE_ diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 2d5ad42e0c..f031e7041a 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -1,15 +1,19 @@ -#ifndef __BITMAPH_BASE__ -#define __BITMAPH_BASE__ +#ifndef _WX_BITMAP_H_BASE_ +#define _WX_BITMAP_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/bitmap.h" #elif defined(__WXMOTIF__) -#include "wx/xt/bitmap.h" +#include "wx/motif/bitmap.h" #elif defined(__WXGTK__) #include "wx/gtk/bitmap.h" #elif defined(__WXQT__) #include "wx/qt/bitmap.h" +#elif defined(__WXMAC__) +#include "wx/mac/bitmap.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/bitmap.h" #endif #endif - // __BITMAPH_BASE__ + // _WX_BITMAP_H_BASE_ diff --git a/include/wx/bmpbuttn.h b/include/wx/bmpbuttn.h index 435220473e..2ff65ebbb2 100644 --- a/include/wx/bmpbuttn.h +++ b/include/wx/bmpbuttn.h @@ -1,14 +1,18 @@ -#ifndef __BMPBUTTONH_BASE__ -#define __BMPBUTTONH_BASE__ +#ifndef _WX_BMPBUTTON_H_BASE_ +#define _WX_BMPBUTTON_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/bmpbuttn.h" #elif defined(__WXMOTIF__) -#include "wx/xt/bmpbuttn.h" +#include "wx/motif/bmpbuttn.h" #elif defined(__WXGTK__) #include "wx/gtk/bmpbuttn.h" #elif defined(__WXQT__) #include "wx/qt/bmpbuttn.h" +#elif defined(__WXMAC__) +#include "wx/mac/bmpbuttn.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/bmpbuttn.h" #endif #endif diff --git a/include/wx/brush.h b/include/wx/brush.h index f29460b1c9..e5d99b39a1 100644 --- a/include/wx/brush.h +++ b/include/wx/brush.h @@ -1,15 +1,19 @@ -#ifndef __BRUSHH_BASE__ -#define __BRUSHH_BASE__ +#ifndef _WX_BRUSH_H_BASE_ +#define _WX_BRUSH_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/brush.h" #elif defined(__WXMOTIF__) -#include "wx/xt/brush.h" +#include "wx/motif/brush.h" #elif defined(__WXGTK__) #include "wx/gtk/brush.h" #elif defined(__WXQT__) #include "wx/qt/brush.h" +#elif defined(__WXMAC__) +#include "wx/mac/brush.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/brush.h" #endif #endif - // __BRUSHH_BASE__ + // _WX_BRUSH_H_BASE_ diff --git a/include/wx/button.h b/include/wx/button.h index 096f189abc..454a0a58f6 100644 --- a/include/wx/button.h +++ b/include/wx/button.h @@ -1,15 +1,19 @@ -#ifndef __BUTTONH_BASE__ -#define __BUTTONH_BASE__ +#ifndef _WX_BUTTON_H_BASE_ +#define _WX_BUTTON_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/button.h" #elif defined(__WXMOTIF__) -#include "wx/xt/button.h" +#include "wx/motif/button.h" #elif defined(__WXGTK__) #include "wx/gtk/button.h" #elif defined(__WXQT__) #include "wx/qt/button.h" +#elif defined(__WXMAC__) +#include "wx/mac/button.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/button.h" #endif #endif - // __BUTTONH_BASE__ + // _WX_BUTTON_H_BASE_ diff --git a/include/wx/checkbox.h b/include/wx/checkbox.h index 70451f88a6..47895df8cd 100644 --- a/include/wx/checkbox.h +++ b/include/wx/checkbox.h @@ -1,15 +1,19 @@ -#ifndef __CHECKBOXH_BASE__ -#define __CHECKBOXH_BASE__ +#ifndef _WX_CHECKBOX_H_BASE_ +#define _WX_CHECKBOX_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/checkbox.h" #elif defined(__WXMOTIF__) -#include "wx/xt/checkbox.h" +#include "wx/motif/checkbox.h" #elif defined(__WXGTK__) #include "wx/gtk/checkbox.h" #elif defined(__WXQT__) #include "wx/qt/checkbox.h" +#elif defined(__WXMAC__) +#include "wx/mac/checkbox.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/checkbox.h" #endif #endif - // __CHECKBOXH_BASE__ + // _WX_CHECKBOX_H_BASE_ diff --git a/include/wx/checklst.h b/include/wx/checklst.h new file mode 100644 index 0000000000..96f31e454f --- /dev/null +++ b/include/wx/checklst.h @@ -0,0 +1,19 @@ +#ifndef _WX_CHECKLST_H_BASE_ +#define _WX_CHECKLST_H_BASE_ + +#if defined(__WXMSW__) +#include "wx/msw/checklst.h" +#elif defined(__WXMOTIF__) +#include "wx/motif/checklst.h" +#elif defined(__WXGTK__) +#include "wx/gtk/checklst.h" +#elif defined(__WXQT__) +#include "wx/qt/checklst.h" +#elif defined(__WXMAC__) +#include "wx/mac/checklst.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/checklst.h" +#endif + +#endif + // _WX_CHECKLST_H_BASE_ diff --git a/include/wx/choicdlg.h b/include/wx/choicdlg.h index 88153df70e..52439ffd71 100644 --- a/include/wx/choicdlg.h +++ b/include/wx/choicdlg.h @@ -1,7 +1,7 @@ -#ifndef __CHOICDLGH_BASE__ -#define __CHOICDLGH_BASE__ +#ifndef _WX_CHOICDLG_H_BASE_ +#define _WX_CHOICDLG_H_BASE_ #include "wx/generic/choicdgg.h" #endif - // __CHOICDLGH_BASE__ + // _WX_CHOICDLG_H_BASE_ diff --git a/include/wx/choice.h b/include/wx/choice.h index a6b981d746..1830d779aa 100644 --- a/include/wx/choice.h +++ b/include/wx/choice.h @@ -1,15 +1,19 @@ -#ifndef __CHOICEH_BASE__ -#define __CHOICEH_BASE__ +#ifndef _WX_CHOICE_H_BASE_ +#define _WX_CHOICE_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/choice.h" #elif defined(__WXMOTIF__) -#include "wx/xt/choice.h" +#include "wx/motif/choice.h" #elif defined(__WXGTK__) #include "wx/gtk/choice.h" #elif defined(__WXQT__) #include "wx/qt/choice.h" +#elif defined(__WXMAC__) +#include "wx/mac/choice.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/choice.h" #endif #endif - // __CHOICEH_BASE__ + // _WX_CHOICE_H_BASE_ diff --git a/include/wx/clipbrd.h b/include/wx/clipbrd.h index 91ff846700..c37f46116f 100644 --- a/include/wx/clipbrd.h +++ b/include/wx/clipbrd.h @@ -1,15 +1,19 @@ -#ifndef __CLIPBRDH_BASE__ -#define __CLIPBRDH_BASE__ +#ifndef _WX_CLIPBRD_H_BASE_ +#define _WX_CLIPBRD_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/clipbrd.h" #elif defined(__WXMOTIF__) -#include "wx/xt/clipbrd.h" +#include "wx/motif/clipbrd.h" #elif defined(__WXGTK__) #include "wx/gtk/clipbrd.h" #elif defined(__WXQT__) #include "wx/gtk/clipbrd.h" +#elif defined(__WXMAC__) +#include "wx/mac/clipbrd.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/clipbrd.h" #endif #endif - // __CLIPBRDH_BASE__ + // _WX_CLIPBRD_H_BASE_ diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index bb02f9ec6c..dc4eeb3ee0 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -9,13 +9,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __CMNDATAH_BASE__ -#define __CMNDATAH_BASE__ +#ifndef _WX_CMNDATA_H_BASE_ +#define _WX_CMNDATA_H_BASE_ #ifdef __GNUG__ #pragma interface "cmndata.h" #endif +#include "wx/font.h" +#include "wx/colour.h" + class WXDLLEXPORT wxColourData: public wxObject { DECLARE_DYNAMIC_CLASS(wxColourData) @@ -220,4 +223,4 @@ class WXDLLEXPORT wxPageSetupData: public wxObject #endif - // __CMNDATAH_BASE__ + // _WX_CMNDATA_H_BASE_ diff --git a/include/wx/colordlg.h b/include/wx/colordlg.h index d2453d9a0e..977c8e5bde 100644 --- a/include/wx/colordlg.h +++ b/include/wx/colordlg.h @@ -1,5 +1,5 @@ -#ifndef __COLORDLGH_BASE__ -#define __COLORDLGH_BASE__ +#ifndef _WX_COLORDLG_H_BASE_ +#define _WX_COLORDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/colordlg.h" @@ -9,7 +9,11 @@ #include "wx/generic/colrdlgg.h" #elif defined(__WXQT__) #include "wx/generic/colrdlgg.h" +#elif defined(__WXMAC__) +#include "wx/generic/colrdlgg.h" +#elif defined(__WXSTUBS__) +#include "wx/generic/colrdlgg.h" #endif #endif - // __COLORDLGH_BASE__ + // _WX_COLORDLG_H_BASE_ diff --git a/include/wx/colour.h b/include/wx/colour.h new file mode 100644 index 0000000000..88b50afca5 --- /dev/null +++ b/include/wx/colour.h @@ -0,0 +1,19 @@ +#ifndef _WX_COLOUR_H_BASE_ +#define _WX_COLOUR_H_BASE_ + +#if defined(__WXMSW__) +#include "wx/msw/colour.h" +#elif defined(__WXMOTIF__) +#include "wx/motif/colour.h" +#elif defined(__WXGTK__) +#include "wx/gtk/colour.h" +#elif defined(__WXQT__) +#include "wx/qt/colour.h" +#elif defined(__WXMAC__) +#include "wx/mac/colour.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/colour.h" +#endif + +#endif + // _WX_COLOUR_H_BASE_ diff --git a/include/wx/combobox.h b/include/wx/combobox.h index e5ffb31efc..26512aa0cd 100644 --- a/include/wx/combobox.h +++ b/include/wx/combobox.h @@ -1,15 +1,19 @@ -#ifndef __COMBOBOXH_BASE__ -#define __COMBOBOXH_BASE__ +#ifndef _WX_COMBOBOX_H_BASE_ +#define _WX_COMBOBOX_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/combobox.h" #elif defined(__WXMOTIF__) -#include "wx/xt/combobox.h" +#include "wx/motif/combobox.h" #elif defined(__WXGTK__) #include "wx/gtk/combobox.h" #elif defined(__WXQT__) #include "wx/qt/combobox.h" +#elif defined(__WXMAC__) +#include "wx/mac/combobox.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/combobox.h" #endif #endif - // __COMBOBOXH_BASE__ + // _WX_COMBOBOX_H_BASE_ diff --git a/include/wx/config.h b/include/wx/config.h index f5b1b195eb..6f1adce1c8 100644 --- a/include/wx/config.h +++ b/include/wx/config.h @@ -11,8 +11,8 @@ // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// -#ifndef _wxCONFIG_H -#define _wxCONFIG_H +#ifndef _WX_CONFIG_H_ +#define _WX_CONFIG_H_ #ifdef __GNUG__ #pragma interface "config.h" @@ -237,5 +237,5 @@ private: #define wxConfig wxFileConfig #endif -#endif //_wxCONFIG_H +#endif // _WX_CONFIG_H_ diff --git a/include/wx/control.h b/include/wx/control.h index e6a4b8fed2..e4341393e8 100644 --- a/include/wx/control.h +++ b/include/wx/control.h @@ -1,15 +1,19 @@ -#ifndef __CONTROLH_BASE__ -#define __CONTROLH_BASE__ +#ifndef _WX_CONTROL_H_BASE_ +#define _WX_CONTROL_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/control.h" #elif defined(__WXMOTIF__) -#include "wx/xt/control.h" +#include "wx/motif/control.h" #elif defined(__WXGTK__) #include "wx/gtk/control.h" #elif defined(__WXQT__) #include "wx/qt/control.h" +#elif defined(__WXMAC__) +#include "wx/mac/control.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/control.h" #endif #endif - // __CONTROLH_BASE__ + // _WX_CONTROL_H_BASE_ diff --git a/include/wx/cursor.h b/include/wx/cursor.h index f9dafb81a7..4ebe73a971 100644 --- a/include/wx/cursor.h +++ b/include/wx/cursor.h @@ -1,15 +1,19 @@ -#ifndef __CURSORH_BASE__ -#define __CURSORH_BASE__ +#ifndef _WX_CURSOR_H_BASE_ +#define _WX_CURSOR_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/cursor.h" #elif defined(__WXMOTIF__) -#include "wx/xt/cursor.h" +#include "wx/motif/cursor.h" #elif defined(__WXGTK__) #include "wx/gtk/cursor.h" #elif defined(__WXQT__) #include "wx/qt/cursor.h" +#elif defined(__WXMAC__) +#include "wx/mac/cursor.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/cursor.h" #endif #endif - // __CURSORH_BASE__ + // _WX_CURSOR_H_BASE_ diff --git a/include/wx/date.h b/include/wx/date.h index d0a47dc705..d21a53eb00 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -10,8 +10,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXDATEH__ -#define __WXDATEH__ +#ifndef _WX_DATE_H_ +#define _WX_DATE_H_ #ifdef __GNUG__ #pragma interface "date.h" @@ -128,4 +128,4 @@ class WXDLLEXPORT wxDate: public wxObject #endif #endif - // __WXDATEH__ + // _WX_DATE_H_ diff --git a/include/wx/datstrm.h b/include/wx/datstrm.h index 8d5b759dcd..de87a83323 100644 --- a/include/wx/datstrm.h +++ b/include/wx/datstrm.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __DATSTREAMH__ -#define __DATSTREAMH__ +#ifndef _WX_DATSTREAM_H_ +#define _WX_DATSTREAM_H_ #ifdef __GNUG__ #pragma interface "datstrm.h" @@ -45,4 +45,4 @@ class wxDataOutputStream: public wxFilterOutputStream { }; #endif - // __DATSTREAMH__ + // _WX_DATSTREAM_H_ diff --git a/include/wx/dc.h b/include/wx/dc.h index b8a6344145..2cf32f30d2 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1,15 +1,19 @@ -#ifndef __DCH_BASE__ -#define __DCH_BASE__ +#ifndef _WX_DC_H_BASE_ +#define _WX_DC_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dc.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dc.h" +#include "wx/motif/dc.h" #elif defined(__WXGTK__) #include "wx/gtk/dc.h" #elif defined(__WXQT__) #include "wx/qt/dc.h" +#elif defined(__WXMAC__) +#include "wx/mac/dc.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dc.h" #endif #endif - // __DCH_BASE__ + // _WX_DC_H_BASE_ diff --git a/include/wx/dcclient.h b/include/wx/dcclient.h index cdd08bc9bd..557e2f4dc2 100644 --- a/include/wx/dcclient.h +++ b/include/wx/dcclient.h @@ -1,15 +1,19 @@ -#ifndef __DCCLIENTH_BASE__ -#define __DCCLIENTH_BASE__ +#ifndef _WX_DCCLIENT_H_BASE_ +#define _WX_DCCLIENT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dcclient.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dcclient.h" +#include "wx/motif/dcclient.h" #elif defined(__WXGTK__) #include "wx/gtk/dcclient.h" #elif defined(__WXQT__) #include "wx/qt/dcclient.h" +#elif defined(__WXMAC__) +#include "wx/mac/dcclient.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dcclient.h" #endif #endif - // __DCCLIENTH_BASE__ + // _WX_DCCLIENT_H_BASE_ diff --git a/include/wx/dcmemory.h b/include/wx/dcmemory.h index f2cb35f398..84a814c4d6 100644 --- a/include/wx/dcmemory.h +++ b/include/wx/dcmemory.h @@ -1,15 +1,19 @@ -#ifndef __DCMEMORYH_BASE__ -#define __DCMEMORYH_BASE__ +#ifndef _WX_DCMEMORY_H_BASE_ +#define _WX_DCMEMORY_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dcmemory.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dcmemory.h" +#include "wx/motif/dcmemory.h" #elif defined(__WXGTK__) #include "wx/gtk/dcmemory.h" #elif defined(__WXQT__) #include "wx/qt/dcmemory.h" +#elif defined(__WXMAC__) +#include "wx/mac/dcmemory.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dcmemory.h" #endif #endif - // __DCMEMORYH_BASE__ + // _WX_DCMEMORY_H_BASE_ diff --git a/include/wx/dcprint.h b/include/wx/dcprint.h index cad351f7d8..532323e9d2 100644 --- a/include/wx/dcprint.h +++ b/include/wx/dcprint.h @@ -1,9 +1,9 @@ -#ifndef __DCPRINTH_BASE__ -#define __DCPRINTH_BASE__ +#ifndef _WX_DCPRINT_H_BASE_ +#define _WX_DCPRINT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dcprint.h" #endif #endif - // __DCPRINTH_BASE__ + // _WX_DCPRINT_H_BASE_ diff --git a/include/wx/dcscreen.h b/include/wx/dcscreen.h index 7a5c047955..bd35719499 100644 --- a/include/wx/dcscreen.h +++ b/include/wx/dcscreen.h @@ -1,15 +1,19 @@ -#ifndef __DCSCREENH_BASE__ -#define __DCSCREENH_BASE__ +#ifndef _WX_DCSCREEN_H_BASE_ +#define _WX_DCSCREEN_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dcscreen.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dcscreen.h" +#include "wx/motif/dcscreen.h" #elif defined(__WXGTK__) #include "wx/gtk/dcscreen.h" #elif defined(__WXQT__) #include "wx/qt/dcscreen.h" +#elif defined(__WXMAC__) +#include "wx/mac/dcscreen.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dcscreen.h" #endif #endif - // __DCSCREENH_BASE__ + // _WX_DCSCREEN_H_BASE_ diff --git a/include/wx/dde.h b/include/wx/dde.h index 38848db1b3..908fb09388 100644 --- a/include/wx/dde.h +++ b/include/wx/dde.h @@ -1,15 +1,19 @@ -#ifndef __DDEH_BASE__ -#define __DDEH_BASE__ +#ifndef _WX_DDE_H_BASE_ +#define _WX_DDE_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dde.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dde.h" +#include "wx/motif/dde.h" #elif defined(__WXGTK__) #include "wx/gtk/dde.h" #elif defined(__WXQT__) #include "wx/qt/dde.h" +#elif defined(__WXMAC__) +#include "wx/mac/dde.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dde.h" #endif #endif - // __DDEH_BASE__ + // _WX_DDE_H_BASE_ diff --git a/include/wx/debug.h b/include/wx/debug.h index 2f65767f4e..2c778e0a7f 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXDEBUGH__ -#define __WXDEBUGH__ +#ifndef _WX_DEBUG_H_ +#define _WX_DEBUG_H_ #include @@ -99,5 +99,5 @@ //@} -#endif // __WXDEBUGH__ +#endif // _WX_DEBUG_H_ diff --git a/include/wx/defs.h b/include/wx/defs.h index 092b883901..456eb162ed 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __DEFSH__ -#define __DEFSH__ +#ifndef _WX_DEFS_H_ +#define _WX_DEFS_H_ #ifdef __GNUG__ #pragma interface "defs.h" @@ -48,14 +48,10 @@ #endif #if defined(__WXMOTIF__) # define __X__ -#elif defined(__WXMSW__) || defined(__WINDOWS_386__) || defined(__NT__) || defined(__MSDOS__) -# ifndef __WXMSW__ -# define __WXMSW__ -# endif #endif // wxWindows checks for WIN32, not __WIN32__ -#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__)) +#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__)) #define __WIN32__ #endif @@ -71,11 +67,11 @@ #if defined(__WXMSW__) && defined(__X__) # error "Target can't be both X and Windows" #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \ - !defined(__MAC__) && !defined(__X__) && !defined(__WXQT__) -#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__MAC__|__QT__]" + !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__) +#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]" #endif -#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) +#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__) // Bool is now obsolete, use bool instead // typedef int Bool; @@ -236,10 +232,6 @@ enum ErrCode #endif #ifndef __UNIX__ // Windows - #ifndef __WXMSW__ - #define __WXMSW__ - #endif - #if defined(_MSC_VER) #define __VISUALC__ #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) @@ -257,7 +249,7 @@ enum ErrCode #elif defined(__WXMSW__) #define FILE_PATH_SEPARATOR ('\\') #else - #error "don't know path separator for this platform" + #define FILE_PATH_SEPARATOR ('/') #endif // ---------------------------------------------------------------------------- @@ -776,20 +768,23 @@ enum _Virtual_keycodes { // OS mnemonics -- Identify the running OS (useful for Windows) // [Not all platforms are currently available or supported] enum { - wxCURSES, + wxUNKNOWN_PLATFORM, + wxCURSES, // Text-only CURSES wxXVIEW_X, // Sun's XView OpenLOOK toolkit wxMOTIF_X, // OSF Motif 1.x.x - wxCOSE_X, // OSF Common Desktop Environment + wxCOSE_X, // OSF Common Desktop Environment wxNEXTSTEP, // NeXTStep wxMACINTOSH, // Apple System 7 - wxGEOS, // GEOS - wxOS2_PM, // OS/2 Workplace + wxGTK, // GTK + wxQT, // Qt + wxGEOS, // GEOS + wxOS2_PM, // OS/2 Workplace wxWINDOWS, // Windows or WfW wxPENWINDOWS, // Windows for Pen Computing wxWINDOWS_NT, // Windows NT - wxWIN32S, // Windows 32S API - wxWIN95, // Windows 95 - wxWIN386 // Watcom 32-bit supervisor modus + wxWIN32S, // Windows 32S API + wxWIN95, // Windows 95 + wxWIN386 // Watcom 32-bit supervisor modus }; // Printing @@ -882,4 +877,4 @@ typedef int (__stdcall *WXFARPROC)(); #endif #endif - // __WXDEFSH__ + // _WX_DEFS_H_ diff --git a/include/wx/dialog.h b/include/wx/dialog.h index 19856d0663..823d2d4573 100644 --- a/include/wx/dialog.h +++ b/include/wx/dialog.h @@ -1,15 +1,19 @@ -#ifndef __DIALOGH_BASE__ -#define __DIALOGH_BASE__ +#ifndef _WX_DIALOG_H_BASE_ +#define _WX_DIALOG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dialog.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dialog.h" +#include "wx/motif/dialog.h" #elif defined(__WXGTK__) #include "wx/gtk/dialog.h" #elif defined(__WXQT__) #include "wx/qt/dialog.h" +#elif defined(__WXMAC__) +#include "wx/mac/dialog.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dialog.h" #endif #endif - // __DIALOGH_BASE__ + // _WX_DIALOG_H_BASE_ diff --git a/include/wx/dirdlg.h b/include/wx/dirdlg.h index 5d601368cf..d22d17f544 100644 --- a/include/wx/dirdlg.h +++ b/include/wx/dirdlg.h @@ -1,15 +1,19 @@ -#ifndef __DIRDLGH_BASE__ -#define __DIRDLGH_BASE__ +#ifndef _WX_DIRDLG_H_BASE_ +#define _WX_DIRDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/dirdlg.h" #elif defined(__WXMOTIF__) -#include "wx/xt/dirdlg.h" +#include "wx/motif/dirdlg.h" #elif defined(__WXGTK__) #include "wx/gtk/dirdlg.h" #elif defined(__WXQT__) #include "wx/qt/dirdlg.h" +#elif defined(__WXMAC__) +#include "wx/mac/dirdlg.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dirdlg.h" #endif #endif - // __DIRDLGH_BASE__ + // _WX_DIRDLG_H_BASE_ diff --git a/include/wx/dnd.h b/include/wx/dnd.h index c9fea4c167..84a61155ec 100644 --- a/include/wx/dnd.h +++ b/include/wx/dnd.h @@ -1,5 +1,5 @@ -#ifndef __DNDH_BASE__ -#define __DNDH_BASE__ +#ifndef _WX_DND_H_BASE_ +#define _WX_DND_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/ole/dropsrc.h" @@ -10,7 +10,11 @@ #include "wx/gtk/dnd.h" #elif defined(__WXQT__) #include "wx/qt/dnd.h" +#elif defined(__WXMAC__) +#include "wx/mac/dnd.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/dnd.h" #endif #endif - // __DNDH_BASE__ + // _WX_DND_H_BASE_ diff --git a/include/wx/docview.h b/include/wx/docview.h index add8ef0e19..45ed1c3be5 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __DOCH__ -#define __DOCH__ +#ifndef _WX_DOCH__ +#define _WX_DOCH__ #ifdef __GNUG__ #pragma interface "docview.h" diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index a1d3c79464..428048ce14 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -1,5 +1,5 @@ -#ifndef __DYNLIB_H__ -#define __DYNLIB_H__ +#ifndef _WX_DYNLIB_H__ +#define _WX_DYNLIB_H__ #ifdef __GNUG__ #pragma interface diff --git a/include/wx/event.h b/include/wx/event.h index e86f5afd25..418cfd5aae 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __EVENTH__ -#define __EVENTH__ +#ifndef _WX_EVENTH__ +#define _WX_EVENTH__ #ifdef __GNUG__ #pragma interface "event.h" @@ -395,6 +395,7 @@ class WXDLLEXPORT wxScrollEvent: public wxCommandEvent wxEVT_NC_RIGHT_DCLICK, */ +class WXDLLEXPORT wxDC; class WXDLLEXPORT wxMouseEvent: public wxEvent { DECLARE_DYNAMIC_CLASS(wxMouseEvent) @@ -1268,4 +1269,4 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, NULL },\ #endif - // __EVENTH__ + // _WX_EVENTH__ diff --git a/include/wx/expr.h b/include/wx/expr.h index d19d8580b1..418ed1b64b 100644 --- a/include/wx/expr.h +++ b/include/wx/expr.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __EXPRH__ -#define __EXPRH__ +#ifndef _WX_EXPRH__ +#define _WX_EXPRH__ #include #include @@ -126,4 +126,4 @@ void syntax_error(); #endif #endif - // __EXPRH__ + // _WX_EXPRH__ diff --git a/include/wx/file.h b/include/wx/file.h index 656ae52585..c422a034ef 100644 --- a/include/wx/file.h +++ b/include/wx/file.h @@ -175,4 +175,4 @@ private: }; #endif - // __FILEH__ + // _WX_FILEH__ diff --git a/include/wx/filedlg.h b/include/wx/filedlg.h index 47ed6c70d4..cfb3737190 100644 --- a/include/wx/filedlg.h +++ b/include/wx/filedlg.h @@ -1,15 +1,19 @@ -#ifndef __FILEDLGH_BASE__ -#define __FILEDLGH_BASE__ +#ifndef _WX_FILEDLG_H_BASE_ +#define _WX_FILEDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/filedlg.h" #elif defined(__WXMOTIF__) -#include "wx/xt/filedlg.h" +#include "wx/motif/filedlg.h" #elif defined(__WXGTK__) #include "wx/gtk/filedlg.h" #elif defined(__WXQT__) #include "wx/qt/filedlg.h" +#elif defined(__WXMAC__) +#include "wx/mac/filedlg.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/filedlg.h" #endif #endif - // __FILEDLGH_BASE__ + // _WX_FILEDLG_H_BASE_ diff --git a/include/wx/filefn.h b/include/wx/filefn.h index f46246add7..eb3eb478f6 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __FILEFNH__ -#define __FILEFNH__ +#ifndef _FILEFN_H_ +#define _FILEFN_H_ #ifdef __GNUG__ #pragma interface "filefn.h" @@ -204,5 +204,5 @@ class WXDLLEXPORT wxPathList: public wxStringList }; #endif - // __FILEFNH__ + // _WX_FILEFN_H_ diff --git a/include/wx/font.h b/include/wx/font.h index 84f67231a9..165c9c9f06 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -1,15 +1,19 @@ -#ifndef __FONTH_BASE__ -#define __FONTH_BASE__ +#ifndef _WX_FONT_H_BASE_ +#define _WX_FONT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/font.h" #elif defined(__WXMOTIF__) -#include "wx/xt/font.h" +#include "wx/motif/font.h" #elif defined(__WXGTK__) #include "wx/gtk/font.h" #elif defined(__WXQT__) #include "wx/qt/font.h" +#elif defined(__WXMAC__) +#include "wx/mac/font.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/font.h" #endif #endif - // __FONTH_BASE__ + // _WX_FONT_H_BASE_ diff --git a/include/wx/fontdlg.h b/include/wx/fontdlg.h index 5aeb8cf6c9..20445e8842 100644 --- a/include/wx/fontdlg.h +++ b/include/wx/fontdlg.h @@ -1,5 +1,5 @@ -#ifndef __FONTDLGH_BASE__ -#define __FONTDLGH_BASE__ +#ifndef _WX_FONTDLG_H_BASE_ +#define _WX_FONTDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/fontdlg.h" @@ -15,7 +15,15 @@ #include "wx/generic/fontdlgg.h" # define wxFontDialog wxGenericFontDialog # define classwxFontDialog classwxGenericFontDialog +#elif defined(__WXMAC__) +#include "wx/generic/fontdlgg.h" +# define wxFontDialog wxGenericFontDialog +# define classwxFontDialog classwxGenericFontDialog +#elif defined(__WXSTUBS__) +#include "wx/generic/fontdlgg.h" +# define wxFontDialog wxGenericFontDialog +# define classwxFontDialog classwxGenericFontDialog #endif #endif - // __FONTDLGH_BASE__ + // _WX_FONTDLG_H_BASE_ diff --git a/include/wx/frame.h b/include/wx/frame.h index 2deb5f7d7f..329561fd9a 100644 --- a/include/wx/frame.h +++ b/include/wx/frame.h @@ -1,15 +1,19 @@ -#ifndef __FRAMEH_BASE__ -#define __FRAMEH_BASE__ +#ifndef _WX_FRAME_H_BASE_ +#define _WX_FRAME_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/frame.h" #elif defined(__WXMOTIF__) -#include "wx/xt/frame.h" +#include "wx/motif/frame.h" #elif defined(__WXGTK__) #include "wx/gtk/frame.h" #elif defined(__WXQT__) #include "wx/qt/frame.h" +#elif defined(__WXMAC__) +#include "wx/mac/frame.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/frame.h" #endif #endif - // __FRAMEH_BASE__ + // _WX_FRAME_H_BASE_ diff --git a/include/wx/fstream.h b/include/wx/fstream.h index 530961d387..eab87dab21 100644 --- a/include/wx/fstream.h +++ b/include/wx/fstream.h @@ -8,8 +8,8 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXFSTREAM_H__ -#define __WXFSTREAM_H__ +#ifndef _WX_WXFSTREAM_H__ +#define _WX_WXFSTREAM_H__ #include #include diff --git a/include/wx/gauge.h b/include/wx/gauge.h index eeaba1a2c6..abf8a1f7e0 100644 --- a/include/wx/gauge.h +++ b/include/wx/gauge.h @@ -1,15 +1,19 @@ -#ifndef __GAUGEH_BASE__ -#define __GAUGEH_BASE__ +#ifndef _WX_GAUGE_H_BASE_ +#define _WX_GAUGE_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/gauge.h" #elif defined(__WXMOTIF__) -#include "wx/xt/gauge.h" +#include "wx/motif/gauge.h" #elif defined(__WXGTK__) #include "wx/gtk/gauge.h" #elif defined(__WXQT__) #include "wx/qt/gauge.h" +#elif defined(__WXMAC__) +#include "wx/mac/gauge.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/gauge.h" #endif #endif - // __GAUGEH_BASE__ + // _WX_GAUGE_H_BASE_ diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 93320b4b3f..17517cce8a 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __GDICMNH__ -#define __GDICMNH__ +#ifndef _WX_GDICMNH__ +#define _WX_GDICMNH__ #ifdef __GNUG__ #pragma interface "gdicmn.h" @@ -19,17 +19,9 @@ #include "wx/object.h" #include "wx/list.h" #include "wx/hash.h" +#include "wx/string.h" #include "wx/setup.h" - -#ifdef __WXMSW__ -#include "wx/msw/colour.h" -#elif defined(__WXMOTIF__) -#include "wx/xt/colour.h" -#elif defined(__WXGTK__) -#include "wx/gtk/colour.h" -#elif defined(__WXQT__) -#include "wx/qt/colour.h" -#endif +#include "wx/colour.h" // Standard cursors typedef enum { @@ -192,6 +184,8 @@ class WXDLLEXPORT wxPalette; class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxIcon; +class WXDLLEXPORT wxColour; +class WXDLLEXPORT wxString; // Management of pens, brushes and fonts class WXDLLEXPORT wxPenList: public wxList @@ -359,4 +353,4 @@ class WXDLLEXPORT wxResourceCache: public wxList }; #endif - // __GDICMNH__ + // _WX_GDICMNH__ diff --git a/include/wx/gdiobj.h b/include/wx/gdiobj.h index d018a15bce..39762ec749 100644 --- a/include/wx/gdiobj.h +++ b/include/wx/gdiobj.h @@ -1,15 +1,19 @@ -#ifndef __GDIOBJH_BASE__ -#define __GDIOBJH_BASE__ +#ifndef _WX_GDIOBJ_H_BASE_ +#define _WX_GDIOBJ_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/gdiobj.h" #elif defined(__WXMOTIF__) -#include "wx/xt/gdiobj.h" +#include "wx/motif/gdiobj.h" #elif defined(__WXGTK__) #include "wx/gtk/gdiobj.h" #elif defined(__WXQT__) #include "wx/qt/gdiobj.h" +#elif defined(__WXMAC__) +#include "wx/mac/gdiobj.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/gdiobj.h" #endif #endif - // __GDIOBJH_BASE__ + // _WX_GDIOBJ_H_BASE_ diff --git a/include/wx/grid.h b/include/wx/grid.h index 6d55e0889b..668f69a3e3 100644 --- a/include/wx/grid.h +++ b/include/wx/grid.h @@ -1,5 +1,5 @@ -#ifndef __GRIDH_BASE__ -#define __GRIDH_BASE__ +#ifndef _WX_GRID_H_BASE_ +#define _WX_GRID_H_BASE_ #include "wx/generic/gridg.h" @@ -8,4 +8,4 @@ #endif #endif - // __GRIDH_BASE__ + // _WX_GRID_H_BASE_ diff --git a/include/wx/hash.h b/include/wx/hash.h index a1ae912a67..e154046cf5 100644 --- a/include/wx/hash.h +++ b/include/wx/hash.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXHASHH__ -#define __WXHASHH__ +#ifndef _WX_WXHASHH__ +#define _WX_WXHASHH__ #ifdef __GNUG__ #pragma interface "hash.h" @@ -95,4 +95,4 @@ class WXDLLEXPORT wxHashTable: public wxObject }; #endif - // __WXHASHH__ + // _WX_WXHASHH__ diff --git a/include/wx/help.h b/include/wx/help.h index 0fe92b70fd..71bff121f6 100644 --- a/include/wx/help.h +++ b/include/wx/help.h @@ -1,5 +1,5 @@ -#ifndef __HELPH_BASE__ -#define __HELPH_BASE__ +#ifndef _WX_HELP_H_BASE_ +#define _WX_HELP_H_BASE_ #ifdef __WXMSW__ #include "wx/msw/helpwin.h" @@ -21,4 +21,4 @@ #endif #endif - // __HELPH_BASE__ + // _WX_HELP_H_BASE_ diff --git a/include/wx/helpbase.h b/include/wx/helpbase.h index 1e7752f5c5..b1ee1c693b 100644 --- a/include/wx/helpbase.h +++ b/include/wx/helpbase.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __HELPBASEH__ -#define __HELPBASEH__ +#ifndef _WX_HELPBASEH__ +#define _WX_HELPBASEH__ #ifdef __GNUG__ #pragma interface "helpbase.h" @@ -48,4 +48,4 @@ class WXDLLEXPORT wxHelpControllerBase: public wxObject #endif // USE_HELP #endif - // __HELPBASEH__ + // _WX_HELPBASEH__ diff --git a/include/wx/helphtml.h b/include/wx/helphtml.h index 345c71cac0..20ce2789ab 100644 --- a/include/wx/helphtml.h +++ b/include/wx/helphtml.h @@ -1,7 +1,7 @@ -#ifndef __HELPHTMLH_BASE__ -#define __HELPHTMLH_BASE__ +#ifndef _WX_HELPHTML_H_BASE_ +#define _WX_HELPHTML_H_BASE_ #include "wx/generic/helphtml.h" #endif - // __HELPHTMLH_BASE__ + // _WX_HELPHTML_H_BASE_ diff --git a/include/wx/helpwin.h b/include/wx/helpwin.h index b855c1fb99..5743288dad 100644 --- a/include/wx/helpwin.h +++ b/include/wx/helpwin.h @@ -1,7 +1,7 @@ -#ifndef __HELPWINH_BASE__ -#define __HELPWINH_BASE__ +#ifndef _WX_HELPWIN_H_BASE_ +#define _WX_HELPWIN_H_BASE_ #include "wx/msw/helpwin.h" #endif - // __HELPWINH_BASE__ + // _WX_HELPWIN_H_BASE_ diff --git a/include/wx/helpxlp.h b/include/wx/helpxlp.h index 877d908823..b9f6af78eb 100644 --- a/include/wx/helpxlp.h +++ b/include/wx/helpxlp.h @@ -1,7 +1,7 @@ -#ifndef __HELPXLPH_BASE__ -#define __HELPXLPH_BASE__ +#ifndef _WX_HELPXLP_H_BASE_ +#define _WX_HELPXLP_H_BASE_ #include "wx/generic/helpxlp.h" #endif - // __HELPXLPH_BASE__ + // _WX_HELPXLP_H_BASE_ diff --git a/include/wx/icon.h b/include/wx/icon.h index b5df2eff38..2baded96c3 100644 --- a/include/wx/icon.h +++ b/include/wx/icon.h @@ -1,15 +1,19 @@ -#ifndef __ICONH_BASE__ -#define __ICONH_BASE__ +#ifndef _WX_ICON_H_BASE_ +#define _WX_ICON_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/icon.h" #elif defined(__WXMOTIF__) -#include "wx/xt/icon.h" +#include "wx/motif/icon.h" #elif defined(__WXGTK__) #include "wx/gtk/icon.h" #elif defined(__WXQT__) #include "wx/qt/icon.h" +#elif defined(__WXMAC__) +#include "wx/mac/icon.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/icon.h" #endif #endif - // __ICONH_BASE__ + // _WX_ICON_H_BASE_ diff --git a/include/wx/imaglist.h b/include/wx/imaglist.h index 69062ef67e..e62b821a80 100644 --- a/include/wx/imaglist.h +++ b/include/wx/imaglist.h @@ -1,5 +1,5 @@ -#ifndef __IMAGLISTH_BASE__ -#define __IMAGLISTH_BASE__ +#ifndef _WX_IMAGLIST_H_BASE_ +#define _WX_IMAGLIST_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/imaglist.h" @@ -9,7 +9,11 @@ #include "wx/generic/imaglist.h" #elif defined(__WXQT__) #include "wx/generic/imaglist.h" +#elif defined(__WXMAC__) +#include "wx/generic/imaglist.h" +#elif defined(__WXSTUBS__) +#include "wx/generic/imaglist.h" #endif #endif - // __IMAGLISTH_BASE__ + // _WX_IMAGLIST_H_BASE_ diff --git a/include/wx/intl.h b/include/wx/intl.h index d60fd47f90..e6a597ed45 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -125,4 +125,4 @@ inline WXDLLEXPORT const char *wxGetTranslation(const char *sz) } #endif - // __INTLH__ + // _WX_INTLH__ diff --git a/include/wx/ipcbase.h b/include/wx/ipcbase.h index 44c594b45d..d4cbe08f04 100644 --- a/include/wx/ipcbase.h +++ b/include/wx/ipcbase.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __IPCBASEH__ -#define __IPCBASEH__ +#ifndef _WX_IPCBASEH__ +#define _WX_IPCBASEH__ #ifdef __GNUG__ #pragma interface "ipcbase.h" @@ -94,4 +94,4 @@ class WXDLLEXPORT wxClientBase: public wxObject }; #endif - // __IPCBASEH__ + // _WX_IPCBASEH__ diff --git a/include/wx/joystick.h b/include/wx/joystick.h index b0ff1ef04d..5391c9c5c3 100644 --- a/include/wx/joystick.h +++ b/include/wx/joystick.h @@ -1,12 +1,17 @@ -#ifndef __JOYSTICKH_BASE__ -#define __JOYSTICKH_BASE__ +#ifndef _WX_JOYSTICK_H_BASE_ +#define _WX_JOYSTICK_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/joystick.h" #elif defined(__WXMOTIF__) +#include "wx/motif/joystick.h" #elif defined(__WXGTK__) #include "wx/gtk/joystick.h" +#elif defined(__WXMAC__) +#include "wx/mac/joystick.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/joystick.h" #endif #endif - // __JOYSTICKH_BASE__ + // _WX_JOYSTICK_H_BASE_ diff --git a/include/wx/layout.h b/include/wx/layout.h index 2f525bb1f0..a03b1d72c3 100644 --- a/include/wx/layout.h +++ b/include/wx/layout.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __LAYOUTH__ -#define __LAYOUTH__ +#ifndef _WX_LAYOUTH__ +#define _WX_LAYOUTH__ #ifdef __GNUG__ #pragma interface "layout.h" @@ -306,4 +306,4 @@ class WXDLLEXPORT wxSpacingSizer: public wxSizer }; #endif - // __LAYOUTH__ + // _WX_LAYOUTH__ diff --git a/include/wx/list.h b/include/wx/list.h index def8cc1713..cbf6740b8c 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __LISTH__ -#define __LISTH__ +#ifndef _WX_LISTH__ +#define _WX_LISTH__ #ifdef __GNUG__ #pragma interface "list.h" @@ -140,4 +140,4 @@ class WXDLLEXPORT wxStringList: public wxList }; #endif - // __LISTH__ + // _WX_LISTH__ diff --git a/include/wx/listbox.h b/include/wx/listbox.h index 628ee83664..9d8a3460db 100644 --- a/include/wx/listbox.h +++ b/include/wx/listbox.h @@ -1,15 +1,19 @@ -#ifndef __LISTBOXH_BASE__ -#define __LISTBOXH_BASE__ +#ifndef _WX_LISTBOX_H_BASE_ +#define _WX_LISTBOX_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/listbox.h" #elif defined(__WXMOTIF__) -#include "wx/xt/listbox.h" +#include "wx/motif/listbox.h" #elif defined(__WXGTK__) #include "wx/gtk/listbox.h" #elif defined(__WXQT__) #include "wx/qt/listbox.h" +#elif defined(__WXMAC__) +#include "wx/mac/listbox.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/listbox.h" #endif #endif - // __LISTBOXH_BASE__ + // _WX_LISTBOX_H_BASE_ diff --git a/include/wx/listctrl.h b/include/wx/listctrl.h index 51b65a8e5e..d1fd4f9043 100644 --- a/include/wx/listctrl.h +++ b/include/wx/listctrl.h @@ -1,5 +1,5 @@ -#ifndef __LISTCTRLH_BASE__ -#define __LISTCTRLH_BASE__ +#ifndef _WX_LISTCTRL_H_BASE_ +#define _WX_LISTCTRL_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/listctrl.h" @@ -9,7 +9,11 @@ #include "wx/generic/listctrl.h" #elif defined(__WXQT__) #include "wx/generic/listctrl.h" +#elif defined(__WXMAC__) +#include "wx/generic/listctrl.h" +#elif defined(__WXSTUBS__) +#include "wx/generic/listctrl.h" #endif #endif - // __LISTCTRLH_BASE__ + // _WX_LISTCTRL_H_BASE_ diff --git a/include/wx/log.h b/include/wx/log.h index 50918b2c02..85ec698967 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __LOGH__ -#define __LOGH__ +#ifndef _WX_LOG_H_ +#define _WX_LOG_H_ #ifdef __GNUG__ #pragma interface "log.h" @@ -159,6 +159,7 @@ private: }; // log everything to an "ostream", cerr by default +class ostream; class WXDLLEXPORT wxLogStream : public wxLog { public: @@ -376,4 +377,4 @@ const char* WXDLLEXPORT wxSysErrorMsg(unsigned long nErrCode = 0); inline void wxLogLastError(const char *) { } #endif //debug/!debug -#endif //__LOGH__ +#endif // _WX_LOG_H_ diff --git a/include/wx/matrix.h b/include/wx/matrix.h index 8969893444..8204b66f39 100644 --- a/include/wx/matrix.h +++ b/include/wx/matrix.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __MATRIXH__ -#define __MATRIXH__ +#ifndef _WX_MATRIXH__ +#define _WX_MATRIXH__ #ifdef __GNUG__ #pragma interface "matrix.h" @@ -141,4 +141,4 @@ inline double wxCalculateDet(double a11, double a21, double a12, double a22) } #endif - // __MATRIXH__ + // _WX_MATRIXH__ diff --git a/include/wx/mdi.h b/include/wx/mdi.h index 1ecf988497..1ce5e5555c 100644 --- a/include/wx/mdi.h +++ b/include/wx/mdi.h @@ -1,15 +1,19 @@ -#ifndef __MDIH_BASE__ -#define __MDIH_BASE__ +#ifndef _WX_MDI_H_BASE_ +#define _WX_MDI_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/mdi.h" #elif defined(__WXMOTIF__) -#include "wx/xt/mdi.h" +#include "wx/motif/mdi.h" #elif defined(__WXGTK__) #include "wx/gtk/mdi.h" #elif defined(__WXQT__) #include "wx/qt/mdi.h" +#elif defined(__WXMAC__) +#include "wx/mac/mdi.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/mdi.h" #endif #endif - // __MDIH_BASE__ + // _WX_MDI_H_BASE_ diff --git a/include/wx/memory.h b/include/wx/memory.h index b0ab9a02df..9a17ad3ac9 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __MEMORYH__ -#define __MEMORYH__ +#ifndef _WX_MEMORYH__ +#define _WX_MEMORYH__ #ifdef __GNUG__ #pragma interface "memory.h" @@ -275,5 +275,5 @@ inline void wxTraceLevel(int WXUNUSED(level), const char *WXUNUSED(fmt)) {} #endif // WXDEBUG #endif - // __MEMORYH__ + // _WX_MEMORYH__ diff --git a/include/wx/menu.h b/include/wx/menu.h index a448501bb8..2d0ce9798b 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -1,15 +1,19 @@ -#ifndef __MENUH_BASE__ -#define __MENUH_BASE__ +#ifndef _WX_MENU_H_BASE_ +#define _WX_MENU_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/menu.h" #elif defined(__WXMOTIF__) -#include "wx/xt/menu.h" +#include "wx/motif/menu.h" #elif defined(__WXGTK__) #include "wx/gtk/menu.h" #elif defined(__WXQT__) #include "wx/qt/menu.h" +#elif defined(__WXMAC__) +#include "wx/mac/menu.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/menu.h" #endif #endif - // __MENUH_BASE__ + // _WX_MENU_H_BASE_ diff --git a/include/wx/metafile.h b/include/wx/metafile.h index d3eefe4240..dab13f19f2 100644 --- a/include/wx/metafile.h +++ b/include/wx/metafile.h @@ -1,9 +1,9 @@ -#ifndef __METAFILEH_BASE__ -#define __METAFILEH_BASE__ +#ifndef _WX_METAFILE_H_BASE_ +#define _WX_METAFILE_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/metafile.h" #endif #endif - // __METAFILEH_BASE__ + // _WX_METAFILE_H_BASE_ diff --git a/include/wx/minifram.h b/include/wx/minifram.h index 7a00d5d74d..3b45d33a52 100644 --- a/include/wx/minifram.h +++ b/include/wx/minifram.h @@ -1,13 +1,17 @@ -#ifndef __MINIFRAMH_BASE__ -#define __MINIFRAMH_BASE_ +#ifndef _WX_MINIFRAM_H_BASE_ +#define _WX_MINIFRAMH_BASE_ #if defined(__WXMSW__) #include "wx/msw/minifram.h" #elif defined(__WXMOTIF__) -#include "wx/xt/minifram.h" +#include "wx/motif/minifram.h" #elif defined(__WXGTK__) #include "wx/gtk/minifram.h" +#elif defined(__WXMAC__) +#include "wx/mac/minifram.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/minifram.h" #endif #endif - // __MINIFRAMH_BASE__ + // _WX_MINIFRAM_H_BASE_ diff --git a/include/wx/module.h b/include/wx/module.h index aaa9354269..c91f0e126a 100644 --- a/include/wx/module.h +++ b/include/wx/module.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __MODULEH__ -#define __MODULEH__ +#ifndef _WX_MODULEH__ +#define _WX_MODULEH__ #ifdef __GNUG__ #pragma interface "module.h" diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 3ac1c7f9f8..81aba4972c 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -1,5 +1,5 @@ -#ifndef __MSGDLGH_BASE__ -#define __MSGDLGH_BASE__ +#ifndef _WX_MSGDLG_H_BASE_ +#define _WX_MSGDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/msgdlg.h" @@ -9,7 +9,11 @@ #include "wx/generic/msgdlgg.h" #elif defined(__WXQT__) #include "wx/generic/msgdlgg.h" +#elif defined(__WXMAC__) +#include "wx/generic/msgdlgg.h" +#elif defined(__WXSTUBS__) +#include "wx/generic/msgdlgg.h" #endif #endif - // __MSGDLGH_BASE__ + // _WX_MSGDLG_H_BASE_ diff --git a/include/wx/mstream.h b/include/wx/mstream.h index 8c57cb0323..a07ce80ceb 100644 --- a/include/wx/mstream.h +++ b/include/wx/mstream.h @@ -8,8 +8,8 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXMMSTREAM_H__ -#define __WXMMSTREAM_H__ +#ifndef _WX_WXMMSTREAM_H__ +#define _WX_WXMMSTREAM_H__ #include diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index c7ca3e05ba..ab4d2b1c87 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -57,10 +57,10 @@ public: CrossHair(pt.x, pt.y); } - virtual void DrawArc(long x1,long y1,long x2,long y2,double xc, double yc); - inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc) + virtual void DrawArc(long x1,long y1,long x2,long y2,long xc, long yc); + inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) { - DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc); + DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); } virtual void DrawEllipticArc (long x, long y, long w, long h, double sa, double ea); diff --git a/include/wx/notebook.h b/include/wx/notebook.h index 73b6f3921d..4d2aaafc5c 100644 --- a/include/wx/notebook.h +++ b/include/wx/notebook.h @@ -1,15 +1,19 @@ -#ifndef __NOTEBOOKH_BASE__ -#define __NOTEBOOKH_BASE__ +#ifndef _WX_NOTEBOOK_H_BASE_ +#define _WX_NOTEBOOK_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/notebook.h" #elif defined(__WXMOTIF__) - #error "wxNotebook not implemented under Motif" + #include "wx/motif/notebook.h" #elif defined(__WXGTK__) #include "wx/gtk/notebook.h" #elif defined(__WXQT__) #include "wx/qt/notebook.h" +#elif defined(__WXMAC__) + #include "wx/mac/notebook.h" +#elif defined(__WXSTUBS__) + #include "wx/stubs/notebook.h" #endif #endif - // __NOTEBOOKH_BASE__ + // _WX_NOTEBOOK_H_BASE_ diff --git a/include/wx/object.h b/include/wx/object.h index d4752864be..f2c06af43b 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __OBJECTH__ -#define __OBJECTH__ +#ifndef _WX_OBJECTH__ +#define _WX_OBJECTH__ #ifdef __GNUG__ #pragma interface "object.h" @@ -221,6 +221,6 @@ private: #endif #endif - // __OBJECTH__ + // _WX_OBJECTH__ diff --git a/include/wx/objstrm.h b/include/wx/objstrm.h index f7e7f58d6f..fbe79e4503 100644 --- a/include/wx/objstrm.h +++ b/include/wx/objstrm.h @@ -8,8 +8,8 @@ // Copyright: (c) 1998 Guilhem Lavaux // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXOBJSTRM_H__ -#define __WXOBJSTRM_H__ +#ifndef _WX_WXOBJSTRM_H__ +#define _WX_WXOBJSTRM_H__ #ifdef __GNUG__ #pragma interface diff --git a/include/wx/odbc.h b/include/wx/odbc.h index 58d027a083..5a3b3899a4 100644 --- a/include/wx/odbc.h +++ b/include/wx/odbc.h @@ -17,8 +17,8 @@ #pragma interface "odbc.h" #endif -#ifndef __ODBCH__ -#define __ODBCH__ +#ifndef _WX_ODBCH__ +#define _WX_ODBCH__ #ifdef __WXMSW__ #include diff --git a/include/wx/palette.h b/include/wx/palette.h index 04339568b5..9702d374a1 100644 --- a/include/wx/palette.h +++ b/include/wx/palette.h @@ -1,15 +1,19 @@ -#ifndef __PALETTEH_BASE__ -#define __PALETTEH_BASE__ +#ifndef _WX_PALETTE_H_BASE_ +#define _WX_PALETTE_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/palette.h" #elif defined(__WXMOTIF__) -#include "wx/xt/palette.h" +#include "wx/motif/palette.h" #elif defined(__WXGTK__) #include "wx/gtk/palette.h" #elif defined(__WXQT__) #include "wx/qt/palette.h" +#elif defined(__WXMAC__) +#include "wx/mac/palette.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/palette.h" #endif #endif - // __PALETTEH_BASE__ + // _WX_PALETTE_H_BASE_ diff --git a/include/wx/panel.h b/include/wx/panel.h index 8944fee1c5..0bfa7daaca 100644 --- a/include/wx/panel.h +++ b/include/wx/panel.h @@ -1,7 +1,7 @@ -#ifndef __PANELH_BASE__ -#define __PANELH_BASE__ +#ifndef _WX_PANEL_H_BASE_ +#define _WX_PANEL_H_BASE_ #include "wx/generic/panelg.h" #endif - // __PANELH_BASE_ + // _WX_PANELH_BASE_ diff --git a/include/wx/pen.h b/include/wx/pen.h index 97da9143a8..d132d8a7c9 100644 --- a/include/wx/pen.h +++ b/include/wx/pen.h @@ -1,15 +1,19 @@ -#ifndef __PENH_BASE__ -#define __PENH_BASE__ +#ifndef _WX_PEN_H_BASE_ +#define _WX_PEN_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/pen.h" #elif defined(__WXMOTIF__) -#include "wx/xt/pen.h" +#include "wx/motif/pen.h" #elif defined(__WXGTK__) #include "wx/gtk/pen.h" #elif defined(__WXQT__) #include "wx/qt/pen.h" +#elif defined(__WXMAC__) +#include "wx/mac/pen.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/pen.h" #endif #endif - // __PENH_BASE__ + // _WX_PEN_H_BASE_ diff --git a/include/wx/pnghand.h b/include/wx/pnghand.h index a7b71c7693..405e234ba5 100644 --- a/include/wx/pnghand.h +++ b/include/wx/pnghand.h @@ -1,13 +1,17 @@ -#ifndef __PNGHANDH_BASE__ -#define __PNGHANDH_BASE__ +#ifndef _WX_PNGHAND_H_BASE_ +#define _WX_PNGHAND_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/pnghand.h" #elif defined(__WXMOTIF__) -#include "wx/xt/pnghand.h" +#include "wx/motif/pnghand.h" #elif defined(__WXGTK__) #include "wx/gtk/pnghand.h" +#elif defined(__WXMAC__) +#include "wx/mac/pnghand.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/pnghand.h" #endif #endif - // __PNGHANDH_BASE__ + // _WX_PNGHAND_H_BASE_ diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h index f9536aa0e8..e1b12928a3 100644 --- a/include/wx/postscrp.h +++ b/include/wx/postscrp.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __POSTSCRPH__ -#define __POSTSCRPH__ +#ifndef _WX_POSTSCRPH__ +#define _WX_POSTSCRPH__ #ifdef __GNUG__ #pragma interface "postscrp.h" @@ -295,4 +295,4 @@ WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase; #endif // USE_POSTSCRIPT #endif - // __POSTSCRPH__ + // _WX_POSTSCRPH__ diff --git a/include/wx/print.h b/include/wx/print.h index e0d05230f4..4d63fb0e56 100644 --- a/include/wx/print.h +++ b/include/wx/print.h @@ -1,5 +1,5 @@ -#ifndef __PRINTH_BASE__ -#define __PRINTH_BASE__ +#ifndef _WX_PRINT_H_BASE_ +#define _WX_PRINT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/printwin.h" @@ -25,4 +25,4 @@ #endif - // __PRINTH_BASE__ + // _WX_PRINT_H_BASE_ diff --git a/include/wx/printdlg.h b/include/wx/printdlg.h index bd0e58ccd0..a1455213a1 100644 --- a/include/wx/printdlg.h +++ b/include/wx/printdlg.h @@ -1,5 +1,5 @@ -#ifndef __PRINTDLGH_BASE__ -#define __PRINTDLGH_BASE__ +#ifndef _WX_PRINTDLG_H_BASE_ +#define _WX_PRINTDLG_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/printdlg.h" @@ -7,7 +7,13 @@ #include "wx/generic/prntdlgg.h" #elif defined(__WXGTK__) #include "wx/generic/prntdlgg.h" +#elif defined(__WXQT__) +#include "wx/generic/prntdlgg.h" +#elif defined(__WXMAC__) +#include "wx/generic/prntdlgg.h" +#elif defined(__WXSRUBS__) +#include "wx/generic/prntdlgg.h" #endif #endif - // __PRINTDLGH_BASE__ + // _WX_PRINTDLG_H_BASE_ diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index b1b455853a..be72e1d0f2 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __PRNTBASEH__ -#define __PRNTBASEH__ +#ifndef _WX_PRNTBASEH__ +#define _WX_PRNTBASEH__ #ifdef __GNUG__ #pragma interface "prntbase.h" @@ -22,6 +22,7 @@ #include "wx/panel.h" #include "wx/scrolwin.h" #include "wx/dialog.h" +#include "wx/frame.h" class WXDLLEXPORT wxDC; class WXDLLEXPORT wxButton; @@ -332,4 +333,4 @@ public: }; #endif - // __PRNTBASEH__ + // _WX_PRNTBASEH__ diff --git a/include/wx/process.h b/include/wx/process.h index 96ce4e5fb9..67677f35d8 100644 --- a/include/wx/process.h +++ b/include/wx/process.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __PROCESSH__ -#define __PROCESSH__ +#ifndef _WX_PROCESSH__ +#define _WX_PROCESSH__ #ifdef __GNUG__ #pragma interface "process.h" @@ -55,4 +55,4 @@ typedef void (wxObject::*wxProcessEventFunction)(wxProcessEvent&); #define EVT_END_PROCESS(id, func) { wxEVT_END_TERMINATE, id, -1, (wxObjectEvent) (wxEventFunction) (wxProcessEventFunction) & fn, NULL}, #endif - // __PROCESSH__ + // _WX_PROCESSH__ diff --git a/include/wx/radiobox.h b/include/wx/radiobox.h index a84da1da4d..2f0253ddb9 100644 --- a/include/wx/radiobox.h +++ b/include/wx/radiobox.h @@ -1,15 +1,19 @@ -#ifndef __RADIOBOXH_BASE__ -#define __RADIOBOXH_BASE__ +#ifndef _WX_RADIOBOX_H_BASE_ +#define _WX_RADIOBOX_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/radiobox.h" #elif defined(__WXMOTIF__) -#include "wx/xt/radiobox.h" +#include "wx/motif/radiobox.h" #elif defined(__WXGTK__) #include "wx/gtk/radiobox.h" #elif defined(__WXQT__) #include "wx/qt/radiobox.h" +#elif defined(__WXMAC__) +#include "wx/mac/radiobox.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/radiobox.h" #endif #endif - // __RADIOBOXH_BASE__ + // _WX_RADIOBOX_H_BASE_ diff --git a/include/wx/radiobut.h b/include/wx/radiobut.h index 7d6708b27e..ce602dcc0f 100644 --- a/include/wx/radiobut.h +++ b/include/wx/radiobut.h @@ -1,15 +1,19 @@ -#ifndef __RADIOBUTH_BASE__ -#define __RADIOBUTH_BASE__ +#ifndef _WX_RADIOBUT_H_BASE_ +#define _WX_RADIOBUT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/radiobut.h" #elif defined(__WXMOTIF__) -#include "wx/xt/radiobut.h" +#include "wx/motif/radiobut.h" #elif defined(__WXGTK__) #include "wx/gtk/radiobut.h" #elif defined(__WXQT__) #include "wx/qt/radiobut.h" +#elif defined(__WXMAC__) +#include "wx/mac/radiobut.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/radiobut.h" #endif #endif - // __RADIOBUTH_BASE__ + // _WX_RADIOBUT_H_BASE_ diff --git a/include/wx/region.h b/include/wx/region.h index c076b5a5c2..9c5afd22bc 100644 --- a/include/wx/region.h +++ b/include/wx/region.h @@ -1,15 +1,19 @@ -#ifndef __REGIONH_BASE__ -#define __REGIONH_BASE__ +#ifndef _WX_REGION_H_BASE_ +#define _WX_REGION_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/region.h" #elif defined(__WXMOTIF__) -#include "wx/xt/region.h" +#include "wx/motif/region.h" #elif defined(__WXGTK__) #include "wx/gtk/region.h" #elif defined(__WXQT__) #include "wx/qt/region.h" +#elif defined(__WXMAC__) +#include "wx/mac/region.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/region.h" #endif #endif - // __REGIONH_BASE__ + // _WX_REGION_H_BASE_ diff --git a/include/wx/resource.h b/include/wx/resource.h index e01582b2a1..316b9c3b71 100644 --- a/include/wx/resource.h +++ b/include/wx/resource.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __RESOURCEH__ -#define __RESOURCEH__ +#ifndef _WX_RESOURCEH__ +#define _WX_RESOURCEH__ #ifdef __GNUG__ #pragma interface "resource.h" @@ -171,4 +171,4 @@ extern int WXDLLEXPORT wxResourceGetIdentifier(char *name, wxResourceTable *tabl #endif #endif - // __RESOURCEH__ + // _WX_RESOURCEH__ diff --git a/include/wx/scrolbar.h b/include/wx/scrolbar.h index 3325b9b4ee..49f9a11b05 100644 --- a/include/wx/scrolbar.h +++ b/include/wx/scrolbar.h @@ -1,15 +1,19 @@ -#ifndef __SCROLBARH_BASE__ -#define __SCROLBARH_BASE__ +#ifndef _WX_SCROLBAR_H_BASE_ +#define _WX_SCROLBAR_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/scrolbar.h" #elif defined(__WXMOTIF__) -#include "wx/xt/scrolbar.h" +#include "wx/motif/scrolbar.h" #elif defined(__WXGTK__) #include "wx/gtk/scrolbar.h" #elif defined(__WXQT__) #include "wx/qt/scrolbar.h" +#elif defined(__WXMAC__) +#include "wx/mac/scrolbar.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/scrolbar.h" #endif #endif - // __SCROLBARH_BASE__ + // _WX_SCROLBAR_H_BASE_ diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index 2f98b0274b..44298184bb 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -1,7 +1,7 @@ -#ifndef __SCROLWINH_BASE__ -#define __SCROLWINH_BASE__ +#ifndef _WX_SCROLWIN_H_BASE_ +#define _WX_SCROLWIN_H_BASE_ #include "wx/generic/scrolwin.h" #endif - // __SCROLWINH_BASE__ + // _WX_SCROLWIN_H_BASE_ diff --git a/include/wx/serbase.h b/include/wx/serbase.h index c49b61d7ce..f4c3be113e 100644 --- a/include/wx/serbase.h +++ b/include/wx/serbase.h @@ -8,8 +8,8 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __WX_SERBASEH_H__ -#define __WX_SERBASEH_H__ +#ifndef _WX_WX_SERBASEH_H__ +#define _WX_WX_SERBASEH_H__ #include diff --git a/include/wx/settings.h b/include/wx/settings.h index a81d15fc7d..1dfc5d9280 100644 --- a/include/wx/settings.h +++ b/include/wx/settings.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __SETTINGSH_BASE__ -#define __SETTINGSH_BASE__ +#ifndef _WX_SETTINGS_H_BASE_ +#define _WX_SETTINGS_H_BASE_ #define wxSYS_WHITE_BRUSH 0 #define wxSYS_LTGRAY_BRUSH 1 @@ -107,13 +107,17 @@ #if defined(__WXMSW__) #include "wx/msw/settings.h" #elif defined(__WXMOTIF__) -#include "wx/xt/settings.h" +#include "wx/motif/settings.h" #elif defined(__WXGTK__) #include "wx/gtk/settings.h" #elif defined(__WXQT__) #include "wx/qt/settings.h" +#elif defined(__WXMAC__) +#include "wx/mac/settings.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/settings.h" #endif #endif - // __SETTINGSH_BASE__ + // _WX_SETTINGS_H_BASE_ diff --git a/include/wx/setup.h b/include/wx/setup.h index 3b60434425..bd1963b9ec 100644 --- a/include/wx/setup.h +++ b/include/wx/setup.h @@ -1,22 +1,26 @@ -#ifndef __SETUPH_BASE__ -#define __SETUPH_BASE__ +#ifndef _WX_SETUP_H_BASE_ +#define _WX_SETUP_H_BASE_ // compatibility code, to be removed asap: -#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) -# if defined(__WINDOWS__) -# define __WXMSW__ -# else -# error No __WXxxx__ define set! Please define __WXGTK__,__WXMSW__ or __WXMOTIF__. -# endif +#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__) +# error No __WXxxx__ define set! Please define one of __WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXSTUBS__ #endif #if defined(__WXMSW__) #include "wx/msw/setup.h" -#else +#elif defined(__WXMAC__) +#include "wx/mac/setup.h" +#elif defined(__WXQT__) +#include "wx/qt/setup.h" +#elif defined(__WXMOTIF__) +#include "wx/motif/setup.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/setup.h" +#elif defined(__WXGTK__) #include "wx/../../install/unix/setup/setup.h" #endif #endif - // __SETUPH_BASE__ + // _WX_SETUP_H_BASE_ diff --git a/include/wx/slider.h b/include/wx/slider.h index 21ad69c143..739a311aa5 100644 --- a/include/wx/slider.h +++ b/include/wx/slider.h @@ -1,15 +1,19 @@ -#ifndef __SLIDERH_BASE__ -#define __SLIDERH_BASE__ +#ifndef _WX_SLIDER_H_BASE_ +#define _WX_SLIDER_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/slider.h" #elif defined(__WXMOTIF__) -#include "wx/xt/slider.h" +#include "wx/motif/slider.h" #elif defined(__WXGTK__) #include "wx/gtk/slider.h" #elif defined(__WXQT__) #include "wx/qt/slider.h" +#elif defined(__WXMAC__) +#include "wx/mac/slider.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/slider.h" #endif #endif - // __SLIDERH_BASE__ + // _WX_SLIDER_H_BASE_ diff --git a/include/wx/spinbutt.h b/include/wx/spinbutt.h index c961ea2c63..7d1c5c3806 100644 --- a/include/wx/spinbutt.h +++ b/include/wx/spinbutt.h @@ -1,15 +1,19 @@ -#ifndef __SPINBUTTH_BASE__ -#define __SPINBUTTH_BASE__ +#ifndef _WX_SPINBUTT_H_BASE_ +#define _WX_SPINBUTT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/spinbutt.h" #elif defined(__WXMOTIF__) -#include "wx/xt/spinbutt.h" +#include "wx/motif/spinbutt.h" #elif defined(__WXGTK__) #include "wx/gtk/spinbutt.h" #elif defined(__WXQT__) #include "wx/qt/spinbutt.h" +#elif defined(__WXMAC__) +#include "wx/mac/spinbutt.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/spinbutt.h" #endif #endif - // __SPINBUTTH_BASE__ + // _WX_SPINBUTT_H_BASE_ diff --git a/include/wx/splitter.h b/include/wx/splitter.h index 626852e49f..0a5232403b 100644 --- a/include/wx/splitter.h +++ b/include/wx/splitter.h @@ -1,7 +1,7 @@ -#ifndef __SPLITTERH_BASE__ -#define __SPLITTERH_BASE__ +#ifndef _WX_SPLITTER_H_BASE_ +#define _WX_SPLITTER_H_BASE_ #include "wx/generic/splitter.h" #endif - // __SPLITTERH_BASE__ + // _WX_SPLITTER_H_BASE_ diff --git a/include/wx/statbmp.h b/include/wx/statbmp.h index 32c1534f90..0f32d687a3 100644 --- a/include/wx/statbmp.h +++ b/include/wx/statbmp.h @@ -1,15 +1,19 @@ -#ifndef __STATBMPH_BASE__ -#define __STATBMPH_BASE__ +#ifndef _WX_STATBMP_H_BASE_ +#define _WX_STATBMP_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/statbmp.h" #elif defined(__WXMOTIF__) -#include "wx/xt/statbmp.h" +#include "wx/motif/statbmp.h" #elif defined(__WXGTK__) #include "wx/gtk/statbmp.h" #elif defined(__WXQT__) #include "wx/qt/statbmp.h" +#elif defined(__WXMAC__) +#include "wx/mac/statbmp.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/statbmp.h" #endif #endif - // __STATBMPH_BASE__ + // _WX_STATBMP_H_BASE_ diff --git a/include/wx/statbox.h b/include/wx/statbox.h index 9bd9006136..f1a8bd6eea 100644 --- a/include/wx/statbox.h +++ b/include/wx/statbox.h @@ -1,15 +1,19 @@ -#ifndef __STATBOXH_BASE__ -#define __STATBOXH_BASE__ +#ifndef _WX_STATBOX_H_BASE_ +#define _WX_STATBOX_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/statbox.h" #elif defined(__WXMOTIF__) -#include "wx/xt/statbox.h" +#include "wx/motif/statbox.h" #elif defined(__WXGTK__) #include "wx/gtk/statbox.h" #elif defined(__WXQT__) #include "wx/qt/statbox.h" +#elif defined(__WXMAC__) +#include "wx/mac/statbox.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/statbox.h" #endif #endif - // __STATBOXH_BASE__ + // _WX_STATBOX_H_BASE_ diff --git a/include/wx/stattext.h b/include/wx/stattext.h index 0346783aaf..abfbbd5be6 100644 --- a/include/wx/stattext.h +++ b/include/wx/stattext.h @@ -1,15 +1,19 @@ -#ifndef __STATTEXTH_BASE__ -#define __STATTEXTH_BASE_ +#ifndef _WX_STATTEXT_H_BASE_ +#define _WX_STATTEXT_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/stattext.h" #elif defined(__WXMOTIF__) -#include "wx/xt/stattext.h" +#include "wx/motif/stattext.h" #elif defined(__WXGTK__) #include "wx/gtk/stattext.h" #elif defined(__WXQT__) #include "wx/qt/stattext.h" +#elif defined(__WXMAC__) +#include "wx/mac/stattext.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/stattext.h" #endif #endif - // __STATTEXTH_BASE__ + // _WX_STATTEXT_H_BASE_ diff --git a/include/wx/statusbr.h b/include/wx/statusbr.h index 1775a2594a..327238fbd2 100644 --- a/include/wx/statusbr.h +++ b/include/wx/statusbr.h @@ -1,7 +1,7 @@ -#ifndef __STATUSBRH_BASE__ -#define __STATUSBRH_BASE__ +#ifndef _WX_STATUSBR_H_BASE_ +#define _WX_STATUSBR_H_BASE_ #include "wx/generic/statusbr.h" #endif - // __STATUSBRH_BASE__ + // _WX_STATUSBR_H_BASE_ diff --git a/include/wx/stream.h b/include/wx/stream.h index a2f1c0f89b..d966c7da37 100644 --- a/include/wx/stream.h +++ b/include/wx/stream.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXSTREAM_H__ -#define __WXSTREAM_H__ +#ifndef _WX_WXSTREAM_H__ +#define _WX_WXSTREAM_H__ #ifdef __GNUG__ #pragma interface diff --git a/include/wx/string.h b/include/wx/string.h index 3c7a1cdf09..a4442365f3 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXSTRINGH__ -#define __WXSTRINGH__ +#ifndef _WX_WXSTRINGH__ +#define _WX_WXSTRINGH__ #ifdef __GNUG__ #pragma interface "string.h" @@ -925,6 +925,6 @@ istream& WXDLLEXPORT operator>>(istream& is, wxString& str); #endif //std::string compatibility -#endif // __WXSTRINGH__ +#endif // _WX_WXSTRINGH__ //@} diff --git a/include/wx/stubs/accel.h b/include/wx/stubs/accel.h index 27ed68439e..236dc0eb55 100644 --- a/include/wx/stubs/accel.h +++ b/include/wx/stubs/accel.h @@ -17,6 +17,7 @@ #endif #include "wx/object.h" +#include "wx/string.h" class WXDLLEXPORT wxAcceleratorTable; diff --git a/include/wx/stubs/app.h b/include/wx/stubs/app.h index cb50ba9c9e..3b1467fec5 100644 --- a/include/wx/stubs/app.h +++ b/include/wx/stubs/app.h @@ -18,6 +18,8 @@ #include "wx/defs.h" #include "wx/object.h" +#include "wx/gdicmn.h" +#include "wx/event.h" class WXDLLEXPORT wxFrame; class WXDLLEXPORT wxWindow; diff --git a/include/wx/stubs/checklst.h b/include/wx/stubs/checklst.h index b0fc0a2978..5cc193d98a 100644 --- a/include/wx/stubs/checklst.h +++ b/include/wx/stubs/checklst.h @@ -17,6 +17,8 @@ #pragma interface "checklst.h" #endif +#include "wx/listbox.h" + typedef unsigned int uint; class wxCheckListBox : public wxListBox @@ -38,9 +40,6 @@ public: bool IsChecked(uint uiIndex) const; void Check(uint uiIndex, bool bCheck = TRUE); - // accessors - uint GetItemHeight() const { return m_nItemHeight; } - DECLARE_EVENT_TABLE() }; diff --git a/include/wx/stubs/colour.h b/include/wx/stubs/colour.h index e8fca8e3b4..452d946cdc 100644 --- a/include/wx/stubs/colour.h +++ b/include/wx/stubs/colour.h @@ -16,6 +16,9 @@ #pragma interface "colour.h" #endif +#include "wx/object.h" +#include "wx/string.h" + // Colour class WXDLLEXPORT wxColour: public wxObject { @@ -49,7 +52,9 @@ public: inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); } +/* TODO WXCOLORREF GetPixel() const { return m_pixel; }; +*/ private: bool m_isInit; diff --git a/include/wx/stubs/cursor.h b/include/wx/stubs/cursor.h index 9cf490cdc6..027745838a 100644 --- a/include/wx/stubs/cursor.h +++ b/include/wx/stubs/cursor.h @@ -57,7 +57,8 @@ public: wxCursor(int cursor_type); ~wxCursor(); - virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor) ; } + // TODO: also verify the internal cursor handle + virtual bool Ok() const { return (m_refData != NULL) ; } inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; } diff --git a/include/wx/stubs/dc.h b/include/wx/stubs/dc.h index eb10154ab9..f2c2ca6c4d 100644 --- a/include/wx/stubs/dc.h +++ b/include/wx/stubs/dc.h @@ -26,6 +26,7 @@ // constants //----------------------------------------------------------------------------- +#ifndef MM_TEXT #define MM_TEXT 0 #define MM_ISOTROPIC 1 #define MM_ANISOTROPIC 2 @@ -34,6 +35,7 @@ #define MM_TWIPS 5 #define MM_POINTS 6 #define MM_METRIC 7 +#endif //----------------------------------------------------------------------------- // global variables @@ -59,11 +61,12 @@ class WXDLLEXPORT wxDC: public wxObject virtual bool Ok(void) const { return m_ok; }; - virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0; + virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE ) = 0; inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) { - FloodFill(pt.x, pt.y, col, style); + FloodFill(pt.x, pt.y, (wxColour*) & col, style); } + virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0; inline bool GetPixel(const wxPoint& pt, wxColour *col) const { @@ -82,10 +85,10 @@ class WXDLLEXPORT wxDC: public wxObject CrossHair(pt.x, pt.y); } - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) = 0; - inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc) + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) = 0; + inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) { - DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc); + DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); } virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0; @@ -133,8 +136,6 @@ class WXDLLEXPORT wxDC: public wxObject DrawEllipse(rect.x, rect.y, rect.width, rect.height); } - virtual void DrawIcon(const wxIcon& icon, long x, long y) = 0; - virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ); virtual void DrawSpline( wxList *points ); virtual void DrawSpline( int n, wxPoint points[] ); @@ -176,16 +177,16 @@ class WXDLLEXPORT wxDC: public wxObject virtual void Clear(void) = 0; virtual void SetFont( const wxFont &font ) = 0; - virtual wxFont *GetFont(void) const { return &m_font; }; + virtual wxFont *GetFont(void) const { return (wxFont*) &m_font; }; virtual void SetPen( const wxPen &pen ) = 0; - virtual wxPen *GetPen(void) const { return &m_pen; }; + virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen; }; virtual void SetBrush( const wxBrush &brush ) = 0; - virtual wxBrush *GetBrush(void) const { return &m_brush; }; + virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush; }; virtual void SetBackground( const wxBrush &brush ) = 0; - virtual wxBrush *GetBackground(void) const { return &m_backgroundBrush; }; + virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush; }; virtual void SetLogicalFunction( int function ) = 0; virtual int GetLogicalFunction(void) const { return m_logicalFunction; }; diff --git a/include/wx/stubs/dcclient.h b/include/wx/stubs/dcclient.h index 828a507d75..ce81dec72c 100644 --- a/include/wx/stubs/dcclient.h +++ b/include/wx/stubs/dcclient.h @@ -23,6 +23,7 @@ //----------------------------------------------------------------------------- class WXDLLEXPORT wxPaintDC; +class WXDLLEXPORT wxWindow; // Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently. // On many platforms, however, they will be the same. @@ -45,12 +46,12 @@ class WXDLLEXPORT wxPaintDC: public wxDC ~wxPaintDC(void); - virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ); + virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE ); virtual bool GetPixel( long x1, long y1, wxColour *col ) const; virtual void DrawLine( long x1, long y1, long x2, long y2 ); virtual void CrossHair( long x, long y ); - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ); virtual void DrawPoint( long x, long y ); diff --git a/include/wx/stubs/dirdlg.h b/include/wx/stubs/dirdlg.h index fe36bb7fec..44f96238e2 100644 --- a/include/wx/stubs/dirdlg.h +++ b/include/wx/stubs/dirdlg.h @@ -18,6 +18,8 @@ #include "wx/dialog.h" +WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr; + class WXDLLEXPORT wxDirDialog: public wxDialog { DECLARE_DYNAMIC_CLASS(wxDirDialog) diff --git a/include/wx/stubs/dnd.h b/include/wx/stubs/dnd.h new file mode 100644 index 0000000000..a7c29c6613 --- /dev/null +++ b/include/wx/stubs/dnd.h @@ -0,0 +1,238 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: dnd.h +// Purpose: Declaration of the wxDropTarget, wxDropSource class etc. +// Author: AUTHOR +// RCS-ID: $Id$ +// Copyright: (c) 1998 AUTHOR +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_DND_H_ +#define _WX_DND_H_ + +#ifdef __GNUG__ +#pragma interface "dnd.h" +#endif + +#include "wx/defs.h" +#include "wx/object.h" +#include "wx/string.h" +#include "wx/cursor.h" + +//------------------------------------------------------------------------- +// classes +//------------------------------------------------------------------------- + +class WXDLLEXPORT wxWindow; + +class WXDLLEXPORT wxDataObject; +class WXDLLEXPORT wxTextDataObject; +class WXDLLEXPORT wxFileDataObject; + +class WXDLLEXPORT wxDropTarget; +class WXDLLEXPORT wxTextDropTarget; +class WXDLLEXPORT wxFileDropTarget; + +class WXDLLEXPORT wxDropSource; + +//------------------------------------------------------------------------- +// wxDataObject +//------------------------------------------------------------------------- + +class WXDLLEXPORT wxDataObject: public wxObject +{ +public: + // all data formats (values are the same as in windows.h, do not change!) + enum StdFormat + { + Invalid, + Text, + Bitmap, + MetafilePict, + Sylk, + Dif, + Tiff, + OemText, + Dib, + Palette, + Pendata, + Riff, + Wave, + UnicodeText, + EnhMetafile, + Hdrop, + Locale, + Max + }; + + // function to return symbolic name of clipboard format (debug messages) + static const char *GetFormatName(wxDataFormat format); + + // ctor & dtor + wxDataObject() {}; + ~wxDataObject() {}; + + // pure virtuals to override + // get the best suited format for our data + virtual wxDataFormat GetPreferredFormat() const = 0; + // decide if we support this format (should be one of values of + // StdFormat enumerations or a user-defined format) + virtual bool IsSupportedFormat(wxDataFormat format) const = 0; + // get the (total) size of data + virtual uint GetDataSize() const = 0; + // copy raw data to provided pointer + virtual void GetDataHere(void *pBuf) const = 0; + +}; + +// ---------------------------------------------------------------------------- +// wxTextDataObject is a specialization of wxDataObject for text data +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTextDataObject : public wxDataObject +{ +public: + // ctors + wxTextDataObject() { } + wxTextDataObject(const wxString& strText) : m_strText(strText) { } + void Init(const wxString& strText) { m_strText = strText; } + + // implement base class pure virtuals + virtual wxDataFormat GetPreferredFormat() const + { return wxDF_TEXT; } + virtual bool IsSupportedFormat(wxDataFormat format) const + { return format == wxDF_TEXT; } + virtual uint GetDataSize() const + { return m_strText.Len() + 1; } // +1 for trailing '\0'of course + virtual void GetDataHere(void *pBuf) const + { memcpy(pBuf, m_strText.c_str(), GetDataSize()); } + +private: + wxString m_strText; + +}; + +// ---------------------------------------------------------------------------- +// wxFileDataObject is a specialization of wxDataObject for file names +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxFileDataObject : public wxDataObject +{ +public: + + wxFileDataObject(void) { } + void AddFile( const wxString &file ) + { m_files += file; m_files += ";"; } + + // implement base class pure virtuals + virtual wxDataFormat GetPreferredFormat() const + { return wxDF_FILENAME; } + virtual bool IsSupportedFormat(wxDataFormat format) const + { return format == wxDF_FILENAME; } + virtual uint GetDataSize() const + { return m_files.Len() + 1; } // +1 for trailing '\0'of course + virtual void GetDataHere(void *pBuf) const + { memcpy(pBuf, m_files.c_str(), GetDataSize()); } + +private: + wxString m_files; + +}; +//------------------------------------------------------------------------- +// wxDropTarget +//------------------------------------------------------------------------- + +class WXDLLEXPORT wxDropTarget: public wxObject +{ + public: + + wxDropTarget(); + ~wxDropTarget(); + + virtual void OnEnter() { } + virtual void OnLeave() { } + virtual bool OnDrop( long x, long y, const void *pData ) = 0; + +// protected: + + friend wxWindow; + + // Override these to indicate what kind of data you support: + + virtual size_t GetFormatCount() const = 0; + virtual wxDataFormat GetFormat(size_t n) const = 0; +}; + +//------------------------------------------------------------------------- +// wxTextDropTarget +//------------------------------------------------------------------------- + +class WXDLLEXPORT wxTextDropTarget: public wxDropTarget +{ + public: + + wxTextDropTarget() {}; + virtual bool OnDrop( long x, long y, const void *pData ); + virtual bool OnDropText( long x, long y, const char *psz ); + + protected: + + virtual size_t GetFormatCount() const; + virtual wxDataFormat GetFormat(size_t n) const; +}; + +// ---------------------------------------------------------------------------- +// A drop target which accepts files (dragged from File Manager or Explorer) +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxFileDropTarget: public wxDropTarget +{ + public: + + wxFileDropTarget() {}; + + virtual bool OnDrop(long x, long y, const void *pData); + virtual bool OnDropFiles( long x, long y, + size_t nFiles, const char * const aszFiles[]); + + protected: + + virtual size_t GetFormatCount() const; + virtual wxDataFormat GetFormat(size_t n) const; +}; + +//------------------------------------------------------------------------- +// wxDropSource +//------------------------------------------------------------------------- + +class WXDLLEXPORT wxDropSource: public wxObject +{ + public: + + enum DragResult + { + Error, // error prevented the d&d operation from completing + None, // drag target didn't accept the data + Copy, // the data was successfully copied + Move, // the data was successfully moved + Cancel // the operation was cancelled by user (not an error) + }; + + wxDropSource( wxWindow *win ); + wxDropSource( wxDataObject &data, wxWindow *win ); + + ~wxDropSource(void); + + void SetData( wxDataObject &data ); + DragResult DoDragDrop( bool bAllowMove = FALSE ); + + virtual bool GiveFeedback( DragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; + + protected: + + wxDataObject *m_data; +}; + +#endif + //_WX_DND_H_ + diff --git a/include/wx/stubs/font.h b/include/wx/stubs/font.h index 2079f2d0f0..601657c657 100644 --- a/include/wx/stubs/font.h +++ b/include/wx/stubs/font.h @@ -25,6 +25,7 @@ class WXDLLEXPORT wxFontRefData: public wxGDIRefData friend class WXDLLEXPORT wxFont; public: wxFontRefData(); + wxFontRefData(const wxFontRefData& data); ~wxFontRefData(); protected: int m_pointSize; @@ -81,6 +82,7 @@ public: // Implementation protected: + bool RealizeResource(); void Unshare(); }; diff --git a/include/wx/stubs/mdi.h b/include/wx/stubs/mdi.h index 1daec94008..6f9fc294e2 100644 --- a/include/wx/stubs/mdi.h +++ b/include/wx/stubs/mdi.h @@ -57,6 +57,7 @@ public: void OnSize(wxSizeEvent& event); void OnActivate(wxActivateEvent& event); + void OnSysColourChanged(wxSysColourChangedEvent& event); void SetMenuBar(wxMenuBar *menu_bar); @@ -84,6 +85,9 @@ public: protected: + // TODO maybe have this member + wxMDIClientWindow *m_clientWindow; + DECLARE_EVENT_TABLE() }; diff --git a/include/wx/stubs/metafile.h b/include/wx/stubs/metafile.h index f4d04bcb63..eb86b97a04 100644 --- a/include/wx/stubs/metafile.h +++ b/include/wx/stubs/metafile.h @@ -39,7 +39,8 @@ class WXDLLEXPORT wxMetaFile: public wxObject virtual bool SetClipboard(int width = 0, int height = 0); virtual bool Play(wxDC *dc); - inline bool Ok() { return m_metaFile != 0; }; + // TODO + inline bool Ok() { return FALSE; }; /* TODO: Implementation inline WXHANDLE GetHMETAFILE() { return m_metaFile; } diff --git a/include/wx/stubs/notebook.h b/include/wx/stubs/notebook.h index b5834ec181..9b0794f359 100644 --- a/include/wx/stubs/notebook.h +++ b/include/wx/stubs/notebook.h @@ -18,7 +18,9 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- -#include +#include "wx/dynarray.h" +#include "wx/event.h" +#include "wx/control.h" // ---------------------------------------------------------------------------- // types diff --git a/include/wx/stubs/palette.h b/include/wx/stubs/palette.h index a5c85bb1d0..1d198fc6e3 100644 --- a/include/wx/stubs/palette.h +++ b/include/wx/stubs/palette.h @@ -55,7 +55,6 @@ public: inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } - virtual bool FreeResource(bool force = FALSE); /* TODO: implementation inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } void SetHPALETTE(WXHPALETTE pal); diff --git a/include/wx/stubs/pen.h b/include/wx/stubs/pen.h index 0e23c99daf..da7b165e38 100644 --- a/include/wx/stubs/pen.h +++ b/include/wx/stubs/pen.h @@ -17,8 +17,10 @@ #endif #include "wx/gdiobj.h" +#include "wx/colour.h" +#include "wx/bitmap.h" -typedef WXDWORD wxDash ; +typedef long wxDash ; class WXDLLEXPORT wxPen; @@ -91,7 +93,7 @@ public: // Implementation // Useful helper: create the brush resource - void RealizeResource(); + bool RealizeResource(); // When setting properties, we must make sure we're not changing // another object diff --git a/include/wx/stubs/printdlg.h b/include/wx/stubs/printdlg.h index cda8c08232..ac31a49096 100644 --- a/include/wx/stubs/printdlg.h +++ b/include/wx/stubs/printdlg.h @@ -45,10 +45,6 @@ class WXDLLEXPORT wxPrintDialog: public wxDialog private: wxPrintData m_printData; wxDC* m_printerDC; - bool m_destroyDC; - char* m_deviceName; - char* m_driverName; - char* m_portName; wxWindow* m_dialogParent; }; diff --git a/include/wx/stubs/radiobut.h b/include/wx/stubs/radiobut.h index 7a4ce62d50..8e8bf1313d 100644 --- a/include/wx/stubs/radiobut.h +++ b/include/wx/stubs/radiobut.h @@ -48,8 +48,6 @@ class WXDLLEXPORT wxRadioButton: public wxControl virtual bool GetValue() const ; void Command(wxCommandEvent& event); - virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam); }; // Not implemented diff --git a/include/wx/stubs/region.h b/include/wx/stubs/region.h index 02bf97845f..6353a7dc16 100644 --- a/include/wx/stubs/region.h +++ b/include/wx/stubs/region.h @@ -42,11 +42,6 @@ public: wxRegion(long x, long y, long w, long h); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxRect& rect); - -/* TODO: implementation - wxRegion(WXHRGN hRegion); // Hangs on to this region -*/ - wxRegion(); ~wxRegion(); diff --git a/include/wx/stubs/settings.h b/include/wx/stubs/settings.h index 7cd3cbe19e..8ed994f1ba 100644 --- a/include/wx/stubs/settings.h +++ b/include/wx/stubs/settings.h @@ -17,6 +17,10 @@ #endif #include "wx/setup.h" +#include "wx/defs.h" +#include "wx/object.h" +#include "wx/colour.h" +#include "wx/font.h" #define wxSYS_WHITE_BRUSH 0 #define wxSYS_LTGRAY_BRUSH 1 diff --git a/include/wx/stubs/setup.h b/include/wx/stubs/setup.h index d28d09e43c..dc99dbf74b 100644 --- a/include/wx/stubs/setup.h +++ b/include/wx/stubs/setup.h @@ -47,7 +47,10 @@ #define USE_XFIG_SPLINE_CODE 1 // 1 for XFIG spline code, 0 for AIAI spline code. // AIAI spline code is slower, but freer of copyright issues. + // 0 for no splines +#define USE_TOOLBAR 1 + // Use toolbars #define USE_DRAG_AND_DROP 1 // 0 for no drag and drop @@ -78,7 +81,7 @@ // since you may well need to output // an error log in a production // version (or non-debugging beta) -#define USE_GLOBAL_MEMORY_OPERATORS 1 +#define USE_GLOBAL_MEMORY_OPERATORS 0 // In debug mode, cause new and delete to be redefined globally. // If this causes problems (e.g. link errors), set this to 0. diff --git a/include/wx/stubs/statusbr.h b/include/wx/stubs/statusbr.h index c0f83a26d0..c5dcc0dc7d 100644 --- a/include/wx/stubs/statusbr.h +++ b/include/wx/stubs/statusbr.h @@ -44,6 +44,10 @@ public: void OnSize(wxSizeEvent& event); DECLARE_EVENT_TABLE() + +protected: + void CopyFieldsWidth(const int widths[]); + void SetFieldsWidth(); }; #endif diff --git a/include/wx/stubs/wave.h b/include/wx/stubs/wave.h index 485ead936d..e55bd5aa5f 100644 --- a/include/wx/stubs/wave.h +++ b/include/wx/stubs/wave.h @@ -35,7 +35,7 @@ protected: bool Free(); private: - byte* m_waveData; + char* m_waveData; int m_waveLength; bool m_isResource; }; diff --git a/include/wx/stubs/window.h b/include/wx/stubs/window.h index c024635909..541dd58040 100644 --- a/include/wx/stubs/window.h +++ b/include/wx/stubs/window.h @@ -401,6 +401,8 @@ public: // (but doesn't delete the child object) virtual void DestroyChildren(); // Removes and destroys all children + inline bool IsBeingDeleted() const { return FALSE; } // TODO: Should probably eliminate this + // Constraint implementation void UnsetConstraints(wxLayoutConstraints *c); inline wxList *GetConstraintsInvolvedIn() const ; @@ -432,9 +434,8 @@ public: wxObject *GetChild(int number) const ; - inline void SetShowing(bool show); - inline bool IsUserEnabled() const; - inline bool GetTransparentBackground() const ; + // Generates a new id for controls + static int NewControlId(); // Responds to colour changes: passes event on to children. void OnSysColourChanged(wxSysColourChangedEvent& event); @@ -507,8 +508,6 @@ inline wxString wxWindow::GetName() const { return m_windowName; } inline void wxWindow::SetName(const wxString& name) { m_windowName = name; } inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; } inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; } -inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = flag; } -inline bool wxWindow::GetDoubleClick() const { return m_doubleClickAllowed; } inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; } inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; } inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; } @@ -527,14 +526,11 @@ inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; } inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } -inline void wxWindow::SetShowing(bool show) { m_isShown = show; } inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; } inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; } inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; } inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; } inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; } -inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; } -inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; } inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; } inline int wxWindow::GetReturnCode() { return m_returnCode; } diff --git a/include/wx/tab.h b/include/wx/tab.h index 1f75593dd6..808f9c7146 100644 --- a/include/wx/tab.h +++ b/include/wx/tab.h @@ -1,7 +1,7 @@ -#ifndef __TABH_BASE__ -#define __TABH_BASE__ +#ifndef _WX_TAB_H_BASE_ +#define _WX_TAB_H_BASE_ #include "wx/generic/tabg.h" #endif - // __TABH_BASE__ + // _WX_TAB_H_BASE_ diff --git a/include/wx/tabctrl.h b/include/wx/tabctrl.h index 13306d2212..c766f72bf3 100644 --- a/include/wx/tabctrl.h +++ b/include/wx/tabctrl.h @@ -1,12 +1,16 @@ -#ifndef __TABCTRLH_BASE__ -#define __TABCTRLH_BASE__ +#ifndef _WX_TABCTRL_H_BASE_ +#define _WX_TABCTRL_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/tabctrl.h" #elif defined(__WXMOTIF__) -#include "wx/xt/tabctrl.h" +#include "wx/motif/tabctrl.h" #elif defined(__WXGTK__) +#elif defined(__WXMAC__) +#include "wx/mac/tabctrl.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/tabctrl.h" #endif #endif - // __TABCTRLH_BASE__ + // _WX_TABCTRL_H_BASE_ diff --git a/include/wx/taskbar.h b/include/wx/taskbar.h new file mode 100644 index 0000000000..5b70d8573d --- /dev/null +++ b/include/wx/taskbar.h @@ -0,0 +1,15 @@ +#ifndef _WX_TASKBAR_H_BASE_ +#define _WX_TASKBAR_H_BASE_ + +#if defined(__WXMSW__) +#include "wx/msw/taskbar.h" +#elif defined(__WXMOTIF__) +#elif defined(__WXGTK__) +#elif defined(__WXQT__) +#elif defined(__WXMAC__) +#elif defined(__WXSTUBS__) +#include "wx/stubs/taskbar.h" +#endif + +#endif + // _WX_TASKBAR_H_BASE_ diff --git a/include/wx/tbar95.h b/include/wx/tbar95.h index eee04659aa..5e1a009544 100644 --- a/include/wx/tbar95.h +++ b/include/wx/tbar95.h @@ -1,13 +1,13 @@ -#ifndef __TBAR95H_BASE__ -#define __TBAR95H_BASE__ +#ifndef _WX_TBAR95_H_BASE_ +#define _WX_TBAR95_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/tbar95.h" #elif defined(__WXMOTIF__) -#include "wx/xt/tbar95.h" +#include "wx/motif/tbar95.h" #elif defined(__WXGTK__) #include "wx/gtk/tbar95.h" #endif #endif - // __TBAR95H_BASE__ + // _WX_TBAR95_H_BASE_ diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index f8f537e275..260b2526a0 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -9,17 +9,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __TBARBASEH__ -#define __TBARBASEH__ +#ifndef _WX_TBARBASE_H_ +#define _WX_TBARBASE_H_ #ifdef __GNUG__ #pragma interface "tbarbase.h" #endif +#include "wx/setup.h" #include "wx/defs.h" -#if USE_TOOLBAR - #include "wx/bitmap.h" #include "wx/list.h" #include "wx/control.h" @@ -239,7 +238,6 @@ public: DECLARE_EVENT_TABLE() }; -#endif // USE_TOOLBAR #endif - // __TBARBASEH__ + // _WX_TBARBASE_H_ diff --git a/include/wx/tbarmsw.h b/include/wx/tbarmsw.h index 7e5f343b86..4b9d761fcf 100644 --- a/include/wx/tbarmsw.h +++ b/include/wx/tbarmsw.h @@ -1,13 +1,13 @@ -#ifndef __TBARMSWH_BASE__ -#define __TBARMSWH_BASE__ +#ifndef _WX_TBARMSW_H_BASE_ +#define _WX_TBARMSW_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/tbarmsw.h" #elif defined(__WXMOTIF__) -#include "wx/xt/tbarmsw.h" +#include "wx/motif/tbarmsw.h" #elif defined(__WXGTK__) #include "wx/gtk/tbarmsw.h" #endif #endif - // __TBARMSWH_BASE__ + // _WX_TBARMSW_H_BASE_ diff --git a/include/wx/tbarsmpl.h b/include/wx/tbarsmpl.h index 7b44d3f109..add138a78d 100644 --- a/include/wx/tbarsmpl.h +++ b/include/wx/tbarsmpl.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __TBARSMPLH__ -#define __TBARSMPLH__ +#ifndef _WX_TBARSMPLH__ +#define _WX_TBARSMPLH__ #ifdef __GNUG__ #pragma interface "tbarsmpl.h" @@ -75,5 +75,5 @@ DECLARE_EVENT_TABLE() #endif // USE_TOOLBAR #endif - // __TBARSMPLH__ + // _WX_TBARSMPLH__ diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index c90818f5f3..4123afeb1f 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -1,15 +1,19 @@ -#ifndef __TEXTCTRLH_BASE__ -#define __TEXTCTRLH_BASE__ +#ifndef _WX_TEXTCTRL_H_BASE_ +#define _WX_TEXTCTRL_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/textctrl.h" #elif defined(__WXMOTIF__) -#include "wx/xt/textctrl.h" +#include "wx/motif/textctrl.h" #elif defined(__WXGTK__) #include "wx/gtk/textctrl.h" #elif defined(__WXQT__) #include "wx/qt/textctrl.h" +#elif defined(__WXMAC__) +#include "wx/mac/textctrl.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/textctrl.h" #endif #endif - // __TEXTCTRLH_BASE__ + // _WX_TEXTCTRL_H_BASE_ diff --git a/include/wx/textdlg.h b/include/wx/textdlg.h index 4404fe1435..491bd8b4fa 100644 --- a/include/wx/textdlg.h +++ b/include/wx/textdlg.h @@ -1,7 +1,7 @@ -#ifndef __TEXTDLGH_BASE__ -#define __TEXTDLGH_BASE__ +#ifndef _WX_TEXTDLG_H_BASE_ +#define _WX_TEXTDLG_H_BASE_ #include "wx/generic/textdlgg.h" #endif - // __TEXTDLGH_BASE__ + // _WX_TEXTDLG_H_BASE_ diff --git a/include/wx/thread.h b/include/wx/thread.h index 64481d7c88..c4034bb689 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __THREADH__ -#define __THREADH__ +#ifndef _WX_THREADH__ +#define _WX_THREADH__ #ifdef __GNUG__ #pragma interface "thread.h" diff --git a/include/wx/time.h b/include/wx/time.h index 05c5a263e6..74461c55af 100644 --- a/include/wx/time.h +++ b/include/wx/time.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __TIMEH__ -#define __TIMEH__ +#ifndef _WX_TIMEH__ +#define _WX_TIMEH__ #include "wx/object.h" @@ -93,5 +93,5 @@ public: #endif // USE_TIMEDATE #endif - // __TIMEH__ + // _WX_TIMEH__ diff --git a/include/wx/timer.h b/include/wx/timer.h index 65acce19da..4cf5c35b26 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -1,15 +1,19 @@ -#ifndef __TIMERH_BASE__ -#define __TIMERH_BASE__ +#ifndef _WX_TIMER_H_BASE_ +#define _WX_TIMER_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/timer.h" #elif defined(__WXMOTIF__) -#include "wx/xt/timer.h" +#include "wx/motif/timer.h" #elif defined(__WXGTK__) #include "wx/gtk/timer.h" #elif defined(__WXQT__) #include "wx/qt/timer.h" +#elif defined(__WXMAC__) +#include "wx/mac/timer.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/timer.h" #endif #endif - // __TIMERH_BASE__ + // _WX_TIMER_H_BASE_ diff --git a/include/wx/toolbar.h b/include/wx/toolbar.h index 4b5c73acfb..3e09456f59 100644 --- a/include/wx/toolbar.h +++ b/include/wx/toolbar.h @@ -15,6 +15,10 @@ # include "wx/gtk/tbargtk.h" #elif defined(__WXQT__) # include "wx/qt/tbarqt.h" +#elif defined(__WXMAC__) +# include "wx/mac/toolbar.h" +#elif defined(__WXSTUBS__) +# include "wx/stubs/toolbar.h" #endif #endif diff --git a/include/wx/treectrl.h b/include/wx/treectrl.h index bb4644ccff..8d6928b669 100644 --- a/include/wx/treectrl.h +++ b/include/wx/treectrl.h @@ -1,13 +1,19 @@ -#ifndef __TREECTRLH_BASE__ -#define __TREECTRLH_BASE__ +#ifndef _WX_TREECTRL_H_BASE_ +#define _WX_TREECTRL_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/treectrl.h" #elif defined(__WXMOTIF__) #include "wx/generic/treectrl.h" #elif defined(__WXGTK__) +#include "wx/gtk/treectrl.h" +#elif defined(__WXQT__) +#include "wx/qt/treectrl.h" +#elif defined(__WXMAC__) +#include "wx/generic/treectrl.h" +#elif defined(__WXSTUBS__) #include "wx/generic/treectrl.h" #endif #endif - // __TREECTRLH_BASE__ + // _WX_TREECTRL_H_BASE_ diff --git a/include/wx/types.h b/include/wx/types.h index 9545eae4de..962783f387 100644 --- a/include/wx/types.h +++ b/include/wx/types.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __TYPESH__ -#define __TYPESH__ +#ifndef _WX_TYPESH__ +#define _WX_TYPESH__ #ifdef __GNUG__ // #pragma interface "types.h" @@ -93,5 +93,5 @@ #define wxTYPE_USER 500 #endif - // __TYPESH__ + // _WX_TYPESH__ diff --git a/include/wx/utils.h b/include/wx/utils.h index a8603a3fc8..aff90975c1 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __UTILSH__ -#define __UTILSH__ +#ifndef _WX_UTILSH__ +#define _WX_UTILSH__ #ifdef __GNUG__ #pragma interface "utils.h" @@ -309,4 +309,4 @@ void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); #endif //__X__ #endif - // __UTILSH__ + // _WX_UTILSH__ diff --git a/include/wx/validate.h b/include/wx/validate.h index f068eb225c..deb5d79856 100644 --- a/include/wx/validate.h +++ b/include/wx/validate.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __VALIDATEH__ -#define __VALIDATEH__ +#ifndef _WX_VALIDATEH__ +#define _WX_VALIDATEH__ #ifdef __GNUG__ #pragma interface "validate.h" @@ -67,4 +67,4 @@ protected: WXDLLEXPORT_DATA(extern const wxValidator) wxDefaultValidator; #endif - // __VALIDATEH__ + // _WX_VALIDATEH__ diff --git a/include/wx/valtext.h b/include/wx/valtext.h index 26422a77d8..b63fcaf4e2 100644 --- a/include/wx/valtext.h +++ b/include/wx/valtext.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __VALTEXTH__ -#define __VALTEXTH__ +#ifndef _WX_VALTEXTH__ +#define _WX_VALTEXTH__ #ifdef __GNUG__ #pragma interface "valtext.h" diff --git a/include/wx/version.h b/include/wx/version.h index 9e1a8e5728..68f7db190e 100644 --- a/include/wx/version.h +++ b/include/wx/version.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __VERSIONH__ -#define __VERSIONH__ +#ifndef _WX_VERSIONH__ +#define _WX_VERSIONH__ /* Bump-up with each new version */ #define wxMAJOR_VERSION 2 @@ -22,4 +22,4 @@ #define wxVERSION_FLOAT float(wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)) #endif - // __VERSIONH__ + // _WX_VERSIONH__ diff --git a/include/wx/window.h b/include/wx/window.h index e26cbbc9b1..583eb9fb07 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -1,15 +1,19 @@ -#ifndef __WINDOWH_BASE__ -#define __WINDOWH_BASE__ +#ifndef _WX_WINDOW_H_BASE_ +#define _WX_WINDOW_H_BASE_ #if defined(__WXMSW__) #include "wx/msw/window.h" #elif defined(__WXMOTIF__) -#include "wx/xt/window.h" +#include "wx/motif/window.h" #elif defined(__WXGTK__) #include "wx/gtk/window.h" #elif defined(__WXQT__) #include "wx/qt/window.h" +#elif defined(__WXMAC__) +#include "wx/mac/window.h" +#elif defined(__WXSTUBS__) +#include "wx/stubs/window.h" #endif #endif - // __WINDOWH_BASE__ + // _WX_WINDOW_H_BASE_ diff --git a/include/wx/wx.h b/include/wx/wx.h index 4a8529e696..bb68d0fe78 100644 --- a/include/wx/wx.h +++ b/include/wx/wx.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXH__ -#define __WXH__ +#ifndef _WX_WXH__ +#define _WX_WXH__ #include "wx/setup.h" // Which features to include - user editable #include "wx/defs.h" @@ -67,4 +67,4 @@ #include "wx/intl.h" #endif - // __WXH__ + // _WX_WXH__ diff --git a/include/wx/wxexpr.h b/include/wx/wxexpr.h index 11227e2082..89a29f9f93 100644 --- a/include/wx/wxexpr.h +++ b/include/wx/wxexpr.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXEXPRH__ -#define __WXEXPRH__ +#ifndef _WX_WXEXPRH__ +#define _WX_WXEXPRH__ #ifdef __GNUG__ #pragma interface "wxexpr.h" diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h index 71018481a8..9e12d8f875 100644 --- a/include/wx/wxprec.h +++ b/include/wx/wxprec.h @@ -10,7 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// // check if to use precompiled headers -#if (defined(__BORLANDC__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__GNUWIN32__)) // && !defined(WXMAKINGDLL) +#if (defined(__BORLANDC__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__GNUWIN32__)) && defined(__WXMSW__) #if !NOPCH #define WX_PRECOMP #endif diff --git a/include/wx/zstream.h b/include/wx/zstream.h index 326058f3fb..6d68c5fc75 100644 --- a/include/wx/zstream.h +++ b/include/wx/zstream.h @@ -8,8 +8,8 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXZSTREAM_H__ -#define __WXZSTREAM_H__ +#ifndef _WX_WXZSTREAM_H__ +#define _WX_WXZSTREAM_H__ #ifdef __GNUG__ #pragma interface diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 19d2589a38..e32e8a0b31 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -22,6 +22,7 @@ #ifndef WX_PRECOMP #include +#include "wx/string.h" #include "wx/utils.h" #include "wx/app.h" #endif @@ -331,7 +332,7 @@ wxPageSetupData::wxPageSetupData(void) wxPageSetupData::~wxPageSetupData(void) { -#if defined(__WIN95__) +#if defined(__WIN95__) && defined(__WXMSW__) PAGESETUPDLG *pd = (PAGESETUPDLG *)m_pageSetupData; if ( pd && pd->hDevMode ) GlobalFree(pd->hDevMode); @@ -358,7 +359,7 @@ void wxPageSetupData::operator=(const wxPageSetupData& data) m_enableHelp = data.m_enableHelp; } -#if defined(__WIN95__) +#if defined(__WXMSW__) && defined(__WIN95__) void wxPageSetupData::ConvertToNative(void) { PAGESETUPDLG *pd = (PAGESETUPDLG*) m_pageSetupData; diff --git a/src/common/docview.cpp b/src/common/docview.cpp index bcf1f64bb3..cc94f2fd04 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -27,6 +27,7 @@ #if USE_DOC_VIEW_ARCHITECTURE #ifndef WX_PRECOMP +#include "wx/string.h" #include "wx/utils.h" #include "wx/app.h" #include "wx/dc.h" diff --git a/src/common/file.cpp b/src/common/file.cpp index 48683353e0..b32441ff97 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -53,6 +53,9 @@ #include // for GetTempFileName #elif (defined(__UNIX__) || defined(__GNUWIN32__)) #include +#elif (defined(__WXSTUBS__)) + // Have to ifdef this for different environments + #include #else #error "Please specify the header with file functions declarations." #endif //Win/UNIX @@ -94,6 +97,11 @@ #define tell(fd) lseek(fd, 0, SEEK_CUR) #endif //_MSC_VER +#ifdef __BORLANDC__ + #define W_OK 2 + #define R_OK 4 +#endif + // there is no distinction between text and binary files under Unix #ifdef __UNIX__ #define O_BINARY (0) @@ -418,7 +426,7 @@ bool wxTempFile::Open(const wxString& strName) // otherwise rename() in Commit() might not work (if the files are on // different partitions for example). Unfortunately, the only standard // (POSIX) temp file creation function tmpnam() can't do it. - #ifdef __UNIX__ + #if defined(__UNIX__) || defined(__WXSTUBS__) static const char *szMktempSuffix = "XXXXXX"; m_strTemp << strName << szMktempSuffix; mktemp((char *)m_strTemp.c_str()); // will do because length doesn't change diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 24d10b9833..655cd217db 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -85,6 +85,9 @@ wxString wxFileConfig::GetGlobalDir() #ifdef __UNIX__ strDir = "/etc/"; + #elif defined(__WXSTUBS__) + // TODO + wxASSERT( TRUE ) ; #else // Windows #ifndef _MAX_PATH #define _MAX_PATH 512 diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 90b49c111d..295aca336b 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -46,7 +46,7 @@ #include #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #ifndef __GNUWIN32__ #include #include @@ -70,7 +70,7 @@ #include #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "windows.h" #endif @@ -91,7 +91,7 @@ void wxPathList::Add (const wxString& path) void wxPathList::AddEnvList (const wxString& envVariable) { static const char PATH_TOKS[] = -#ifdef __WXMSW__ +#ifdef __WINDOWS__ " ;"; // Don't seperate with colon in DOS (used for drive) #else " :;"; @@ -136,7 +136,7 @@ bool wxPathList::Member (const wxString& path) { wxString path2((char *) node->Data ()); if ( -#if defined(__WXMSW__) || defined(__VMS__) +#if defined(__WINDOWS__) || defined(__VMS__) // Case INDEPENDENT path.CompareTo (path2, wxString::ignoreCase) == 0 #else @@ -167,7 +167,7 @@ wxString wxPathList::FindValidPath (const wxString& file) if (ch != '\\' && ch != '/') strcat (wxBuffer, "/"); strcat (wxBuffer, filename); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ Unix2DosFilename (wxBuffer); #endif if (wxFileExists (wxBuffer)) @@ -194,7 +194,7 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file) lastCh = buf[len-1]; if (lastCh != '/' && lastCh != '\\') { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ strcat(buf, "\\"); #else strcat(buf, "/"); @@ -237,7 +237,7 @@ wxIsAbsolutePath (const wxString& filename) #ifdef __VMS__ || (filename[0] == '[' && filename[1] != '.') #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ /* MSDOS */ || filename[0] == '\\' || (isalpha (filename[0]) && filename[1] == ':') #endif @@ -847,7 +847,11 @@ bool wxMkdir(const wxString& dir) #ifdef __VMS__ return FALSE; #elif (defined(__GNUWIN32__) && !defined(__MINGW32__)) || !defined(__WXMSW__) +#if defined(__WIN32__) // Could happen in __WXSTUBS__ mode + return (mkdir(WXSTRINGCAST dir) == 0); +#else return (mkdir (WXSTRINGCAST dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0); +#endif #else return (mkdir(WXSTRINGCAST dir) == 0); #endif @@ -924,7 +928,7 @@ bool wxPathExists(const char *pszPathName) // Get a temporary filename, opening and closing the file. char *wxGetTempFileName(const wxString& prefix, char *buf) { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #ifndef __WIN32__ char tmp[144]; @@ -1260,7 +1264,7 @@ bool wxSetWorkingDirectory(const wxString& d) { #ifdef __UNIX__ return (chdir(d) == 0); -#elif defined(__WXMSW__) +#elif defined(__WINDOWS__) #ifdef __WIN32__ return (bool)(SetCurrentDirectory(d) != 0); diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 639619c5a7..543e78e18d 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -257,6 +257,12 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) else return NULL; #endif +// TODO for other implementations. This should really go into +// platform-specific directories. +#ifdef __WXSTUBS__ + else return NULL; +#endif + #ifdef __WXGTK__ else { wxColour *col = new wxColour( colour ); diff --git a/src/common/log.cpp b/src/common/log.cpp index d23a3e1c8f..94bf306c74 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -33,6 +33,7 @@ #include #include #include + #include #include #include @@ -489,7 +490,7 @@ void wxLogGui::DoLog(wxLogLevel level, const char *szString) { wxString strTime = TimeStamp(); - #ifdef __WIN32__ + #if defined(__WIN32__) && !defined(__WXSTUBS__) // don't prepend debug/trace here: it goes to the debug window // anyhow, but do put a timestamp OutputDebugString(strTime + szString + "\n\r"); @@ -905,6 +906,8 @@ void Trap() { #ifdef __WXMSW__ DebugBreak(); + #elif defined(__WXSTUBS__) + // TODO #else // Unix raise(SIGTRAP); #endif // Win/Unix diff --git a/src/common/tbarsmpl.cpp b/src/common/tbarsmpl.cpp index a75de10e3b..748dfa1117 100644 --- a/src/common/tbarsmpl.cpp +++ b/src/common/tbarsmpl.cpp @@ -21,7 +21,7 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include "wx/wx.h" #endif #if USE_TOOLBAR @@ -212,8 +212,8 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) if (bitmap && bitmap->Ok()) { - if (bitmap->GetColourMap()) - memDC.SetPalette(*bitmap->GetColourMap()); + if (bitmap->GetPalette()) + memDC.SetPalette(*bitmap->GetPalette()); int ax = (int)tool->m_x, ay = (int)tool->m_y, diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index f52f9480a5..d67663557e 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -39,11 +39,11 @@ // default type is the native one const wxTextFile::Type wxTextFile::typeDefault = wxTextFile:: -#if defined(__WXMSW__) +#if defined(__WINDOWS__) Type_Dos; #elif defined(__UNIX__) Type_Unix; -#elif defined(__MAC__) +#elif defined(__WXMAC__) Type_Mac; // if you feel brave, remove the next line #error "wxTextFile: code for Mac files is untested." diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index a1e02d73a3..2fbcb4c906 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -168,6 +168,8 @@ bool wxGetLocalTime(long *timeZone, int *dstObserved) *timeZone = tp->tm_gmtoff; // ??? *dstObserved = tp->tm_isdst; #endif +#elif defined(__WXSTUBS__) + return FALSE; #else // #error wxGetLocalTime not implemented. struct timeval tp; diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 235b5c1460..3fd650a0d2 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -109,7 +109,7 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar) } #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #ifndef __GNUWIN32__ #define strcasecmp stricmp diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index b9965c1293..9081e3b5ba 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -306,17 +306,25 @@ bool wxGenericGrid::CreateGrid(int nRows, int nCols, wxString **cellValues, shor int objectSizeX = m_totalCols; int pageSizeX = 1; int viewLengthX = m_totalCols; + +/* m_hScrollBar->SetViewLength(viewLengthX); m_hScrollBar->SetObjectLength(objectSizeX); m_hScrollBar->SetPageSize(pageSizeX); +*/ + m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), pageSizeX, objectSizeX, viewLengthX); int objectSizeY = m_totalRows; int pageSizeY = 1; int viewLengthY = m_totalRows; +/* m_vScrollBar->SetViewLength(viewLengthY); m_vScrollBar->SetObjectLength(objectSizeY); m_vScrollBar->SetPageSize(pageSizeY); +*/ + + m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), pageSizeY, objectSizeY, viewLengthY); AdjustScrollbars(); @@ -842,7 +850,7 @@ void wxGenericGrid::DrawCellBackground(wxDC *dc, wxRectangle *rect, int row, int dc->SetBrush(*cell->GetBackgroundBrush()); dc->SetPen(*wxTRANSPARENT_PEN); -#ifdef 0 // In wxWin 2.0 the dc code is exact. RR. +#if 0 // In wxWin 2.0 the dc code is exact. RR. #ifdef __WXMOTIF__ dc->DrawRectangle(rect->x+1, rect->y+1, rect->width-1, rect->height-1); #else diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 7f0ec5df0f..9b23bbff8f 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -112,8 +112,6 @@ wxSplitterWindow::wxSplitterWindow(wxWindow *parent, wxWindowID id, const wxPoin // Eventually, we'll respond to colour change messages InitColours(); - SetDoubleClick(TRUE); - // For debugging purposes, to see the background. // SetBackground(wxBLUE_BRUSH); } diff --git a/src/makeb32.env b/src/makeb32.env index 2ecc973fdb..57e62fa081 100644 --- a/src/makeb32.env +++ b/src/makeb32.env @@ -4,7 +4,7 @@ WXDIR = $(WXWIN) CFG = $(WXDIR)\src\msw\wxwin32.cfg WXLIBDIR = $(WXDIR)\lib WXINC = $(WXDIR)\include -WIN95FLAG = -D__WIN95__ +WIN95FLAG = -D__WIN95__ -D__WINDOWS__ !ifndef FINAL FINAL=0 diff --git a/src/makeg95.env b/src/makeg95.env index 2a0ace01a5..d9aa03c776 100644 --- a/src/makeg95.env +++ b/src/makeg95.env @@ -101,19 +101,8 @@ RSCSUFF=rsc # many things as we can, to catch portability problems sooner. WARN = -Wall -# -pedantic -Wpointer-arith -Wtraditional -Wcast-align \ -# -Wenum-clash -Wnested-externs -Woverloaded-virtual \ -# -Winline -Wconversion - -# not good with too few 'const' decls in wxWindows -# -Wcast-qual -Wwrite-strings - -# too hard (problems with system header files) -# -Wstrict-prototypes -Wmissing-prototypes -# -Wredudant-decs - # Which GUI, -Dwx_xview or -Dwx_motif (don't change this) -GUI = -D__WXMSW__ +GUI = -D__WXMSW__ -D__WINDOWS__ # Optimization # OPT = -O @@ -126,7 +115,6 @@ OPT = # AROPTIONS = crs # For IRIX and Solaris (both SYSVR4). AROPTIONS = ruv RANLIB = ranlib -# RANLIB = echo # Uncomment this line for IRIX and Solaris # Compiler libraries: defaults to GCC libraries # Solaris: -lgen -ldl -lsocket -lnsl @@ -149,31 +137,6 @@ RANLIB = ranlib #added for win95 COMPPATHS= -# HP-specific compiler library: an AIAI convenience -HPCOMPLIBS= - -# LDLIBS for specific GUIs - -# The following for LINUX and Motif 2.0: -#MOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXpm -lXt -lXext -lX11 -lm - -#BASICMOTIFLDLIBS = -lwx_motif /aiai/packages/motif1.2.1/motif/sun4/lib/libXm.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXmu.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXt.a /aiai/packages/motif1.2.1/motif/sun4/lib/libX11.a -lm -# Apparently libg++ (in COMPLIBS) should go before libXm because of a clash of -# function name: re_create. -#BASICMOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm - -#MOTIFLDLIBS = $(BASICMOTIFLDLIBS) $(COMPLIBS) - -#XVIEWLDLIBS = -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS) -#HPLDLIBS=-lwx_hp -lXm -lXmu -lXt -lX11 -lm -#CYGNUSLDLIBS= -# Default LDLIBS for XView (don't change this) -#LDLIBS = $(CYGNUSLDLIBS) - -# _ol or _motif (don't need to change, the makefiles will take -# care of it if you use motif/hp/xview targets) -#GUISUFFIX=_ol - ########################## Directories ############################### @@ -186,7 +149,7 @@ WXSRC=$(WXDIR)/src/msw WXINC=$(WXDIR)/include WXBASESRC=$(WXDIR)/src/common WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF) -INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(EXTRAINC)$(COMPPATHS) +INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/include/wx/msw/gnuwin32 -I$(WXDIR)/src/zlib $(EXTRAINC)$(COMPPATHS) RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)\include" #LIBS = -lctl3d32 $(WXLIB) $(WINLIBS) $(COMPLIBS) @@ -207,9 +170,6 @@ CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEB CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT) LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib -# Extra patch link for XView -#XVIEW_LINK = $(WXDIR)/src/x/objects_ol/sb_scrol.o # $(WXDIR)/src/x/objects_ol/xvwinlp.o - .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c # Set these in a batch file instead e.g. install/cygnus.bat diff --git a/src/makemsc.env b/src/makemsc.env index d30e9badd2..e12f7b692b 100644 --- a/src/makemsc.env +++ b/src/makemsc.env @@ -56,15 +56,15 @@ LIBS=$(WXLIB) $(EXTRALIBS) oldnames libw llibcew commdlg ddeml shell mmsystem $( !if "$(DLL)" == "0" PCH=WX.PCH PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) -CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ $(PRECOMP) -CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ +CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__ $(PRECOMP) +CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__ LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE DUMMY=dummy !else PCH=WX.PCH PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) -CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ $(PRECOMP) -CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ +CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__$(PRECOMP) +CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__ LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE DUMMY=dummydll !endif diff --git a/src/msw/app.cpp b/src/msw/app.cpp index f89afb5f73..2380393bfd 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -53,7 +53,7 @@ #endif // use debug CRT functions for memory leak detections in VC++ -/* THIS CRAPS OUT in VC++ 5. +/* Doesn't work when using the makefiles, for some reason. #if defined(__WXDEBUG__) && defined(_MSC_VER) #include #endif @@ -423,8 +423,7 @@ int wxEntry(WXHINSTANCE hInstance, WXHINSTANCE WXUNUSED(hPrevInstance), char *m_ { wxhInstance = (HINSTANCE) hInstance; -/* No, sorry, whatever this is, forget it. Doesn't work with VC++ 5. - +/* Doesn't work when using the makefiles, for some reason. #if defined(__WXDEBUG__) && defined(_MSC_VER) // do check for memory leaks on program exit // (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index f34b255507..bd81c9362d 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -386,7 +386,7 @@ void wxDC::DrawLine(long x1, long y1, long x2, long y2) CalcBoundingBox(x2, y2); } -void wxDC::DrawArc(long x1,long y1,long x2,long y2,double xc,double yc) +void wxDC::DrawArc(long x1,long y1,long x2,long y2, long xc, long yc) { double dx = xc-x1 ; double dy = yc-y1 ; diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index b44de26681..9e09253b3f 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -576,11 +576,12 @@ $(CFG): makefile.b32 -WE -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib --I$(WXDIR)\include\msw\gnuwin32 +-I$(WXDIR)\include\wx\msw\gnuwin32 -L$(BCCDIR)\lib -D__WXWIN__ -D__WXMSW__ +-D__WINDOWS__ -DWIN32 $(OPT) $(DEBUG_FLAGS) diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt index 695ae309cd..f95967bf11 100644 --- a/src/msw/makefile.nt +++ b/src/msw/makefile.nt @@ -92,8 +92,8 @@ COMMONOBJS = \ $(COMMDIR)\log.obj \ $(COMMDIR)\memory.obj \ $(COMMDIR)\module.obj \ - $(COMMDIR)\object.obj \ $(COMMDIR)\odbc.obj \ + $(COMMDIR)\object.obj \ $(COMMDIR)\postscrp.obj \ $(COMMDIR)\prntbase.obj \ $(COMMDIR)\resource.obj \ @@ -120,7 +120,6 @@ COMMONOBJS = \ $(COMMDIR)\datstrm.obj \ $(COMMDIR)\wincmn.obj - MSWOBJS = \ $(MSWDIR)\accel.obj \ $(MSWDIR)\app.obj \ diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 1569498479..490d7d0327 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2061,7 +2061,7 @@ void wxWindow::MSWOnWindowPosChanging(void *WXUNUSED(lpPos)) } // Deal with child commands from buttons etc. -bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control)) +bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control) { #if WXDEBUG > 1 wxDebugMsg("wxWindow::MSWOnCommand\n"); @@ -2093,27 +2093,11 @@ bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control)) } else { -#if WXDEBUG > 1 - wxDebugMsg("Could not find item!\n"); - char buf[100]; - wxDebugMsg("Item ids for this panel:\n"); - - wxNode *current = GetChildren()->First(); - while (current) - { - wxObject *obj = (wxObject *)current->Data() ; - if (obj->IsKindOf(CLASSINFO(wxControl))) - { - wxControl *item = (wxControl *)current->Data(); - sprintf(buf, " %d\n", (int)item->m_windowId); - wxDebugMsg(buf); - } - current = current->Next(); - } - wxYield(); -#endif - return FALSE; + wxWindow *win = wxFindWinFromHandle(control); + if (win) + return win->MSWCommand(cmd, id); } + return FALSE; } long wxWindow::MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam) diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak index dad8b1a291..39bc88294f 100644 --- a/src/ntwxwin.mak +++ b/src/ntwxwin.mak @@ -145,9 +145,9 @@ PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb MAKEPRECOMP=/YcWX/WXPREC.H !endif -CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT +CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT # If you don't include wxprec.h, use CPPFLAGS2 -CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT +CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup DUMMY=dummy @@ -162,8 +162,8 @@ DUMMY=dummy !endif PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb -CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D_WINDLL -CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D_WINDLL +CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL +CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL LINKFLAGS=$(LINK_DEBUG_FLAGS) -machine:i386 -subsystem:windows,$(APPVER) -dll # -entry:_DllMainCRTStartup$(DLLENTRY) !endif diff --git a/src/stubs/accel.cpp b/src/stubs/accel.cpp index 707ba496ff..b0b8734d55 100644 --- a/src/stubs/accel.cpp +++ b/src/stubs/accel.cpp @@ -15,6 +15,7 @@ #include "wx/setup.h" #include "wx/accel.h" +#include "wx/string.h" #if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp index f54a6806e2..d879be6712 100644 --- a/src/stubs/app.cpp +++ b/src/stubs/app.cpp @@ -27,14 +27,18 @@ #include "wx/msgdlg.h" #include "wx/log.h" #include "wx/module.h" +#include "wx/memory.h" #if USE_WX_RESOURCES #include "wx/resource.h" #endif +#if USE_POSTSCRIPT +#include "wx/postscrp.h" +#endif + #include -#if defined(__WIN95__) && !defined(__GNUWIN32__) extern char *wxBuffer; extern wxList wxPendingDelete; @@ -145,7 +149,7 @@ int wxEntry( int argc, char *argv[] ) return 0; }; - wxTheApp = (* wxApp::GetInitializerFunction()) (); + wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) (); }; if (!wxTheApp) @@ -170,8 +174,6 @@ int wxEntry( int argc, char *argv[] ) if (!wxTheApp->OnInit()) return 0; - wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0); - int retValue = 0; if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun(); diff --git a/src/stubs/checklst.cpp b/src/stubs/checklst.cpp index c7121e553d..ecabf5408e 100644 --- a/src/stubs/checklst.cpp +++ b/src/stubs/checklst.cpp @@ -34,8 +34,6 @@ // define event table // ------------------ BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox) - EVT_CHAR(wxCheckListBox::OnChar) - EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick) END_EVENT_TABLE() // control creation @@ -71,7 +69,6 @@ bool wxCheckListBox::IsChecked(uint uiIndex) const void wxCheckListBox::Check(uint uiIndex, bool bCheck) { // TODO - return FALSE; } diff --git a/src/stubs/colordlg.cpp b/src/stubs/colordlg.cpp index 9e970859aa..2275a9a39d 100644 --- a/src/stubs/colordlg.cpp +++ b/src/stubs/colordlg.cpp @@ -1,6 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: colordlg.cpp -// Purpose: wxColourDialog class +// Purpose: wxColourDialog class. NOTE: you can use the generic class +// if you wish, instead of implementing this. // Author: AUTHOR // Modified by: // Created: ??/??/98 @@ -13,7 +14,7 @@ #pragma implementation "colordlg.h" #endif -#include "wx/colordlg.h" +#include "wx/stubs/colordlg.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) diff --git a/src/stubs/control.cpp b/src/stubs/control.cpp index 651b272953..b141a80ff1 100644 --- a/src/stubs/control.cpp +++ b/src/stubs/control.cpp @@ -37,7 +37,7 @@ wxControl::~wxControl() wxWindow *parent = (wxWindow *)GetParent(); if (parent) { - if (parent->GetDefaultItem() == this) + if (parent->GetDefaultItem() == (wxButton*) this) parent->SetDefaultItem(NULL); } } @@ -53,17 +53,6 @@ wxString wxControl::GetLabel() const return wxString(""); } -/* - * Allocates control IDs within the appropriate range - */ - -int NewControlId() -{ - static int s_controlId = 0; - s_controlId ++; - return s_controlId; -} - void wxControl::ProcessCommand (wxCommandEvent & event) { // Tries: @@ -80,11 +69,6 @@ void wxControl::ProcessCommand (wxCommandEvent & event) } } -void wxControl::SetClientSize (int width, int height) -{ - SetSize (-1, -1, width, height); -} - void wxControl::Centre (int direction) { int x, y, width, height, panel_width, panel_height, new_x, new_y; diff --git a/src/stubs/cursor.cpp b/src/stubs/cursor.cpp index c856f5e9e0..f5cc609f7e 100644 --- a/src/stubs/cursor.cpp +++ b/src/stubs/cursor.cpp @@ -14,6 +14,7 @@ #endif #include "wx/cursor.h" +#include "wx/icon.h" #if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) diff --git a/src/stubs/data.cpp b/src/stubs/data.cpp index d706f82334..ae2895408b 100644 --- a/src/stubs/data.cpp +++ b/src/stubs/data.cpp @@ -131,6 +131,7 @@ const char *wxDoubleToStringStr = "%.2f"; wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL; #endif +#if USE_SHARED_LIBRARY ///// Event tables (also must be in one, statically-linked file for shared libraries) // This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here @@ -140,6 +141,7 @@ const wxEventTable wxEvtHandler::sm_eventTable = { NULL, &wxEvtHandler::sm_eventTableEntries[0] }; const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } }; +#endif const wxSize wxDefaultSize(-1, -1); const wxPoint wxDefaultPosition(-1, -1); diff --git a/src/stubs/dc.cpp b/src/stubs/dc.cpp index 4cfe7305cc..466c670c91 100644 --- a/src/stubs/dc.cpp +++ b/src/stubs/dc.cpp @@ -34,8 +34,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) // wxDC //----------------------------------------------------------------------------- -IMPLEMENT_ABSTRACT_CLASS(wxDC,wxObject) - wxDC::wxDC(void) { m_ok = FALSE; diff --git a/src/stubs/dcclient.cpp b/src/stubs/dcclient.cpp index e25920d94f..53a84e6928 100644 --- a/src/stubs/dcclient.cpp +++ b/src/stubs/dcclient.cpp @@ -47,7 +47,7 @@ wxPaintDC::~wxPaintDC(void) }; void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), - wxColour *WXUNUSED(col), int WXUNUSED(style) ) + wxColour* WXUNUSED(col), int WXUNUSED(style) ) { }; @@ -68,7 +68,7 @@ void wxPaintDC::CrossHair( long x, long y ) }; -void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) +void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) { if (!Ok()) return; @@ -347,13 +347,13 @@ void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height long wxPaintDC::GetCharWidth(void) { if (!Ok()) return 0; - + return 0; }; long wxPaintDC::GetCharHeight(void) { if (!Ok()) return 0; - + return 0; }; void wxPaintDC::Clear(void) diff --git a/src/stubs/dcmemory.cpp b/src/stubs/dcmemory.cpp index c6066bb1ab..7cbd330821 100644 --- a/src/stubs/dcmemory.cpp +++ b/src/stubs/dcmemory.cpp @@ -15,10 +15,6 @@ #include "wx/dcmemory.h" -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC) -#endif - //----------------------------------------------------------------------------- // wxMemoryDC //----------------------------------------------------------------------------- diff --git a/src/stubs/dialog.cpp b/src/stubs/dialog.cpp index 9b72fb0f69..c278536c60 100644 --- a/src/stubs/dialog.cpp +++ b/src/stubs/dialog.cpp @@ -107,10 +107,8 @@ wxDialog::~wxDialog() // By default, pressing escape cancels the dialog void wxDialog::OnCharHook(wxKeyEvent& event) { - if (GetHWND()) + if (event.m_keyCode == WXK_ESCAPE) { - if (event.m_keyCode == WXK_ESCAPE) - { // Behaviour changed in 2.0: we'll send a Cancel message // to the dialog instead of Close. wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); @@ -118,7 +116,6 @@ void wxDialog::OnCharHook(wxKeyEvent& event) GetEventHandler()->ProcessEvent(cancelEvent); return; - } } // We didn't process this event. event.Skip(); diff --git a/src/stubs/dirdlg.cpp b/src/stubs/dirdlg.cpp index 7fe15310ee..095621b978 100644 --- a/src/stubs/dirdlg.cpp +++ b/src/stubs/dirdlg.cpp @@ -17,7 +17,6 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/dirdlg.h" -#endif #include "wx/cmndata.h" diff --git a/src/stubs/filedlg.cpp b/src/stubs/filedlg.cpp index cf096037d6..2aeffdf926 100644 --- a/src/stubs/filedlg.cpp +++ b/src/stubs/filedlg.cpp @@ -17,6 +17,7 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/filedlg.h" +#include "wx/intl.h" #if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxFileDialog, wxDialog) @@ -100,7 +101,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, int wxFileDialog::ShowModal() { // TODO - wxID_CANCEL; + return wxID_CANCEL; } // Generic file load/save dialog diff --git a/src/stubs/font.cpp b/src/stubs/font.cpp index 5835259696..493a6a25ba 100644 --- a/src/stubs/font.cpp +++ b/src/stubs/font.cpp @@ -13,7 +13,10 @@ #pragma implementation "font.h" #endif +#include "wx/defs.h" +#include "wx/string.h" #include "wx/font.h" +#include "wx/gdicmn.h" #if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) diff --git a/src/stubs/fontdlg.cpp b/src/stubs/fontdlg.cpp index 4bfa59eac4..60e8e9b987 100644 --- a/src/stubs/fontdlg.cpp +++ b/src/stubs/fontdlg.cpp @@ -1,6 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: fontdlg.cpp -// Purpose: wxFontDialog class +// Purpose: wxFontDialog class. NOTE: you can use the generic class +// if you wish, instead of implementing this. // Author: AUTHOR // Modified by: // Created: ??/??/98 @@ -13,7 +14,7 @@ #pragma implementation "fontdlg.h" #endif -#include "wx/fontdlg.h" +#include "wx/stubs/fontdlg.h" #include "wx/cmndata.h" #if !USE_SHARED_LIBRARY diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp index 3d9b5b0004..5c22818c61 100644 --- a/src/stubs/frame.cpp +++ b/src/stubs/frame.cpp @@ -17,6 +17,11 @@ #include "wx/statusbr.h" #include "wx/toolbar.h" #include "wx/menuitem.h" +#include "wx/menu.h" +#include "wx/dcclient.h" +#include "wx/dialog.h" +#include "wx/settings.h" +#include "wx/app.h" extern wxList wxModelessWindows; extern wxList wxPendingDelete; @@ -512,9 +517,6 @@ void wxFrame::PositionToolBar() // the toolbar/status bar were added. // So DEFINITELY replace the line below with something appropriate. - wxCHECK_MSG( TRUE, FALSE, - "PositionToolBar not implemented properly, see frame.cpp" ); - GetClientSize(& cw, &ch); if ( GetStatusBar() ) diff --git a/src/stubs/gauge.cpp b/src/stubs/gauge.cpp index 8e11c5001b..a85fbc498f 100644 --- a/src/stubs/gauge.cpp +++ b/src/stubs/gauge.cpp @@ -93,13 +93,3 @@ int wxGauge::GetValue() const return m_gaugePos; } -void wxGauge::SetForegroundColour(const wxColour& col) -{ - m_foregroundColour = col ; -} - -void wxGauge::SetBackgroundColour(const wxColour& col) -{ - m_backgroundColour = col ; -} - diff --git a/src/stubs/imaglist.cpp b/src/stubs/imaglist.cpp index 7c18d9f464..4cb47b4e69 100644 --- a/src/stubs/imaglist.cpp +++ b/src/stubs/imaglist.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: imaglist.cpp -// Purpose: wxImageList +// Purpose: wxImageList. You may wish to use the generic version. // Author: AUTHOR // Modified by: // Created: ??/??/98 @@ -13,7 +13,7 @@ #pragma implementation "imaglist.h" #endif -#include "wx/msw/imaglist.h" +#include "wx/stubs/imaglist.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject) diff --git a/src/stubs/listbox.cpp b/src/stubs/listbox.cpp index a54523ab3d..1dad21e12c 100644 --- a/src/stubs/listbox.cpp +++ b/src/stubs/listbox.cpp @@ -14,7 +14,7 @@ #endif #include "wx/listbox.h" - +#include "wx/settings.h" #include "wx/dynarray.h" #include "wx/log.h" @@ -63,11 +63,6 @@ wxListBox::~wxListBox() { } -void wxListBox::SetupColours() -{ - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); -} - void wxListBox::SetFirstItem(int N) { // TODO diff --git a/src/stubs/listctrl.cpp b/src/stubs/listctrl.cpp index a659399c63..0f4ed673a5 100644 --- a/src/stubs/listctrl.cpp +++ b/src/stubs/listctrl.cpp @@ -13,7 +13,8 @@ #pragma implementation "listctrl.h" #endif -#include "wx/listctrl.h" +#include "wx/stubs/textctrl.h" +#include "wx/stubs/listctrl.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl) @@ -365,17 +366,14 @@ void wxListCtrl::SetImageList(wxImageList *imageList, int which) int flags = 0; if ( which == wxIMAGE_LIST_NORMAL ) { - flags = LVSIL_NORMAL; m_imageListNormal = imageList; } else if ( which == wxIMAGE_LIST_SMALL ) { - flags = LVSIL_SMALL; m_imageListSmall = imageList; } else if ( which == wxIMAGE_LIST_STATE ) { - flags = LVSIL_STATE; m_imageListState = imageList; } // TODO set image list diff --git a/src/stubs/main.cpp b/src/stubs/main.cpp index d90dc2c036..47a9924bae 100644 --- a/src/stubs/main.cpp +++ b/src/stubs/main.cpp @@ -13,6 +13,6 @@ int main(int argc, char* argv[]) { - return wxEntry(argc, argv[]); + return wxEntry(argc, argv); } diff --git a/src/stubs/makefile.nt b/src/stubs/makefile.nt new file mode 100644 index 0000000000..2865fbcec3 --- /dev/null +++ b/src/stubs/makefile.nt @@ -0,0 +1,955 @@ +# +# File: makefile.nt +# Author: Julian Smart +# Created: 1997 +# Updated: +# Copyright: (c) 1997, Julian Smart +# +# "%W% %G%" +# +# Makefile : Builds wxWindows stubs library wxstubs.lib for VC++ (32-bit) +# Arguments: +# +# FINAL=1 argument to nmake to build version with no debugging info. +# + +!include + +APPVER=3.50 # 4.0 +# This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). +WINVERSION=-DWINVER=0x0400 + +# On Alpha machines, change to CPU=ALPHA +CPU=i386 + +# Suffixes +OBJSUFF=obj +SRCSUFF=cpp + +WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 $(WINVERSION) -D__WIN32__ -D__WINDOWS__ +WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) +WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ + comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib # libci.lib # libci.lib required for VC++ 4.2 + +# Change this to your WXWIN directory +WXDIR=$(WXWIN) + +WXSRC=$(WXDIR)\src\stubs +WXINC=$(WXDIR)\include +WXBASESRC=$(WXDIR)\src\common + +WXLIB=$(WXDIR)\lib\wxstubs.lib + +EXTRADLLFLAGS= + +INC=-I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(EXTRAINC) +LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) + +!ifndef FINAL +FINAL=0 +DEBUG=1 +!endif + +# Set this to 1 if you don't want to use precompiled headers +NOPCH=1 + +OPTIONS= + +!if "$(FINAL)" == "0" +OPT = /Od /Gy +# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated +DEBUG_FLAGS= /Zi # /FR +LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE +CRTFLAG=/MD +!else +# /O1 - smallest code +# /O2 - fastest code +OPT = /O1 # /O2 # /Od +DEBUG_FLAGS= +LINK_DEBUG_FLAGS=/RELEASE +CRTFLAG=/MD +!endif + +PCH= +PRECOMP= +MAKEPRECOMP= + +CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXSTUBS__ /DDEBUG=1 $(INC) $(OPT) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 +# If you don't include wxprec.h, use CPPFLAGS2 +CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXSTUBS__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 +LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup + +THISDIR=$(WXWIN)\src\stubs + +LIBTARGET=$(WXLIB) + +# Please set these according to the settings in wx_setup.h, so we can include +# the appropriate libraries in wx.lib + +PERIPH_LIBS= +PERIPH_TARGET= +PERIPH_CLEAN_TARGET= + +GENDIR=..\generic +COMMDIR=..\common +STUBSDIR=. + +DOCDIR = $(WXDIR)\docs + +GENERICOBJS= \ + $(GENDIR)\choicdgg.obj \ + $(GENDIR)\colrdlgg.obj \ + $(GENDIR)\fontdlgg.obj \ + $(GENDIR)\gridg.obj \ + $(GENDIR)\msgdlgg.obj \ + $(GENDIR)\panelg.obj \ + $(GENDIR)\printps.obj \ + $(GENDIR)\prntdlgg.obj \ + $(GENDIR)\scrolwin.obj \ + $(GENDIR)\splitter.obj \ + $(GENDIR)\statusbr.obj \ + $(GENDIR)\tabg.obj \ + $(GENDIR)\textdlgg.obj + +# $(GENDIR)\helpxlp.obj \ + +COMMONOBJS = \ + $(COMMDIR)\cmndata.obj \ + $(COMMDIR)\config.obj \ + $(COMMDIR)\docview.obj \ + $(COMMDIR)\docmdi.obj \ + $(COMMDIR)\dynarray.obj \ + $(COMMDIR)\event.obj \ + $(COMMDIR)\file.obj \ + $(COMMDIR)\filefn.obj \ + $(COMMDIR)\fileconf.obj \ + $(COMMDIR)\framecmn.obj \ + $(COMMDIR)\gdicmn.obj \ + $(COMMDIR)\intl.obj \ + $(COMMDIR)\ipcbase.obj \ + $(COMMDIR)\helpbase.obj \ + $(COMMDIR)\layout.obj \ + $(COMMDIR)\log.obj \ + $(COMMDIR)\memory.obj \ + $(COMMDIR)\module.obj \ + $(COMMDIR)\object.obj \ + $(COMMDIR)\postscrp.obj \ + $(COMMDIR)\prntbase.obj \ + $(COMMDIR)\resource.obj \ + $(COMMDIR)\tbarbase.obj \ + $(COMMDIR)\tbarsmpl.obj \ + $(COMMDIR)\textfile.obj \ + $(COMMDIR)\timercmn.obj \ + $(COMMDIR)\utilscmn.obj \ + $(COMMDIR)\validate.obj \ + $(COMMDIR)\valtext.obj \ + $(COMMDIR)\date.obj \ + $(COMMDIR)\hash.obj \ + $(COMMDIR)\list.obj \ + $(COMMDIR)\string.obj \ + $(COMMDIR)\time.obj \ + $(COMMDIR)\wxexpr.obj \ + $(COMMDIR)\y_tab.obj \ + $(COMMDIR)\extended.obj \ + $(COMMDIR)\process.obj \ + $(COMMDIR)\fstream.obj \ + $(COMMDIR)\mstream.obj \ + $(COMMDIR)\zstream.obj \ + $(COMMDIR)\stream.obj \ + $(COMMDIR)\datstrm.obj \ + $(COMMDIR)\wincmn.obj + +# $(COMMDIR)\odbc.obj \ + +STUBSOBJS = \ + $(STUBSDIR)\accel.obj \ + $(STUBSDIR)\app.obj \ + $(STUBSDIR)\bitmap.obj \ + $(STUBSDIR)\bmpbuttn.obj \ + $(STUBSDIR)\brush.obj \ + $(STUBSDIR)\button.obj \ + $(STUBSDIR)\checkbox.obj \ + $(STUBSDIR)\checklst.obj \ + $(STUBSDIR)\choice.obj \ + $(STUBSDIR)\clipbrd.obj \ + $(STUBSDIR)\colordlg.obj \ + $(STUBSDIR)\colour.obj \ + $(STUBSDIR)\combobox.obj \ + $(STUBSDIR)\control.obj \ + $(STUBSDIR)\cursor.obj \ + $(STUBSDIR)\data.obj \ + $(STUBSDIR)\dc.obj \ + $(STUBSDIR)\dcmemory.obj \ + $(STUBSDIR)\dcclient.obj \ + $(STUBSDIR)\dcscreen.obj \ + $(STUBSDIR)\dialog.obj \ + $(STUBSDIR)\dirdlg.obj \ + $(STUBSDIR)\filedlg.obj \ + $(STUBSDIR)\font.obj \ + $(STUBSDIR)\fontdlg.obj \ + $(STUBSDIR)\frame.obj \ + $(STUBSDIR)\gauge.obj \ + $(STUBSDIR)\gdiobj.obj \ + $(STUBSDIR)\helpxxxx.obj \ + $(STUBSDIR)\icon.obj \ + $(STUBSDIR)\imaglist.obj \ + $(STUBSDIR)\joystick.obj \ + $(STUBSDIR)\listbox.obj \ + $(STUBSDIR)\listctrl.obj \ + $(STUBSDIR)\main.obj \ + $(STUBSDIR)\mdi.obj \ + $(STUBSDIR)\menu.obj \ + $(STUBSDIR)\menuitem.obj \ + $(STUBSDIR)\metafile.obj \ + $(STUBSDIR)\minifram.obj \ + $(STUBSDIR)\msgdlg.obj \ + $(STUBSDIR)\notebook.obj \ + $(STUBSDIR)\palette.obj \ + $(STUBSDIR)\pen.obj \ + $(STUBSDIR)\printdlg.obj \ + $(STUBSDIR)\print.obj \ + $(STUBSDIR)\radiobox.obj \ + $(STUBSDIR)\radiobut.obj \ + $(STUBSDIR)\region.obj \ + $(STUBSDIR)\scrolbar.obj \ + $(STUBSDIR)\settings.obj \ + $(STUBSDIR)\slider.obj \ + $(STUBSDIR)\spinbutt.obj \ + $(STUBSDIR)\statbmp.obj \ + $(STUBSDIR)\statbox.obj \ + $(STUBSDIR)\statusbr.obj \ + $(STUBSDIR)\stattext.obj \ + $(STUBSDIR)\tabctrl.obj \ + $(STUBSDIR)\taskbar.obj \ + $(STUBSDIR)\toolbar.obj \ + $(STUBSDIR)\textctrl.obj \ + $(STUBSDIR)\thread.obj \ + $(STUBSDIR)\timer.obj \ + $(STUBSDIR)\treectrl.obj \ + $(STUBSDIR)\utils.obj \ + $(STUBSDIR)\utilsexc.obj \ + $(STUBSDIR)\wave.obj \ + $(STUBSDIR)\window.obj + + +OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(STUBSOBJS) + +# Normal, static library +all: $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET) + +$(WXDIR)\lib\wxstubs.lib: $(OBJECTS) $(PERIPH_LIBS) + -erase $(LIBTARGET) + $(implib) @<< +-out:$@ +-machine:$(CPU) +$(OBJECTS) $(PERIPH_LIBS) +<< + +######################################################## +# Windows-specific objects + +$(STUBSDIR)/accel.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/app.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/bitmap.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/bmpbuttn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/brush.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/button.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/choice.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/checkbox.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/checklst.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/clipbrd.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/colordlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/colour.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/combobox.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/control.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/cursor.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/data.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dc.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dcmemory.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dcclient.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dcprint.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dcscreen.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dialog.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/dirdlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/filedlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/font.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/fontdlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/frame.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/gauge.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/gdiobj.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/icon.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/imaglist.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/joystick.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/listbox.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + +$(STUBSDIR)/listctrl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + +$(STUBSDIR)/main.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/mdi.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/menu.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/menuitem.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/metafile.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/minifram.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/msgdlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/notebook.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/palette.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/pen.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/printdlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/print.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/radiobox.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/radiobut.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/region.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/scrolbar.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/settings.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/slider.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/spinbutt.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/statbmp.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/statbox.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/statusbr.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/stattext.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/tabctrl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/taskbar.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/toolbar.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/textctrl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/thread.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/timer.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/treectrl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/utils.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/utilsexc.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/wave.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(STUBSDIR)/window.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +######################################################## +# Common objects (always compiled) + +$(COMMDIR)/cmndata.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/config.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/db.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/dbtable.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/docview.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/docmdi.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/dynarray.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/event.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/file.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/fileconf.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/filefn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/framecmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/gdicmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/intl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/ipcbase.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/helpbase.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/layout.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/log.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/memory.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/module.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/object.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/odbc.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/postscrp.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/prntbase.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/resource.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/tbarbase.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/tbarsmpl.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/textfile.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/timercmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/utilscmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/validate.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/valtext.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/date.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/wxexpr.obj: $*.$(SRCSUFF) + echo $(CPPFLAGS) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/hash.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/list.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/string.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/matrix.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +#$(COMMDIR)/wxstrgnu/wxstrgnu.obj: $*.$(SRCSUFF) +# cl @<< +#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ +#<< + +#$(COMMDIR)/wxstrgnu/wxregex.obj: $*.$(SRCSUFF) +# cl @<< +#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ +#<< + +$(COMMDIR)/time.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)\stream.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)\fstream.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)\mstream.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)\zstream.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)\datstrm.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/extended.obj: $*.c + cl @<< +$(CPPFLAGS2) /c /Tp $*.c /Fo$@ +<< + +$(COMMDIR)/process.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/wincmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c + cl @<< +$(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@ +<< + +$(COMMDIR)/y_tab.c: $(COMMDIR)/dosyacc.c + copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c + +$(COMMDIR)/lex_yy.c: $(COMMDIR)/doslex.c + copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c + +######################################################## +# Generic objects (not always compiled, depending on +# whether platforms have native implementations) + +$(GENDIR)/choicdgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/colrdlgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/fontdlgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/gridg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/helpxlp.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/msgdlgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/panelg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/printps.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/prntdlgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/scrolwin.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/splitter.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/statusbr.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/tabg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(GENDIR)/textdlgg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + +$(OBJECTS): $(WXDIR)/include/wx/stubs/setup.h + +clean: $(PERIPH_CLEAN_TARGET) + -erase *.obj + -erase $(LIBTARGET) + -erase $(WXDIR)\lib\*.pdb + -erase *.pdb + -erase *.sbr + -erase *.pch + cd $(WXDIR)\src\stubs + cd $(GENDIR) + -erase *.pdb + -erase *.sbr + -erase *.obj + cd $(WXDIR)\src\stubs + cd $(COMMDIR) + -erase *.pdb + -erase *.sbr + -erase *.obj + -erase y_tab.c + -erase lex_yy.c + cd $(WXDIR)\src\stubs + +cleanall: clean + diff --git a/src/stubs/mdi.cpp b/src/stubs/mdi.cpp index bcd7785c0d..95e05263a0 100644 --- a/src/stubs/mdi.cpp +++ b/src/stubs/mdi.cpp @@ -14,6 +14,8 @@ #endif #include "wx/mdi.h" +#include "wx/menu.h" +#include "wx/settings.h" extern wxList wxModelessWindows; diff --git a/src/stubs/menu.cpp b/src/stubs/menu.cpp index 217e6c8b88..7840613575 100644 --- a/src/stubs/menu.cpp +++ b/src/stubs/menu.cpp @@ -25,6 +25,7 @@ #include "wx/menu.h" #include "wx/menuitem.h" #include "wx/log.h" +#include "wx/utils.h" // other standard headers // ---------------------- @@ -293,11 +294,12 @@ void wxMenu::ProcessCommand(wxCommandEvent & event) { processed = GetEventHandler()->ProcessEvent(event); } - +/* TODO // Try the window the menu was popped up from (and up // through the hierarchy) if ( !processed && GetInvokingWindow()) processed = GetInvokingWindow()->ProcessEvent(event); +*/ } bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) @@ -318,7 +320,7 @@ wxMenuBar::wxMenuBar() // TODO } -wxMenuBar::wxMenuBar(int n, wxMenu *Mmnus[], const wxString titles[]) +wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[]) { m_eventHandler = this; m_menuCount = n; @@ -560,7 +562,7 @@ wxString wxMenuBar::GetHelpString (int Id) const for (i = 0; i < m_menuCount; i++) { if (m_menus[i]->FindItemForId (Id)) - eturn wxString(m_menus[i]->GetHelpString (Id)); + return wxString(m_menus[i]->GetHelpString (Id)); } return wxString(""); } diff --git a/src/stubs/metafile.cpp b/src/stubs/metafile.cpp index 67850103ee..251c855970 100644 --- a/src/stubs/metafile.cpp +++ b/src/stubs/metafile.cpp @@ -13,7 +13,10 @@ #pragma implementation "metafile.h" #endif -#include "wx/metafile.h" +#include "wx/object.h" +#include "wx/string.h" +#include "wx/dc.h" +#include "wx/stubs/metafile.h" #include "wx/clipbrd.h" extern bool wxClipboardIsOpen; diff --git a/src/stubs/msgdlg.cpp b/src/stubs/msgdlg.cpp index 775ac8f064..aeaa9bac7a 100644 --- a/src/stubs/msgdlg.cpp +++ b/src/stubs/msgdlg.cpp @@ -13,7 +13,7 @@ #pragma implementation "msgdlg.h" #endif -#include "wx/msgdlg.h" +#include "wx/stubs/msgdlg.h" #if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxMessageDialog, wxDialog) diff --git a/src/stubs/notebook.cpp b/src/stubs/notebook.cpp index aecb879f4b..cd85a27ad7 100644 --- a/src/stubs/notebook.cpp +++ b/src/stubs/notebook.cpp @@ -97,10 +97,6 @@ bool wxNotebook::Create(wxWindow *parent, m_windowId = id == -1 ? NewControlId() : id; - // colors and font - m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE)); - m_foregroundColour = *wxBLACK ; - // style m_windowStyle = style; @@ -278,7 +274,7 @@ void wxNotebook::OnSize(wxSizeEvent& event) SetSelection(nSel); // fit the notebook page to the tab control's display area - int w, hl + int w, h; GetSize(&w, &h); uint nCount = m_aPages.Count(); diff --git a/src/stubs/palette.cpp b/src/stubs/palette.cpp index 445b545f0c..f8db96f8d0 100644 --- a/src/stubs/palette.cpp +++ b/src/stubs/palette.cpp @@ -47,15 +47,6 @@ wxPalette::~wxPalette() { } -bool wxPalette::FreeResource(bool force) -{ - if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) - { - DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); - } - return TRUE; -} - bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { UnRef(); diff --git a/src/stubs/print.cpp b/src/stubs/print.cpp index 2aba87f3d4..1939136855 100644 --- a/src/stubs/print.cpp +++ b/src/stubs/print.cpp @@ -13,11 +13,12 @@ #pragma implementation "print.h" #endif -#include "wx/print.h" +#include "wx/stubs/print.h" +#include "wx/stubs/printdlg.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase) -IMPLEMENT_CLASS(wxWindowsPrintPreview, wxPrintPreviewBase) +IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase) #endif /* @@ -56,17 +57,17 @@ bool wxPrinter::Setup(wxWindow *parent) * Print preview */ -wxWindowsPrintPreview::wxWindowsPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): +wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): wxPrintPreviewBase(printout, printoutForPrinting, data) { DetermineScaling(); } -wxWindowsPrintPreview::~wxWindowsPrintPreview() +wxPrintPreview::~wxPrintPreview() { } -bool wxWindowsPrintPreview::Print(bool interactive) +bool wxPrintPreview::Print(bool interactive) { if (!printPrintout) return FALSE; @@ -74,7 +75,7 @@ bool wxWindowsPrintPreview::Print(bool interactive) return printer.Print(previewFrame, printPrintout, interactive); } -void wxWindowsPrintPreview::DetermineScaling() +void wxPrintPreview::DetermineScaling() { // TODO } diff --git a/src/stubs/printdlg.cpp b/src/stubs/printdlg.cpp index 4a78ae47e0..eae3b95568 100644 --- a/src/stubs/printdlg.cpp +++ b/src/stubs/printdlg.cpp @@ -13,7 +13,8 @@ #pragma implementation "printdlg.h" #endif -#include "wx/printdlg.h" +#include "wx/object.h" +#include "wx/stubs/printdlg.h" #include "wx/dcprint.h" // Use generic page setup dialog: use your own native one if one exists. @@ -27,12 +28,8 @@ IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog) wxPrintDialog::wxPrintDialog(): wxDialog() { - dialogParent = NULL; - printerDC = NULL; - destroyDC = TRUE; - deviceName = NULL; - driverName = NULL; - portName = NULL; + m_dialogParent = NULL; + m_printerDC = NULL; } wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data): @@ -43,26 +40,19 @@ wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data): bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data) { - dialogParent = p; - printerDC = NULL; - destroyDC = TRUE; - deviceName = NULL; - driverName = NULL; - portName = NULL; + m_dialogParent = p; + m_printerDC = NULL; if ( data ) - printData = *data; + m_printData = *data; return TRUE; } wxPrintDialog::~wxPrintDialog() { - if (destroyDC && printerDC) - delete printerDC; - if (deviceName) delete[] deviceName; - if (driverName) delete[] driverName; - if (portName) delete[] portName; + if (m_printerDC) + delete m_printerDC; } int wxPrintDialog::ShowModal() @@ -73,10 +63,11 @@ int wxPrintDialog::ShowModal() wxDC *wxPrintDialog::GetPrintDC() { - if (printerDC) + if (m_printerDC) { - destroyDC = FALSE; - return printerDC; + wxDC* dc = m_printerDC; + m_printerDC = NULL; + return dc; } else return NULL; diff --git a/src/stubs/region.cpp b/src/stubs/region.cpp index d03d8e8020..c71d4c605a 100644 --- a/src/stubs/region.cpp +++ b/src/stubs/region.cpp @@ -12,17 +12,9 @@ #pragma implementation "region.h" #endif -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#include "wx/msw/region.h" +#include "wx/region.h" #include "wx/gdicmn.h" -#include - #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) @@ -47,8 +39,6 @@ public: { // TODO } - - HRGN m_region; }; diff --git a/src/stubs/scrolbar.cpp b/src/stubs/scrolbar.cpp index 0058a14f53..307cdefc13 100644 --- a/src/stubs/scrolbar.cpp +++ b/src/stubs/scrolbar.cpp @@ -72,7 +72,7 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS void wxScrollBar::Command(wxCommandEvent& event) { - SetValue(event.m_commandInt); + SetPosition(event.m_commandInt); ProcessCommand(event); } diff --git a/src/stubs/settings.cpp b/src/stubs/settings.cpp index 0450dbc8e4..d831092aa4 100644 --- a/src/stubs/settings.cpp +++ b/src/stubs/settings.cpp @@ -18,13 +18,13 @@ wxColour wxSystemSettings::GetSystemColour(int index) { // TODO - return col; + return wxColour(); } wxFont wxSystemSettings::GetSystemFont(int index) { // TODO - return wxFont; + return wxFont(); } // Get a system metric, e.g. scrollbar size diff --git a/src/stubs/slider.cpp b/src/stubs/slider.cpp index 97c453b989..0be5a60de7 100644 --- a/src/stubs/slider.cpp +++ b/src/stubs/slider.cpp @@ -13,7 +13,7 @@ #pragma implementation "slider.h" #endif -#include "wx/msw/slider.h" +#include "wx/slider.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) diff --git a/src/stubs/stattext.cpp b/src/stubs/stattext.cpp index 1958826916..a1275b8bdc 100644 --- a/src/stubs/stattext.cpp +++ b/src/stubs/stattext.cpp @@ -13,19 +13,9 @@ #pragma implementation "stattext.h" #endif -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP #include "wx/app.h" -#endif - #include "wx/stattext.h" -#include "wx/msw/private.h" + #include #if !USE_SHARED_LIBRARY @@ -50,162 +40,21 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, else m_windowId = id; - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - m_windowStyle = style; - long msStyle = WS_CHILD|WS_VISIBLE; - if (m_windowStyle & wxALIGN_CENTRE) - msStyle |= SS_CENTER; - else if (m_windowStyle & wxALIGN_RIGHT) - msStyle |= SS_RIGHT; - else - msStyle |= SS_LEFT; - - // Even with extended styles, need to combine with WS_BORDER - // for them to look right. - if ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) || - (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER)) - msStyle |= WS_BORDER; - - HWND static_item = CreateWindowEx(MakeExtendedStyle(m_windowStyle), "STATIC", (const char *)label, - msStyle, - 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, - wxGetInstance(), NULL); - -#if CTL3D -/* - if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS)) - Ctl3dSubclassCtl(static_item); -*/ -#endif - - m_hWnd = (WXHWND)static_item; - - SubclassWin((WXHWND)static_item); - SetFont(* parent->GetFont()); - SetSize(x, y, width, height); - return TRUE; + + // TODO + return FALSE; } void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) { - int currentX, currentY; - GetPosition(¤tX, ¤tY); - int x1 = x; - int y1 = y; - - if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - x1 = currentX; - if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - y1 = currentY; - - AdjustForParentClientOrigin(x1, y1, sizeFlags); - - int actualWidth = width; - int actualHeight = height; - - char buf[300]; - int current_width; - int cyf; - - ::GetWindowText((HWND) GetHWND(), buf, 300); - GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont()); - - int ww, hh; - GetSize(&ww, &hh); - - // If we're prepared to use the existing width, then... - if (width == -1 && ((sizeFlags & wxSIZE_AUTO_WIDTH) != wxSIZE_AUTO_WIDTH)) - actualWidth = ww; - else if (width == -1) - { - int cx; - int cy; - wxGetCharSize(GetHWND(), &cx, &cy,GetFont()); - actualWidth = (int)(current_width + cx) ; - } - - // If we're prepared to use the existing height, then... - if (height == -1 && ((sizeFlags & wxSIZE_AUTO_HEIGHT) != wxSIZE_AUTO_HEIGHT)) - actualHeight = hh; - else if (height == -1) - { - actualHeight = (int)(cyf) ; - } - - MoveWindow((HWND) GetHWND(), x1, y1, actualWidth, actualHeight, TRUE); + // TODO } void wxStaticText::SetLabel(const wxString& label) { - int w, h; - RECT rect; - - wxWindow *parent = GetParent(); - GetWindowRect((HWND) GetHWND(), &rect); - - // Since we now have the absolute screen coords, - // if there's a parent we must subtract its top left corner - POINT point; - point.x = rect.left; - point.y = rect.top; - if (parent) - { - ::ScreenToClient((HWND) parent->GetHWND(), &point); - } - - GetTextExtent(label, &w, &h, NULL, NULL, GetFont()); - MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h, - TRUE); - SetWindowText((HWND) GetHWND(), (const char *)label); + // TODO } -WXHBRUSH wxStaticText::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam) -{ -/* -#if CTL3D - if ( m_useCtl3D ) - { - HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam); - - if (hbrush != (HBRUSH) 0) - return hbrush; - else - return (HBRUSH)MSWDefWindowProc(message, wParam, lParam); - } -#endif -*/ - - if (GetParent()->GetTransparentBackground()) - SetBkMode((HDC) pDC, TRANSPARENT); - else - SetBkMode((HDC) pDC, OPAQUE); - - ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue())); - ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue())); - - wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID); - - // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush - // has a zero usage count. -// backgroundBrush->RealizeResource(); - return (WXHBRUSH) backgroundBrush->GetResourceHandle(); -} - -long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - // Ensure that static items get messages. Some controls don't like this - // message to be intercepted (e.g. RichEdit), hence the tests. - if (nMsg == WM_NCHITTEST) - return (long)HTCLIENT; - - return wxWindow::MSWWindowProc(nMsg, wParam, lParam); -} - - diff --git a/src/stubs/statusbr.cpp b/src/stubs/statusbr.cpp index 59fd64d927..dff1ddec34 100644 --- a/src/stubs/statusbr.cpp +++ b/src/stubs/statusbr.cpp @@ -59,21 +59,6 @@ bool wxStatusBarXX::Create(wxWindow *parent, wxWindowID id, long style) return FALSE; } -void wxStatusBarXX::CopyFieldsWidth(const int widths[]) -{ - if (widths && !m_statusWidths) - m_statusWidths = new int[m_nFields]; - - if ( widths != NULL ) { - for ( int i = 0; i < m_nFields; i++ ) - m_statusWidths[i] = widths[i]; - } - else { - delete [] m_statusWidths; - m_statusWidths = NULL; - } -} - void wxStatusBarXX::SetFieldsCount(int nFields, const int widths[]) { wxASSERT( (nFields > 0) && (nFields < 255) ); @@ -92,6 +77,21 @@ void wxStatusBarXX::SetStatusWidths(int n, const int widths[]) SetFieldsWidth(); } +void wxStatusBarXX::CopyFieldsWidth(const int widths[]) +{ + if (widths && !m_statusWidths) + m_statusWidths = new int[m_nFields]; + + if ( widths != NULL ) { + for ( int i = 0; i < m_nFields; i++ ) + m_statusWidths[i] = widths[i]; + } + else { + delete [] m_statusWidths; + m_statusWidths = NULL; + } +} + void wxStatusBarXX::SetFieldsWidth() { int *pWidths = new int[m_nFields]; diff --git a/src/stubs/tabctrl.cpp b/src/stubs/tabctrl.cpp index 3a84d4d668..b3b45a72d1 100644 --- a/src/stubs/tabctrl.cpp +++ b/src/stubs/tabctrl.cpp @@ -13,17 +13,13 @@ #pragma implementation "tabctrl.h" #endif +#include "wx/control.h" #include "wx/tabctrl.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) - EVT_SIZE(wxTabCtrl::OnSize) - EVT_PAINT(wxTabCtrl::OnPaint) - EVT_KILL_FOCUS(wxTabCtrl::OnKillFocus) - EVT_MOUSE_EVENTS(wxTabCtrl::OnMouseEvent) - EVT_SYS_COLOUR_CHANGED(wxTabCtrl::OnSysColourChanged) END_EVENT_TABLE() #endif diff --git a/src/stubs/textctrl.cpp b/src/stubs/textctrl.cpp index fb522df053..f4fbdd3bbb 100644 --- a/src/stubs/textctrl.cpp +++ b/src/stubs/textctrl.cpp @@ -19,6 +19,8 @@ #include "wx/textctrl.h" #include "wx/settings.h" +#include "wx/filefn.h" +#include "wx/utils.h" #if defined(__BORLANDC__) && !defined(__WIN32__) #include @@ -132,7 +134,6 @@ long wxTextCtrl::GetLastPosition() const void wxTextCtrl::Replace(long from, long to, const wxString& value) { // TODO - return 0; } void wxTextCtrl::Remove(long from, long to) diff --git a/src/stubs/thread.cpp b/src/stubs/thread.cpp index 9a03aae3cd..36e710b5b2 100644 --- a/src/stubs/thread.cpp +++ b/src/stubs/thread.cpp @@ -15,6 +15,7 @@ #include "wx/module.h" #include "wx/thread.h" +#include "wx/utils.h" enum thread_state { STATE_IDLE = 0, @@ -183,6 +184,7 @@ unsigned long wxThread::GetID() const bool wxThread::IsMain() { // TODO + return FALSE; } wxThread::wxThread() diff --git a/src/stubs/timer.cpp b/src/stubs/timer.cpp index f976056c77..5262040cf6 100644 --- a/src/stubs/timer.cpp +++ b/src/stubs/timer.cpp @@ -22,7 +22,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) wxTimer::wxTimer() { m_milli = 0 ; - m_lastMilli = -1 ; m_id = 0; m_oneShot = FALSE; } @@ -35,13 +34,10 @@ wxTimer::~wxTimer() bool wxTimer::Start(int milliseconds,bool mode) { m_oneShot = mode ; - if (m_milliseconds < 0) - m_milliseconds = lastMilli; - - if (m_milliseconds <= 0) + if (milliseconds <= 0) return FALSE; - m_lastMilli = m_milli = m_milliseconds; + m_milli = milliseconds; // TODO: set the timer going. return FALSE; diff --git a/src/stubs/toolbar.cpp b/src/stubs/toolbar.cpp index 61f34c8283..ab0ace8901 100644 --- a/src/stubs/toolbar.cpp +++ b/src/stubs/toolbar.cpp @@ -13,17 +13,7 @@ #pragma implementation "toolbar.h" #endif -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx.h" -#endif - +#include "wx/wx.h" #include "wx/toolbar.h" #if !USE_SHARED_LIBRARY @@ -105,7 +95,6 @@ void wxToolBar::EnableTool(int toolIndex, bool enable) tool->m_enabled = enable; // TODO enable button } - } } void wxToolBar::ToggleTool(int toolIndex, bool toggle) diff --git a/src/stubs/treectrl.cpp b/src/stubs/treectrl.cpp index 0b405a7106..5f346b38bc 100644 --- a/src/stubs/treectrl.cpp +++ b/src/stubs/treectrl.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: treectrl.cpp -// Purpose: wxTreeCtrl +// Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl. // Author: AUTHOR // Modified by: // Created: ??/??/98 @@ -13,7 +13,8 @@ #pragma implementation "treectrl.h" #endif -#include "wx/treectrl.h" +#include "wx/stubs/textctrl.h" +#include "wx/stubs/treectrl.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) @@ -281,11 +282,9 @@ bool wxTreeCtrl::ExpandItem(long item, int action) break; case wxTREE_EXPAND_COLLAPSE_RESET: - mswAction = TVE_COLLAPSERESET; break; case wxTREE_EXPAND_TOGGLE: - mswAction = TVE_TOGGLE; break; default: diff --git a/src/stubs/wave.cpp b/src/stubs/wave.cpp index e908428ce4..eb3a2603ad 100644 --- a/src/stubs/wave.cpp +++ b/src/stubs/wave.cpp @@ -13,6 +13,8 @@ #pragma implementation "wave.h" #endif +#include "wx/object.h" +#include "wx/string.h" #include "wx/stubs/wave.h" wxWave::wxWave() diff --git a/src/stubs/window.cpp b/src/stubs/window.cpp index 341ad00e51..22f44f8b8d 100644 --- a/src/stubs/window.cpp +++ b/src/stubs/window.cpp @@ -26,6 +26,7 @@ #include "wx/button.h" #include "wx/settings.h" #include "wx/msgdlg.h" +#include "wx/frame.h" #include "wx/menuitem.h" #include "wx/log.h" @@ -254,13 +255,14 @@ wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler) void wxWindow::SetDropTarget(wxDropTarget *pDropTarget) { if ( m_pDropTarget != 0 ) { - m_pDropTarget->Revoke(m_hWnd); delete m_pDropTarget; } m_pDropTarget = pDropTarget; if ( m_pDropTarget != 0 ) - m_pDropTarget->Register(m_hWnd); + { + // TODO + } } #endif @@ -523,7 +525,7 @@ int wxWindow::GetScrollThumb(int orient) const void wxWindow::SetScrollPos(int orient, int pos, bool refresh) { // TODO - return 0; + return; } // New function that will replace some of the above. @@ -537,7 +539,7 @@ void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible, void wxWindow::ScrollWindow(int dx, int dy, const wxRectangle *rect) { // TODO - return 0; + return; } void wxWindow::SetFont(const wxFont& font) @@ -685,17 +687,6 @@ void wxWindow::MakeModal(bool modal) } } -// If nothing defined for this, try the parent. -// E.g. we may be a button loaded from a resource, with no callback function -// defined. -void wxWindow::OnCommand(wxWindow& win, wxCommandEvent& event) -{ - if (GetEventHandler()->ProcessEvent(event) ) - return; - if (m_windowParent) - m_windowParent->GetEventHandler()->OnCommand(win, event); -} - void wxWindow::SetConstraints(wxLayoutConstraints *c) { if (m_constraints) @@ -1278,4 +1269,15 @@ bool wxWindow::IsExposed(const wxRect& rect) const return (m_updateRegion.Contains(rect) != wxOutRegion); } +/* + * Allocates control IDs + */ + +int wxWindow::NewControlId() +{ + static int s_controlId = 0; + s_controlId ++; + return s_controlId; +} + diff --git a/utils/ogl/samples/ogledit/ogledit.cpp b/utils/ogl/samples/ogledit/ogledit.cpp index cc18d2d2c1..ee31750c2b 100644 --- a/utils/ogl/samples/ogledit/ogledit.cpp +++ b/utils/ogl/samples/ogledit/ogledit.cpp @@ -37,9 +37,6 @@ // in the application itself. IMPLEMENT_APP(MyApp) -// This statement initialises the whole application -MyApp myApp; - MyApp::MyApp(void) { frame = NULL; @@ -116,7 +113,7 @@ bool MyApp::OnInit(void) menu_bar->Append(help_menu, "&Help"); frame->canvas = frame->CreateCanvas(NULL, frame); - frame->palette = myApp.CreatePalette(frame); + frame->palette = wxGetApp().CreatePalette(frame); myDocManager->CreateDocument("", wxDOC_NEW); //// Associate the menu bar with the frame @@ -206,6 +203,6 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent) MyFrame *GetMainFrame(void) { - return myApp.frame; + return wxGetApp().frame; } diff --git a/utils/ogl/src/basic.cpp b/utils/ogl/src/basic.cpp index 8179c09499..8919f9b08d 100644 --- a/utils/ogl/src/basic.cpp +++ b/utils/ogl/src/basic.cpp @@ -860,8 +860,8 @@ void wxShape::FindRegionNames(wxStringList& list) void wxShape::AssignNewIds() { - if (m_id == 0) - m_id = NewId(); +// if (m_id == 0) + m_id = NewId(); wxNode *node = m_children.First(); while (node) { @@ -1535,7 +1535,13 @@ void wxShape::WritePrologAttributes(wxExpr *clause) clause->AddAttributeValue("pen_style", (long)penStyle); wxString penColour = wxTheColourDatabase->FindName(m_pen->GetColour()); - if ((penColour != "") && (penColour != "BLACK")) + if (penColour == "") + { + wxString hex(oglColourToHex(m_pen->GetColour())); + hex = wxString("#") + hex; + clause->AddAttributeValueString("pen_colour", hex); + } + else if (penColour != "BLACK") clause->AddAttributeValueString("pen_colour", penColour); } @@ -1543,7 +1549,13 @@ void wxShape::WritePrologAttributes(wxExpr *clause) { wxString brushColour = wxTheColourDatabase->FindName(m_brush->GetColour()); - if ((brushColour != "") && (brushColour != "WHITE")) + if (brushColour == "") + { + wxString hex(oglColourToHex(m_brush->GetColour())); + hex = wxString("#") + hex; + clause->AddAttributeValueString("brush_colour", hex); + } + else if (brushColour != "WHITE") clause->AddAttributeValueString("brush_colour", brushColour); if (m_brush->GetStyle() != wxSOLID) @@ -1795,11 +1807,25 @@ void wxShape::ReadPrologAttributes(wxExpr *clause) if (brush_string == "") brush_string = "WHITE"; - m_pen = wxThePenList->FindOrCreatePen(pen_string, pen_width, pen_style); + if (pen_string[0] == '#') + { + wxColour col(oglHexToColour(pen_string.After('#'))); + m_pen = wxThePenList->FindOrCreatePen(col, pen_width, pen_style); + } + else + m_pen = wxThePenList->FindOrCreatePen(pen_string, pen_width, pen_style); + if (!m_pen) m_pen = wxBLACK_PEN; - m_brush = wxTheBrushList->FindOrCreateBrush(brush_string, brush_style); + if (brush_string[0] == '#') + { + wxColour col(oglHexToColour(brush_string.After('#'))); + m_brush = wxTheBrushList->FindOrCreateBrush(col, brush_style); + } + else + m_brush = wxTheBrushList->FindOrCreateBrush(brush_string, brush_style); + if (!m_brush) m_brush = wxWHITE_BRUSH; diff --git a/utils/ogl/src/basic.h b/utils/ogl/src/basic.h index dfca643087..ea72170a5b 100644 --- a/utils/ogl/src/basic.h +++ b/utils/ogl/src/basic.h @@ -555,6 +555,8 @@ class wxRectangleShape: public wxShape inline float GetWidth() const { return m_width; } inline float GetHeight() const { return m_height; } + inline void SetWidth(float w) { m_width = w; } + inline void SetHeight(float h) { m_height = h; } protected: float m_width; diff --git a/utils/ogl/src/basic2.cpp b/utils/ogl/src/basic2.cpp index 26a048b28d..98f65933f0 100644 --- a/utils/ogl/src/basic2.cpp +++ b/utils/ogl/src/basic2.cpp @@ -532,15 +532,18 @@ void wxPolygonShape::OnDraw(wxDC& dc) void wxPolygonShape::OnDrawOutline(wxDC& dc, float x, float y, float w, float h) { dc.SetBrush(wxTRANSPARENT_BRUSH); + // Multiply all points by proportion of new size to old size + float x_proportion = (float)(fabs(w/m_originalWidth)); + float y_proportion = (float)(fabs(h/m_originalHeight)); - int n = m_points->Number(); + int n = m_originalPoints->Number(); wxPoint *intPoints = new wxPoint[n]; int i; for (i = 0; i < n; i++) { - wxRealPoint* point = (wxRealPoint*) m_points->Nth(i)->Data(); - intPoints[i].x = (int) point->x; - intPoints[i].y = (int) point->y; + wxRealPoint* point = (wxRealPoint*) m_originalPoints->Nth(i)->Data(); + intPoints[i].x = (int) (x_proportion * point->x); + intPoints[i].y = (int) (y_proportion * point->y); } dc.DrawPolygon(n, intPoints, x, y); delete[] intPoints; @@ -1699,6 +1702,21 @@ wxPolygonControlPoint::~wxPolygonControlPoint() { } +// Calculate what new size would be, at end of resize +void wxPolygonControlPoint::CalculateNewSize(float x, float y) +{ + float bound_x; + float bound_y; + GetShape()->GetBoundingBoxMin(&bound_x, &bound_y); + + float dist = (float)sqrt((x - m_shape->GetX())*(x - m_shape->GetX()) + + (y - m_shape->GetY())*(y - m_shape->GetY())); + + m_newSize.x = (float)(dist/this->m_originalDistance)*this->m_originalSize.x; + m_newSize.y = (float)(dist/this->m_originalDistance)*this->m_originalSize.y; +} + + // Implement resizing polygon or moving the vertex. void wxPolygonControlPoint::OnDragLeft(bool draw, float x, float y, int keys, int attachment) { @@ -1730,18 +1748,11 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, float x, fl dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); - float bound_x; - float bound_y; - this->GetBoundingBoxMin(&bound_x, &bound_y); -/* - float new_width = (float)(2.0*fabs(x - this->GetX())); - float new_height = (float)(2.0*fabs(y - this->GetY())); -*/ - float dist = (float)sqrt((x - this->GetX())*(x - this->GetX()) + - (y - this->GetY())*(y - this->GetY())); - - if (keys & KEY_CTRL) + if (0) // keys & KEY_CTRL) { + // TODO: mend this code. Currently we rely on altering the + // actual points, but we should assume we're not, as per + // the normal sizing case. m_canvas->Snap(&x, &y); // Move point @@ -1754,15 +1765,11 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, float x, fl } else { - float new_width = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.x; - float new_height = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.y; - - // Non-recursive SetSize for speed - this->SetSize(new_width, new_height, FALSE); + ppt->CalculateNewSize(x, y); } - float w, h; - this->GetBoundingBoxMax(&w, &h); - this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), w, h); + + this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), + ppt->GetNewSize().x, ppt->GetNewSize().y); } void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, float x, float y, int keys, int attachment) @@ -1782,7 +1789,6 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, float x, float y, float dist = (float)sqrt((x - this->GetX())*(x - this->GetX()) + (y - this->GetY())*(y - this->GetY())); - ppt->m_originalDistance = dist; ppt->m_originalSize.x = bound_x; ppt->m_originalSize.y = bound_y; @@ -1793,8 +1799,11 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, float x, float y, dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); - if (keys & KEY_CTRL) + if (0) // keys & KEY_CTRL) { + // TODO: mend this code. Currently we rely on altering the + // actual points, but we should assume we're not, as per + // the normal sizing case. m_canvas->Snap(&x, &y); // Move point @@ -1807,22 +1816,19 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, float x, float y, } else { - float new_width = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.x; - float new_height = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.y; - - // Non-recursive SetSize for speed - this->SetSize(new_width, new_height, FALSE); + ppt->CalculateNewSize(x, y); } - float w, h; - this->GetBoundingBoxMax(&w, &h); - this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), w, h); + this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), + ppt->GetNewSize().x, ppt->GetNewSize().y); m_canvas->CaptureMouse(); } void wxPolygonShape::OnSizingEndDragLeft(wxControlPoint* pt, float x, float y, int keys, int attachment) { + wxPolygonControlPoint* ppt = (wxPolygonControlPoint*) pt; + wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -1835,6 +1841,10 @@ void wxPolygonShape::OnSizingEndDragLeft(wxControlPoint* pt, float x, float y, i ((wxPolygonShape *)this)->CalculateBoundingBox(); ((wxPolygonShape *)this)->UpdateOriginalPoints(); } + else + { + SetSize(ppt->GetNewSize().x, ppt->GetNewSize().y); + } ((wxPolygonShape *)this)->CalculateBoundingBox(); ((wxPolygonShape *)this)->CalculatePolygonCentre(); diff --git a/utils/ogl/src/basicp.h b/utils/ogl/src/basicp.h index 2c04e63bf6..e664922830 100644 --- a/utils/ogl/src/basicp.h +++ b/utils/ogl/src/basicp.h @@ -102,10 +102,17 @@ class wxPolygonControlPoint: public wxControlPoint void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0); void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0); + // Calculate what new size would be, at end of resize + virtual void CalculateNewSize(float x, float y); + + // Get new size + inline wxRealPoint GetNewSize() const { return m_newSize; }; + public: wxRealPoint* m_polygonVertex; wxRealPoint m_originalSize; float m_originalDistance; + wxRealPoint m_newSize; }; /* diff --git a/utils/ogl/src/drawn.cpp b/utils/ogl/src/drawn.cpp index b9a6cb8102..12569f7553 100644 --- a/utils/ogl/src/drawn.cpp +++ b/utils/ogl/src/drawn.cpp @@ -49,7 +49,7 @@ extern char *GraphicsBuffer; * */ -IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxShape) +IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxRectangleShape) wxDrawnShape::wxDrawnShape():wxRectangleShape(100.0, 50.0) { @@ -99,11 +99,13 @@ void wxDrawnShape::SetSize(float w, float h, bool recursive) void wxDrawnShape::Scale(float sx, float sy) { m_metafile.Scale(sx, sy); + m_metafile.CalculateSize(this); } void wxDrawnShape::Translate(float x, float y) { m_metafile.Translate(x, y); + m_metafile.CalculateSize(this); } void wxDrawnShape::Rotate(float x, float y, float theta) @@ -130,6 +132,8 @@ void wxDrawnShape::Rotate(float x, float y, float theta) node = node->Next(); } m_rotation = theta; + + m_metafile.CalculateSize(this); } #ifdef PROLOGIO @@ -179,6 +183,96 @@ bool wxDrawnShape::LoadFromMetaFile(char *filename) return m_metafile.LoadFromMetaFile(filename, &m_width, &m_height); } +// Set of functions for drawing into a pseudo metafile. +// They use integers, but doubles are used internally for accuracy +// when scaling. + +void wxDrawnShape::DrawLine(const wxPoint& pt1, const wxPoint& pt2) +{ + m_metafile.DrawLine(pt1, pt2); +} + +void wxDrawnShape::DrawRectangle(const wxRect& rect) +{ + m_metafile.DrawRectangle(rect); +} + +void wxDrawnShape::DrawRoundedRectangle(const wxRect& rect, double radius) +{ + m_metafile.DrawRoundedRectangle(rect, radius); +} + +void wxDrawnShape::DrawEllipse(const wxRect& rect) +{ + m_metafile.DrawEllipse(rect); +} + +void wxDrawnShape::DrawPoint(const wxPoint& pt) +{ + m_metafile.DrawPoint(pt); +} + +void wxDrawnShape::DrawText(const wxString& text, const wxPoint& pt) +{ + m_metafile.DrawText(text, pt); +} + +void wxDrawnShape::DrawLines(int n, wxPoint pts[]) +{ + m_metafile.DrawLines(n, pts); +} + +void wxDrawnShape::DrawPolygon(int n, wxPoint pts[]) +{ + m_metafile.DrawPolygon(n, pts); +} + +void wxDrawnShape::DrawSpline(int n, wxPoint pts[]) +{ + m_metafile.DrawSpline(n, pts); +} + +void wxDrawnShape::SetClippingRect(const wxRect& rect) +{ + m_metafile.SetClippingRect(rect); +} + +void wxDrawnShape::DestroyClippingRect() +{ + m_metafile.DestroyClippingRect(); +} + +void wxDrawnShape::SetPen(wxPen* pen, bool isOutline) +{ + m_metafile.SetPen(pen, isOutline); +} + +void wxDrawnShape::SetBrush(wxBrush* brush, bool isFill) +{ + m_metafile.SetBrush(brush, isFill); +} + +void wxDrawnShape::SetFont(wxFont* font) +{ + m_metafile.SetFont(font); +} + +void wxDrawnShape::SetTextColour(const wxColour& colour) +{ + m_metafile.SetTextColour(colour); +} + +void wxDrawnShape::SetBackgroundColour(const wxColour& colour) +{ + m_metafile.SetBackgroundColour(colour); +} + +void wxDrawnShape::SetBackgroundMode(int mode) +{ + m_metafile.SetBackgroundMode(mode); +} + + /* * Individual operations * @@ -192,27 +286,27 @@ bool wxDrawnShape::LoadFromMetaFile(char *filename) wxOpSetGDI::wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode): wxDrawOp(theOp) { - gdiIndex = theGdiIndex; - image = theImage; - mode = theMode; + m_gdiIndex = theGdiIndex; + m_image = theImage; + m_mode = theMode; } void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset) { - switch (op) + switch (m_op) { case DRAWOP_SET_PEN: { // Check for overriding this operation for outline // colour - if (image->m_outlineColours.Member((wxObject *)gdiIndex)) + if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex)) { - if (image->m_outlinePen) - dc.SetPen(image->m_outlinePen); + if (m_image->m_outlinePen) + dc.SetPen(m_image->m_outlinePen); } else { - wxNode *node = image->m_gdiObjects.Nth(gdiIndex); + wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); if (node) { wxPen *pen = (wxPen *)node->Data(); @@ -226,26 +320,26 @@ void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset) { // Check for overriding this operation for outline or fill // colour - if (image->m_outlineColours.Member((wxObject *)gdiIndex)) + if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex)) { // Need to construct a brush to match the outline pen's colour - if (image->m_outlinePen) + if (m_image->m_outlinePen) { - wxBrush *br = wxTheBrushList->FindOrCreateBrush(image->m_outlinePen->GetColour(), wxSOLID); + wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID); if (br) dc.SetBrush(br); } } - else if (image->m_fillColours.Member((wxObject *)gdiIndex)) + else if (m_image->m_fillColours.Member((wxObject *)m_gdiIndex)) { - if (image->m_fillBrush) + if (m_image->m_fillBrush) { - dc.SetBrush(image->m_fillBrush); + dc.SetBrush(m_image->m_fillBrush); } } else { - wxNode *node = image->m_gdiObjects.Nth(gdiIndex); + wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); if (node) { wxBrush *brush = (wxBrush *)node->Data(); @@ -257,7 +351,7 @@ void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset) } case DRAWOP_SET_FONT: { - wxNode *node = image->m_gdiObjects.Nth(gdiIndex); + wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); if (node) { wxFont *font = (wxFont *)node->Data(); @@ -268,19 +362,19 @@ void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset) } case DRAWOP_SET_TEXT_COLOUR: { - wxColour col(r,g,b); + wxColour col(m_r,m_g,m_b); dc.SetTextForeground(col); break; } case DRAWOP_SET_BK_COLOUR: { - wxColour col(r,g,b); + wxColour col(m_r,m_g,m_b); dc.SetTextBackground(col); break; } case DRAWOP_SET_BK_MODE: { - dc.SetBackgroundMode(mode); + dc.SetBackgroundMode(m_mode); break; } default: @@ -290,37 +384,37 @@ void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset) wxDrawOp *wxOpSetGDI::Copy(wxPseudoMetaFile *newImage) { - wxOpSetGDI *newOp = new wxOpSetGDI(op, newImage, gdiIndex, mode); - newOp->r = r; - newOp->g = g; - newOp->b = b; + wxOpSetGDI *newOp = new wxOpSetGDI(m_op, newImage, m_gdiIndex, m_mode); + newOp->m_r = m_r; + newOp->m_g = m_g; + newOp->m_b = m_b; return newOp; } -wxExpr *wxOpSetGDI::WritewxExpr(wxPseudoMetaFile *image) +wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image) { wxExpr *expr = new wxExpr(PrologList); - expr->Append(new wxExpr((long)op)); - switch (op) + expr->Append(new wxExpr((long)m_op)); + switch (m_op) { case DRAWOP_SET_PEN: case DRAWOP_SET_BRUSH: case DRAWOP_SET_FONT: { - expr->Append(new wxExpr((long)gdiIndex)); + expr->Append(new wxExpr((long)m_gdiIndex)); break; } case DRAWOP_SET_TEXT_COLOUR: case DRAWOP_SET_BK_COLOUR: { - expr->Append(new wxExpr((long)r)); - expr->Append(new wxExpr((long)g)); - expr->Append(new wxExpr((long)b)); + expr->Append(new wxExpr((long)m_r)); + expr->Append(new wxExpr((long)m_g)); + expr->Append(new wxExpr((long)m_b)); break; } case DRAWOP_SET_BK_MODE: { - expr->Append(new wxExpr((long)mode)); + expr->Append(new wxExpr((long)m_mode)); break; } default: @@ -329,28 +423,28 @@ wxExpr *wxOpSetGDI::WritewxExpr(wxPseudoMetaFile *image) return expr; } -void wxOpSetGDI::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { - switch (op) + switch (m_op) { case DRAWOP_SET_PEN: case DRAWOP_SET_BRUSH: case DRAWOP_SET_FONT: { - gdiIndex = (int)expr->Nth(1)->IntegerValue(); + m_gdiIndex = (int)expr->Nth(1)->IntegerValue(); break; } case DRAWOP_SET_TEXT_COLOUR: case DRAWOP_SET_BK_COLOUR: { - r = (unsigned char)expr->Nth(1)->IntegerValue(); - g = (unsigned char)expr->Nth(2)->IntegerValue(); - b = (unsigned char)expr->Nth(3)->IntegerValue(); + m_r = (unsigned char)expr->Nth(1)->IntegerValue(); + m_g = (unsigned char)expr->Nth(2)->IntegerValue(); + m_b = (unsigned char)expr->Nth(3)->IntegerValue(); break; } case DRAWOP_SET_BK_MODE: { - mode = (int)expr->Nth(1)->IntegerValue(); + m_mode = (int)expr->Nth(1)->IntegerValue(); break; } default: @@ -366,25 +460,25 @@ void wxOpSetGDI::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) wxOpSetClipping::wxOpSetClipping(int theOp, float theX1, float theY1, float theX2, float theY2):wxDrawOp(theOp) { - x1 = theX1; - y1 = theY1; - x2 = theX2; - y2 = theY2; + m_x1 = theX1; + m_y1 = theY1; + m_x2 = theX2; + m_y2 = theY2; } wxDrawOp *wxOpSetClipping::Copy(wxPseudoMetaFile *newImage) { - wxOpSetClipping *newOp = new wxOpSetClipping(op, x1, y1, x2, y2); + wxOpSetClipping *newOp = new wxOpSetClipping(m_op, m_x1, m_y1, m_x2, m_y2); return newOp; } void wxOpSetClipping::Do(wxDC& dc, float xoffset, float yoffset) { - switch (op) + switch (m_op) { case DRAWOP_SET_CLIPPING_RECT: { - dc.SetClippingRegion(x1 + xoffset, y1 + yoffset, x2 + xoffset, y2 + yoffset); + dc.SetClippingRegion(m_x1 + xoffset, m_y1 + yoffset, m_x2 + xoffset, m_y2 + yoffset); break; } case DRAWOP_DESTROY_CLIPPING_RECT: @@ -399,30 +493,30 @@ void wxOpSetClipping::Do(wxDC& dc, float xoffset, float yoffset) void wxOpSetClipping::Scale(float xScale, float yScale) { - x1 *= xScale; - y1 *= yScale; - x2 *= xScale; - y2 *= yScale; + m_x1 *= xScale; + m_y1 *= yScale; + m_x2 *= xScale; + m_y2 *= yScale; } void wxOpSetClipping::Translate(float x, float y) { - x1 += x; - y1 += y; + m_x1 += x; + m_y1 += y; } -wxExpr *wxOpSetClipping::WritewxExpr(wxPseudoMetaFile *image) +wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image) { wxExpr *expr = new wxExpr(PrologList); - expr->Append(new wxExpr((long)op)); - switch (op) + expr->Append(new wxExpr((long)m_op)); + switch (m_op) { case DRAWOP_SET_CLIPPING_RECT: { - expr->Append(new wxExpr(x1)); - expr->Append(new wxExpr(y1)); - expr->Append(new wxExpr(x2)); - expr->Append(new wxExpr(y2)); + expr->Append(new wxExpr(m_x1)); + expr->Append(new wxExpr(m_y1)); + expr->Append(new wxExpr(m_x2)); + expr->Append(new wxExpr(m_y2)); break; } default: @@ -431,16 +525,16 @@ wxExpr *wxOpSetClipping::WritewxExpr(wxPseudoMetaFile *image) return expr; } -void wxOpSetClipping::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { - switch (op) + switch (m_op) { case DRAWOP_SET_CLIPPING_RECT: { - x1 = expr->Nth(1)->RealValue(); - y1 = expr->Nth(2)->RealValue(); - x2 = expr->Nth(3)->RealValue(); - y2 = expr->Nth(4)->RealValue(); + m_x1 = expr->Nth(1)->RealValue(); + m_y1 = expr->Nth(2)->RealValue(); + m_x2 = expr->Nth(3)->RealValue(); + m_y2 = expr->Nth(4)->RealValue(); break; } default: @@ -456,58 +550,58 @@ void wxOpSetClipping::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) wxOpDraw::wxOpDraw(int theOp, float theX1, float theY1, float theX2, float theY2, float theRadius, char *s):wxDrawOp(theOp) { - x1 = theX1; - y1 = theY1; - x2 = theX2; - y2 = theY2; - radius = theRadius; - if (s) textString = copystring(s); - else textString = NULL; + m_x1 = theX1; + m_y1 = theY1; + m_x2 = theX2; + m_y2 = theY2; + m_radius = theRadius; + if (s) m_textString = copystring(s); + else m_textString = NULL; } wxOpDraw::~wxOpDraw() { - if (textString) delete[] textString; + if (m_textString) delete[] m_textString; } wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *newImage) { - wxOpDraw *newOp = new wxOpDraw(op, x1, y1, x2, y2, radius, textString); + wxOpDraw *newOp = new wxOpDraw(m_op, m_x1, m_y1, m_x2, m_y2, m_radius, m_textString); return newOp; } void wxOpDraw::Do(wxDC& dc, float xoffset, float yoffset) { - switch (op) + switch (m_op) { case DRAWOP_DRAW_LINE: { - dc.DrawLine(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset); + dc.DrawLine(m_x1+xoffset, m_y1+yoffset, m_x2+xoffset, m_y2+yoffset); break; } case DRAWOP_DRAW_RECT: { - dc.DrawRectangle(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset); + dc.DrawRectangle(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2); break; } case DRAWOP_DRAW_ROUNDED_RECT: { - dc.DrawRoundedRectangle(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset, radius); + dc.DrawRoundedRectangle(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2, m_radius); break; } case DRAWOP_DRAW_ELLIPSE: { - dc.DrawEllipse(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset); + dc.DrawEllipse(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2); break; } case DRAWOP_DRAW_POINT: { - dc.DrawPoint(x1+xoffset, y1+yoffset); + dc.DrawPoint(m_x1+xoffset, m_y1+yoffset); break; } case DRAWOP_DRAW_TEXT: { - dc.DrawText(textString, x1+xoffset, y1+yoffset); + dc.DrawText(m_textString, m_x1+xoffset, m_y1+yoffset); break; } default: @@ -517,30 +611,30 @@ void wxOpDraw::Do(wxDC& dc, float xoffset, float yoffset) void wxOpDraw::Scale(float scaleX, float scaleY) { - x1 *= scaleX; - y1 *= scaleY; - x2 *= scaleX; - y2 *= scaleY; - radius *= scaleX; + m_x1 *= scaleX; + m_y1 *= scaleY; + m_x2 *= scaleX; + m_y2 *= scaleY; + m_radius *= scaleX; } void wxOpDraw::Translate(float x, float y) { - x1 += x; - y1 += y; + m_x1 += x; + m_y1 += y; } void wxOpDraw::Rotate(float x, float y, float sinTheta, float cosTheta) { - x1 = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta; - y1 = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta; - - switch (op) + m_x1 = m_x1*cosTheta - m_y1*sinTheta + x*(1 - cosTheta) + y*sinTheta; + m_y1 = m_x1*sinTheta + m_y1*cosTheta + y*(1 - cosTheta) + x*sinTheta; + + switch (m_op) { case DRAWOP_DRAW_LINE: { - x2 = x2*cosTheta - y2*sinTheta + x*(1 - cosTheta) + y*sinTheta; - y2 = x2*sinTheta + y2*cosTheta + y*(1 - cosTheta) + x*sinTheta; + m_x2 = m_x2*cosTheta - m_y2*sinTheta + x*(1 - cosTheta) + y*sinTheta; + m_y2 = m_x2*sinTheta + m_y2*cosTheta + y*(1 - cosTheta) + x*sinTheta; break; } default: @@ -548,42 +642,42 @@ void wxOpDraw::Rotate(float x, float y, float sinTheta, float cosTheta) } } -wxExpr *wxOpDraw::WritewxExpr(wxPseudoMetaFile *image) +wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image) { wxExpr *expr = new wxExpr(PrologList); - expr->Append(new wxExpr((long)op)); - switch (op) + expr->Append(new wxExpr((long)m_op)); + switch (m_op) { case DRAWOP_DRAW_LINE: case DRAWOP_DRAW_RECT: case DRAWOP_DRAW_ELLIPSE: { - expr->Append(new wxExpr(x1)); - expr->Append(new wxExpr(y1)); - expr->Append(new wxExpr(x2)); - expr->Append(new wxExpr(y2)); + expr->Append(new wxExpr(m_x1)); + expr->Append(new wxExpr(m_y1)); + expr->Append(new wxExpr(m_x2)); + expr->Append(new wxExpr(m_y2)); break; } case DRAWOP_DRAW_ROUNDED_RECT: { - expr->Append(new wxExpr(x1)); - expr->Append(new wxExpr(y1)); - expr->Append(new wxExpr(x2)); - expr->Append(new wxExpr(y2)); - expr->Append(new wxExpr(radius)); + expr->Append(new wxExpr(m_x1)); + expr->Append(new wxExpr(m_y1)); + expr->Append(new wxExpr(m_x2)); + expr->Append(new wxExpr(m_y2)); + expr->Append(new wxExpr(m_radius)); break; } case DRAWOP_DRAW_POINT: { - expr->Append(new wxExpr(x1)); - expr->Append(new wxExpr(y1)); + expr->Append(new wxExpr(m_x1)); + expr->Append(new wxExpr(m_y1)); break; } case DRAWOP_DRAW_TEXT: { - expr->Append(new wxExpr(x1)); - expr->Append(new wxExpr(y1)); - expr->Append(new wxExpr(PrologString, textString)); + expr->Append(new wxExpr(m_x1)); + expr->Append(new wxExpr(m_y1)); + expr->Append(new wxExpr(PrologString, m_textString)); break; } case DRAWOP_DRAW_ARC: @@ -595,40 +689,40 @@ wxExpr *wxOpDraw::WritewxExpr(wxPseudoMetaFile *image) return expr; } -void wxOpDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { - switch (op) + switch (m_op) { case DRAWOP_DRAW_LINE: case DRAWOP_DRAW_RECT: case DRAWOP_DRAW_ELLIPSE: { - x1 = expr->Nth(1)->RealValue(); - y1 = expr->Nth(2)->RealValue(); - x2 = expr->Nth(3)->RealValue(); - y2 = expr->Nth(4)->RealValue(); + m_x1 = expr->Nth(1)->RealValue(); + m_y1 = expr->Nth(2)->RealValue(); + m_x2 = expr->Nth(3)->RealValue(); + m_y2 = expr->Nth(4)->RealValue(); break; } case DRAWOP_DRAW_ROUNDED_RECT: { - x1 = expr->Nth(1)->RealValue(); - y1 = expr->Nth(2)->RealValue(); - x2 = expr->Nth(3)->RealValue(); - y2 = expr->Nth(4)->RealValue(); - radius = expr->Nth(5)->RealValue(); + m_x1 = expr->Nth(1)->RealValue(); + m_y1 = expr->Nth(2)->RealValue(); + m_x2 = expr->Nth(3)->RealValue(); + m_y2 = expr->Nth(4)->RealValue(); + m_radius = expr->Nth(5)->RealValue(); break; } case DRAWOP_DRAW_POINT: { - x1 = expr->Nth(1)->RealValue(); - y1 = expr->Nth(2)->RealValue(); + m_x1 = expr->Nth(1)->RealValue(); + m_y1 = expr->Nth(2)->RealValue(); break; } case DRAWOP_DRAW_TEXT: { - x1 = expr->Nth(1)->RealValue(); - y1 = expr->Nth(2)->RealValue(); - textString = copystring(expr->Nth(3)->StringValue()); + m_x1 = expr->Nth(1)->RealValue(); + m_y1 = expr->Nth(2)->RealValue(); + m_textString = copystring(expr->Nth(3)->StringValue()); break; } case DRAWOP_DRAW_ARC: @@ -646,64 +740,75 @@ void wxOpDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) wxOpPolyDraw::wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints):wxDrawOp(theOp) { - noPoints = n; - points = thePoints; + m_noPoints = n; + m_points = thePoints; } wxOpPolyDraw::~wxOpPolyDraw() { - delete[] points; + delete[] m_points; } wxDrawOp *wxOpPolyDraw::Copy(wxPseudoMetaFile *newImage) { - wxRealPoint *newPoints = new wxRealPoint[noPoints]; - for (int i = 0; i < noPoints; i++) + wxRealPoint *newPoints = new wxRealPoint[m_noPoints]; + for (int i = 0; i < m_noPoints; i++) { - newPoints[i].x = points[i].x; - newPoints[i].y = points[i].y; + newPoints[i].x = m_points[i].x; + newPoints[i].y = m_points[i].y; } - wxOpPolyDraw *newOp = new wxOpPolyDraw(op, noPoints, newPoints); + wxOpPolyDraw *newOp = new wxOpPolyDraw(m_op, m_noPoints, newPoints); return newOp; } void wxOpPolyDraw::Do(wxDC& dc, float xoffset, float yoffset) { - switch (op) + switch (m_op) { case DRAWOP_DRAW_POLYLINE: { - wxPoint *actualPoints = new wxPoint[noPoints]; + wxPoint *actualPoints = new wxPoint[m_noPoints]; int i; - for (i = 0; i < noPoints; i++) + for (i = 0; i < m_noPoints; i++) { - actualPoints[i].x = (long) points[i].x; - actualPoints[i].y = (long) points[i].y; + actualPoints[i].x = (long) m_points[i].x; + actualPoints[i].y = (long) m_points[i].y; } - dc.DrawLines(noPoints, actualPoints, xoffset, yoffset); + dc.DrawLines(m_noPoints, actualPoints, xoffset, yoffset); delete[] actualPoints; break; } case DRAWOP_DRAW_POLYGON: { - wxPoint *actualPoints = new wxPoint[noPoints]; + wxPoint *actualPoints = new wxPoint[m_noPoints]; int i; - for (i = 0; i < noPoints; i++) + for (i = 0; i < m_noPoints; i++) { - actualPoints[i].x = (long) points[i].x; - actualPoints[i].y = (long) points[i].y; + actualPoints[i].x = (long) m_points[i].x; + actualPoints[i].y = (long) m_points[i].y; } - dc.DrawPolygon(noPoints, actualPoints, xoffset, yoffset); + dc.DrawPolygon(m_noPoints, actualPoints, xoffset, yoffset); delete[] actualPoints; break; } case DRAWOP_DRAW_SPLINE: { -// dc.DrawSpline(noPoints, points, xoffset, yoffset); + wxPoint *actualPoints = new wxPoint[m_noPoints]; + int i; + for (i = 0; i < m_noPoints; i++) + { + actualPoints[i].x = (long) m_points[i].x; + actualPoints[i].y = (long) m_points[i].y; + } + + dc.DrawSpline(m_noPoints, actualPoints); // no offsets in DrawSpline // , xoffset, yoffset); + + delete[] actualPoints; + break; break; } default: @@ -713,38 +818,38 @@ void wxOpPolyDraw::Do(wxDC& dc, float xoffset, float yoffset) void wxOpPolyDraw::Scale(float scaleX, float scaleY) { - for (int i = 0; i < noPoints; i++) + for (int i = 0; i < m_noPoints; i++) { - points[i].x *= scaleX; - points[i].y *= scaleY; + m_points[i].x *= scaleX; + m_points[i].y *= scaleY; } } void wxOpPolyDraw::Translate(float x, float y) { - for (int i = 0; i < noPoints; i++) + for (int i = 0; i < m_noPoints; i++) { - points[i].x += x; - points[i].y += y; + m_points[i].x += x; + m_points[i].y += y; } } void wxOpPolyDraw::Rotate(float x, float y, float sinTheta, float cosTheta) { - for (int i = 0; i < noPoints; i++) + for (int i = 0; i < m_noPoints; i++) { - float x1 = points[i].x; - float y1 = points[i].y; - points[i].x = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta; - points[i].y = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta; + float x1 = m_points[i].x; + float y1 = m_points[i].y; + m_points[i].x = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta; + m_points[i].y = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta; } } -wxExpr *wxOpPolyDraw::WritewxExpr(wxPseudoMetaFile *image) +wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image) { wxExpr *expr = new wxExpr(PrologList); - expr->Append(new wxExpr((long)op)); - expr->Append(new wxExpr((long)noPoints)); + expr->Append(new wxExpr((long)m_op)); + expr->Append(new wxExpr((long)m_noPoints)); // char buf1[9]; char buf2[5]; @@ -758,10 +863,10 @@ wxExpr *wxOpPolyDraw::WritewxExpr(wxPseudoMetaFile *image) * */ - for (int i = 0; i < noPoints; i++) + for (int i = 0; i < m_noPoints; i++) { - long signedX = (long)(points[i].x*100.0); - long signedY = (long)(points[i].y*100.0); + long signedX = (long)(m_points[i].x*100.0); + long signedY = (long)(m_points[i].y*100.0); // Scale to 0 -> 64K long unSignedX = (long)(signedX + 32767.0); @@ -783,18 +888,18 @@ wxExpr *wxOpPolyDraw::WritewxExpr(wxPseudoMetaFile *image) return expr; } -void wxOpPolyDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { - noPoints = (int)expr->Nth(1)->IntegerValue(); + m_noPoints = (int)expr->Nth(1)->IntegerValue(); char buf1[5]; char buf2[5]; - points = new wxRealPoint[noPoints]; + m_points = new wxRealPoint[m_noPoints]; int i = 0; int bufPtr = 0; wxString hexString = expr->Nth(2)->StringValue(); - while (i < noPoints) + while (i < m_noPoints) { buf1[0] = hexString[bufPtr]; buf1[1] = hexString[bufPtr + 1]; @@ -822,8 +927,8 @@ void wxOpPolyDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) int testY = (signed int)unSignedY; #endif - points[i].x = (float)(signedX / 100.0); - points[i].y = (float)(signedY / 100.0); + m_points[i].x = (float)(signedX / 100.0); + m_points[i].y = (float)(signedY / 100.0); i ++; } @@ -920,6 +1025,8 @@ wxPseudoMetaFile::wxPseudoMetaFile() m_rotateable = TRUE; m_width = 0.0; m_height = 0.0; + m_outlinePen = NULL; + m_fillBrush = NULL; } wxPseudoMetaFile::wxPseudoMetaFile(wxPseudoMetaFile& mf) @@ -943,6 +1050,8 @@ void wxPseudoMetaFile::Clear() } m_ops.Clear(); m_gdiObjects.Clear(); + m_outlineColours.Clear(); + m_fillColours.Clear(); } void wxPseudoMetaFile::Draw(wxDC& dc, float xoffset, float yoffset) @@ -1071,7 +1180,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause) { sprintf(buf, "op%d", i); wxDrawOp *op = (wxDrawOp *)node->Data(); - wxExpr *expr = op->WritewxExpr(this); + wxExpr *expr = op->WriteExpr(this); if (expr) { clause->AddAttributeValue(buf, expr); @@ -1208,7 +1317,7 @@ void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause) case DRAWOP_SET_BK_MODE: { wxOpSetGDI *theOp = new wxOpSetGDI(opId, this, 0); - theOp->ReadwxExpr(this, expr); + theOp->ReadExpr(this, expr); m_ops.Append(theOp); break; } @@ -1217,7 +1326,7 @@ void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause) case DRAWOP_DESTROY_CLIPPING_RECT: { wxOpSetClipping *theOp = new wxOpSetClipping(opId, 0.0, 0.0, 0.0, 0.0); - theOp->ReadwxExpr(this, expr); + theOp->ReadExpr(this, expr); m_ops.Append(theOp); break; } @@ -1231,7 +1340,7 @@ void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause) case DRAWOP_DRAW_TEXT: { wxOpDraw *theOp = new wxOpDraw(opId, 0.0, 0.0, 0.0, 0.0); - theOp->ReadwxExpr(this, expr); + theOp->ReadExpr(this, expr); m_ops.Append(theOp); break; } @@ -1240,7 +1349,7 @@ void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause) case DRAWOP_DRAW_POLYGON: { wxOpPolyDraw *theOp = new wxOpPolyDraw(opId, 0, NULL); - theOp->ReadwxExpr(this, expr); + theOp->ReadExpr(this, expr); m_ops.Append(theOp); break; } @@ -1282,6 +1391,10 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) copy.m_width = m_width; copy.m_height = m_height; copy.m_rotateable = m_rotateable; + copy.m_fillBrush = m_fillBrush; + copy.m_outlinePen = m_outlinePen; + + copy.Clear(); // Copy the GDI objects wxNode *node = m_gdiObjects.First(); @@ -1302,14 +1415,12 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) } // Copy the outline/fill operations - copy.m_outlineColours.Clear(); node = m_outlineColours.First(); while (node) { copy.m_outlineColours.Append((wxObject *)node->Data()); node = node->Next(); } - copy.m_fillColours.Clear(); node = m_fillColours.First(); while (node) { @@ -1350,9 +1461,9 @@ bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, float *rwidth, float *rh case META_SETBKCOLOR: { wxOpSetGDI *op = new wxOpSetGDI(DRAWOP_SET_BK_COLOUR, this, 0); - op->r = (unsigned char)record->param1; - op->g = (unsigned char)record->param2; - op->b = (unsigned char)record->param3; + op->m_r = (unsigned char)record->param1; + op->m_g = (unsigned char)record->param2; + op->m_b = (unsigned char)record->param3; m_ops.Append(op); break; } @@ -1374,9 +1485,9 @@ bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, float *rwidth, float *rh case META_SETTEXTCOLOR: { wxOpSetGDI *op = new wxOpSetGDI(DRAWOP_SET_TEXT_COLOUR, this, 0); - op->r = (unsigned char)record->param1; - op->g = (unsigned char)record->param2; - op->b = (unsigned char)record->param3; + op->m_r = (unsigned char)record->param1; + op->m_g = (unsigned char)record->param2; + op->m_b = (unsigned char)record->param3; m_ops.Append(op); break; } @@ -1406,7 +1517,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, float *rwidth, float *rh { /* wxMetaRecord *rec = new wxMetaRecord(META_EXCLUDECLIPRECT); - rec->param4 = getshort(handle); // y2 + rec->param4 = getshort(handle); // m_y2 rec->param3 = getshort(handle); // x2 rec->param2 = getshort(handle); // y1 rec->param1 = getshort(handle); // x1 @@ -1416,7 +1527,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, float *rwidth, float *rh case META_INTERSECTCLIPRECT: { /* - rec->param4 = getshort(handle); // y2 + rec->param4 = getshort(handle); // m_y2 rec->param3 = getshort(handle); // x2 rec->param2 = getshort(handle); // y1 rec->param1 = getshort(handle); // x1 @@ -1695,7 +1806,7 @@ void wxPseudoMetaFile::GetBounds(float *boundMinX, float *boundMinY, float *boun while (node) { wxDrawOp *op = (wxDrawOp *)node->Data(); - switch (op->op) + switch (op->GetOp()) { case DRAWOP_DRAW_LINE: case DRAWOP_DRAW_RECT: @@ -1706,25 +1817,25 @@ void wxPseudoMetaFile::GetBounds(float *boundMinX, float *boundMinY, float *boun case DRAWOP_DRAW_TEXT: { wxOpDraw *opDraw = (wxOpDraw *)op; - if (opDraw->x1 < minX) minX = opDraw->x1; - if (opDraw->x1 > maxX) maxX = opDraw->x1; - if (opDraw->y1 < minY) minY = opDraw->y1; - if (opDraw->y1 > maxY) maxY = opDraw->y1; - if (op->op == DRAWOP_DRAW_LINE) + if (opDraw->m_x1 < minX) minX = opDraw->m_x1; + if (opDraw->m_x1 > maxX) maxX = opDraw->m_x1; + if (opDraw->m_y1 < minY) minY = opDraw->m_y1; + if (opDraw->m_y1 > maxY) maxY = opDraw->m_y1; + if (op->GetOp() == DRAWOP_DRAW_LINE) { - if (opDraw->x2 < minX) minX = opDraw->x2; - if (opDraw->x2 > maxX) maxX = opDraw->x2; - if (opDraw->y2 < minY) minY = opDraw->y2; - if (opDraw->y2 > maxY) maxY = opDraw->y2; + if (opDraw->m_x2 < minX) minX = opDraw->m_x2; + if (opDraw->m_x2 > maxX) maxX = opDraw->m_x2; + if (opDraw->m_y2 < minY) minY = opDraw->m_y2; + if (opDraw->m_y2 > maxY) maxY = opDraw->m_y2; } - else if (op->op == DRAWOP_DRAW_RECT || - op->op == DRAWOP_DRAW_ROUNDED_RECT || - op->op == DRAWOP_DRAW_ELLIPSE) + else if (op->GetOp() == DRAWOP_DRAW_RECT || + op->GetOp() == DRAWOP_DRAW_ROUNDED_RECT || + op->GetOp() == DRAWOP_DRAW_ELLIPSE) { - if ((opDraw->x1 + opDraw->x2) < minX) minX = (opDraw->x1 + opDraw->x2); - if ((opDraw->x1 + opDraw->x2) > maxX) maxX = (opDraw->x1 + opDraw->x2); - if ((opDraw->y1 + opDraw->y2) < minY) minY = (opDraw->y1 + opDraw->y2); - if ((opDraw->y1 + opDraw->y2) > maxY) maxY = (opDraw->y1 + opDraw->y2); + if ((opDraw->m_x1 + opDraw->m_x2) < minX) minX = (opDraw->m_x1 + opDraw->m_x2); + if ((opDraw->m_x1 + opDraw->m_x2) > maxX) maxX = (opDraw->m_x1 + opDraw->m_x2); + if ((opDraw->m_y1 + opDraw->m_y2) < minY) minY = (opDraw->m_y1 + opDraw->m_y2); + if ((opDraw->m_y1 + opDraw->m_y2) > maxY) maxY = (opDraw->m_y1 + opDraw->m_y2); } break; } @@ -1733,12 +1844,12 @@ void wxPseudoMetaFile::GetBounds(float *boundMinX, float *boundMinY, float *boun case DRAWOP_DRAW_SPLINE: { wxOpPolyDraw *poly = (wxOpPolyDraw *)op; - for (int i = 0; i < poly->noPoints; i++) + for (int i = 0; i < poly->m_noPoints; i++) { - if (poly->points[i].x < minX) minX = poly->points[i].x; - if (poly->points[i].x > maxX) maxX = poly->points[i].x; - if (poly->points[i].y < minY) minY = poly->points[i].y; - if (poly->points[i].y > maxY) maxY = poly->points[i].y; + if (poly->m_points[i].x < minX) minX = poly->m_points[i].x; + if (poly->m_points[i].x > maxX) maxX = poly->m_points[i].x; + if (poly->m_points[i].y < minY) minY = poly->m_points[i].y; + if (poly->m_points[i].y > maxY) maxY = poly->m_points[i].y; } break; } @@ -1758,4 +1869,195 @@ void wxPseudoMetaFile::GetBounds(float *boundMinX, float *boundMinY, float *boun */ } +// Calculate size from current operations +void wxPseudoMetaFile::CalculateSize(wxDrawnShape* shape) +{ + float boundMinX, boundMinY, boundMaxX, boundMaxY; + + GetBounds(& boundMinX, & boundMinY, & boundMaxX, & boundMaxY); + + SetSize(boundMaxX - boundMinX, boundMaxY - boundMinY); + + if (shape) + { + shape->SetWidth(m_width); + shape->SetHeight(m_height); + } +} + +// Set of functions for drawing into a pseudo metafile. +// They use integers, but doubles are used internally for accuracy +// when scaling. + +void wxPseudoMetaFile::DrawLine(const wxPoint& pt1, const wxPoint& pt2) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_LINE, + (double) pt1.x, (double) pt1.y, (double) pt2.x, (double) pt2.y); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawRectangle(const wxRect& rect) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_RECT, + (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawRoundedRectangle(const wxRect& rect, double radius) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_ROUNDED_RECT, + (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height); + + theOp->m_radius = radius; + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawEllipse(const wxRect& rect) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_ELLIPSE, + (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawPoint(const wxPoint& pt) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_POINT, + (double) pt.x, (double) pt.y, 0.0, 0.0); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawText(const wxString& text, const wxPoint& pt) +{ + wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_TEXT, + (double) pt.x, (double) pt.y, 0.0, 0.0); + + theOp->m_textString = copystring(text); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawLines(int n, wxPoint pts[]) +{ + wxRealPoint* realPoints = new wxRealPoint[n]; + int i; + for (i = 0; i < n; i++) + { + realPoints[i].x = pts[i].x; + realPoints[i].y = pts[i].y; + } + wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_POLYLINE, n, realPoints); + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawPolygon(int n, wxPoint pts[]) +{ + wxRealPoint* realPoints = new wxRealPoint[n]; + int i; + for (i = 0; i < n; i++) + { + realPoints[i].x = pts[i].x; + realPoints[i].y = pts[i].y; + } + wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_POLYGON, n, realPoints); + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[]) +{ + wxRealPoint* realPoints = new wxRealPoint[n]; + int i; + for (i = 0; i < n; i++) + { + realPoints[i].x = pts[i].x; + realPoints[i].y = pts[i].y; + } + wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_SPLINE, n, realPoints); + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::SetClippingRect(const wxRect& rect) +{ + wxOpSetClipping* theOp = new wxOpSetClipping(DRAWOP_SET_CLIPPING_RECT, + (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height); +} + +void wxPseudoMetaFile::DestroyClippingRect() +{ + wxOpSetClipping* theOp = new wxOpSetClipping(DRAWOP_DESTROY_CLIPPING_RECT, + 0.0, 0.0, 0.0, 0.0); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) +{ + m_gdiObjects.Append(pen); + int n = m_gdiObjects.Number(); + + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1); + + m_ops.Append(theOp); + + if (isOutline) + { + m_outlineColours.Append((wxObject*) (n - 1)); + } +} + +void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill) +{ + m_gdiObjects.Append(brush); + int n = m_gdiObjects.Number(); + + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1); + + m_ops.Append(theOp); + + if (isFill) + { + m_fillColours.Append((wxObject*) (n - 1)); + } +} + +void wxPseudoMetaFile::SetFont(wxFont* font) +{ + m_gdiObjects.Append(font); + int n = m_gdiObjects.Number(); + + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_FONT, this, n - 1); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::SetTextColour(const wxColour& colour) +{ + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_TEXT_COLOUR, this, 0); + theOp->m_r = colour.Red(); + theOp->m_g = colour.Green(); + theOp->m_b = colour.Blue(); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::SetBackgroundColour(const wxColour& colour) +{ + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BK_COLOUR, this, 0); + theOp->m_r = colour.Red(); + theOp->m_g = colour.Green(); + theOp->m_b = colour.Blue(); + + m_ops.Append(theOp); +} + +void wxPseudoMetaFile::SetBackgroundMode(int mode) +{ + wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BK_MODE, this, 0, mode); + + m_ops.Append(theOp); +} diff --git a/utils/ogl/src/drawn.h b/utils/ogl/src/drawn.h index cf079e1d3a..7387983d77 100644 --- a/utils/ogl/src/drawn.h +++ b/utils/ogl/src/drawn.h @@ -18,6 +18,7 @@ #include "basic.h" +class wxDrawnShape; class wxPseudoMetaFile: public wxObject { DECLARE_DYNAMIC_CLASS(wxPseudoMetaFile) @@ -48,11 +49,47 @@ class wxPseudoMetaFile: public wxObject void GetBounds(float *minX, float *minY, float *maxX, float *maxY); + // Calculate size from current operations + void CalculateSize(wxDrawnShape* shape); + 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; } + inline void SetSize(float w, float h) { m_width = w; m_height = h; } + + inline void SetFillBrush(wxBrush* brush) { m_fillBrush = brush; } + inline wxBrush* GetFillBrush() const { return m_fillBrush; } + + inline void SetOutlinePen(wxPen* pen) { m_outlinePen = pen; } + inline wxPen* GetOutlinePen() const { return m_outlinePen; } + +public: + /// Set of functions for drawing into a pseudo metafile. + /// They use integers, but doubles are used internally for accuracy + /// when scaling. + + virtual void DrawLine(const wxPoint& pt1, const wxPoint& pt2); + virtual void DrawRectangle(const wxRect& rect); + virtual void DrawRoundedRectangle(const wxRect& rect, double radius); + virtual void DrawEllipse(const wxRect& rect); + virtual void DrawPoint(const wxPoint& pt); + virtual void DrawText(const wxString& text, const wxPoint& pt); + virtual void DrawLines(int n, wxPoint pts[]); + virtual void DrawPolygon(int n, wxPoint pts[]); + virtual void DrawSpline(int n, wxPoint pts[]); + + virtual void SetClippingRect(const wxRect& rect); + virtual void DestroyClippingRect(); + + virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc. + virtual void SetFont(wxFont* font); + virtual void SetTextColour(const wxColour& colour); + virtual void SetBackgroundColour(const wxColour& colour); + virtual void SetBackgroundMode(int mode); + public: bool m_rotateable; float m_width; @@ -102,13 +139,40 @@ class wxDrawnShape: public wxRectangleShape inline void SetSaveToFile(bool save) { m_saveToFile = save; } inline wxPseudoMetaFile& GetMetaFile() const { return (wxPseudoMetaFile&) m_metafile; } + /// Set of functions for drawing into a pseudo metafile. + /// They use integers, but doubles are used internally for accuracy + /// when scaling. + + virtual void DrawLine(const wxPoint& pt1, const wxPoint& pt2); + virtual void DrawRectangle(const wxRect& rect); + virtual void DrawRoundedRectangle(const wxRect& rect, double radius); + virtual void DrawEllipse(const wxRect& rect); + virtual void DrawPoint(const wxPoint& pt); + virtual void DrawText(const wxString& text, const wxPoint& pt); + virtual void DrawLines(int n, wxPoint pts[]); + virtual void DrawPolygon(int n, wxPoint pts[]); + virtual void DrawSpline(int n, wxPoint pts[]); + + virtual void SetClippingRect(const wxRect& rect); + virtual void DestroyClippingRect(); + + virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc. + virtual void SetFont(wxFont* font); + virtual void SetTextColour(const wxColour& colour); + virtual void SetBackgroundColour(const wxColour& colour); + virtual void SetBackgroundMode(int mode); + + // Set the width/height according to the shapes in the metafile. + // Call this after drawing into the shape. + inline void CalculateSize() { m_metafile.CalculateSize(this); } + 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 diff --git a/utils/ogl/src/drawnp.h b/utils/ogl/src/drawnp.h index a08aef7bb5..dddd89e470 100644 --- a/utils/ogl/src/drawnp.h +++ b/utils/ogl/src/drawnp.h @@ -56,18 +56,22 @@ class wxDrawOp: public wxObject { - public: - int op; - - inline wxDrawOp(int theOp) { op = theOp; } +public: + inline wxDrawOp(int theOp) { m_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; + virtual wxExpr *WriteExpr(wxPseudoMetaFile *image) = 0; + virtual void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0; + + int GetOp() const { return m_op; } + +protected: + int m_op; + }; /* @@ -78,17 +82,19 @@ class wxDrawOp: public wxObject 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); + wxExpr *WriteExpr(wxPseudoMetaFile *image); + void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr); + +public: + int m_mode; + int m_gdiIndex; + wxPseudoMetaFile* m_image; + unsigned char m_r; + unsigned char m_g; + unsigned char m_b; }; /* @@ -98,18 +104,20 @@ class wxOpSetGDI: public wxDrawOp class wxOpSetClipping: public wxDrawOp { - public: - float x1; - float y1; - float x2; - float y2; +public: 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); + wxExpr *WriteExpr(wxPseudoMetaFile *image); + void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr); + +public: + float m_x1; + float m_y1; + float m_x2; + float m_y2; }; /* @@ -120,14 +128,6 @@ class wxOpSetClipping: public wxDrawOp 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(); @@ -136,8 +136,18 @@ class wxOpDraw: public wxDrawOp 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); + wxExpr *WriteExpr(wxPseudoMetaFile *image); + void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr); + +public: + float m_x1; + float m_y1; + float m_x2; + float m_y2; + float m_x3; + float m_radius; + char* m_textString; + }; /* @@ -147,10 +157,7 @@ class wxOpDraw: public wxDrawOp class wxOpPolyDraw: public wxDrawOp { - public: - wxRealPoint *points; - int noPoints; - +public: wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints); ~wxOpPolyDraw(); void Do(wxDC& dc, float xoffset, float yoffset); @@ -158,8 +165,13 @@ class wxOpPolyDraw: public wxDrawOp 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); + wxExpr *WriteExpr(wxPseudoMetaFile *image); + void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr); + +public: + wxRealPoint* m_points; + int m_noPoints; + }; #endif diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index 34216779cf..08647fe336 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -1650,7 +1650,7 @@ void wxLineShape::Copy(wxShape& copy) // Override select, to create/delete temporary label-moving objects void wxLineShape::Select(bool select, wxDC* dc) { - wxShape::Select(select); + wxShape::Select(select, dc); if (select) { for (int i = 0; i < 3; i++) diff --git a/utils/ogl/src/lines.h b/utils/ogl/src/lines.h index 29388bb823..5671503942 100644 --- a/utils/ogl/src/lines.h +++ b/utils/ogl/src/lines.h @@ -58,6 +58,7 @@ class wxArrowHead: public wxObject inline WXTYPE _GetType() const { return m_arrowType; } inline int GetPosition() const { return m_arrowEnd; } + inline void SetPosition(int pos) { m_arrowEnd = pos; } inline float GetXOffset() const { return m_xOffset; } inline float GetYOffset() const { return m_yOffset; } inline float GetSpacing() const { return m_spacing; } @@ -200,7 +201,7 @@ class wxLineShape: public wxShape // Does the copying for this object void Copy(wxShape& copy); - // New OGL stuff + // Add an arrowhead. 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); @@ -226,6 +227,7 @@ class wxLineShape: public wxShape bool DeleteArrowHead(long arrowId); void DrawArrow(wxDC& dc, wxArrowHead *arrow, float xOffset, bool proportionalOffset); inline void SetIgnoreOffsets(bool ignore) { m_ignoreArrowOffsets = ignore; } + inline wxList& GetArrows() const { return (wxList&) m_arcArrows; } // Find horizontal width for drawing a line with // arrows in minimum space. Assume arrows at diff --git a/utils/ogl/src/misc.cpp b/utils/ogl/src/misc.cpp index 1c51a7783d..b1cbe4908e 100644 --- a/utils/ogl/src/misc.cpp +++ b/utils/ogl/src/misc.cpp @@ -62,7 +62,7 @@ void wxOGLInitialize() { GraphicsBullseyeCursor = new wxCursor(wxCURSOR_BULLSEYE); - g_oglNormalFont = new wxFont(12, wxMODERN, wxNORMAL, wxNORMAL); + g_oglNormalFont = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL); black_pen = new wxPen("BLACK", 1, wxSOLID); @@ -834,4 +834,71 @@ void UpdateListBox(wxListBox *item, wxList *list) } } +/* + * Hex<->Dec conversion + */ + +// Array used in DecToHex conversion routine. +static char sg_HexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', + 'C', 'D', 'E', 'F' }; + +// Convert 2-digit hex number to decimal +unsigned int oglHexToDec(char* buf) +{ + int firstDigit, secondDigit; + + if (buf[0] >= 'A') + firstDigit = buf[0] - 'A' + 10; + else + firstDigit = buf[0] - '0'; + + if (buf[1] >= 'A') + secondDigit = buf[1] - 'A' + 10; + else + secondDigit = buf[1] - '0'; + + return firstDigit * 16 + secondDigit; +} + +// Convert decimal integer to 2-character hex string +void oglDecToHex(unsigned int dec, char *buf) +{ + int firstDigit = (int)(dec/16.0); + int secondDigit = (int)(dec - (firstDigit*16.0)); + buf[0] = sg_HexArray[firstDigit]; + buf[1] = sg_HexArray[secondDigit]; + buf[2] = 0; +} + +// 3-digit hex to wxColour +wxColour oglHexToColour(const wxString& hex) +{ + if (hex.Length() == 6) + { + char buf[7]; + strncpy(buf, hex, 7); + unsigned int r = oglHexToDec((char *)buf); + unsigned int g = oglHexToDec((char *)(buf+2)); + unsigned int b = oglHexToDec((char *)(buf+4)); + return wxColour(r, g, b); + } + else + return wxColour(0,0,0); +} + +// RGB to 3-digit hex +wxString oglColourToHex(const wxColour& colour) +{ + char buf[7]; + unsigned int red = colour.Red(); + unsigned int green = colour.Green(); + unsigned int blue = colour.Blue(); + + oglDecToHex(red, buf); + oglDecToHex(green, buf+2); + oglDecToHex(blue, buf+4); + + return wxString(buf); +} + diff --git a/utils/ogl/src/misc.h b/utils/ogl/src/misc.h index fb4ca0144b..63ee93c166 100644 --- a/utils/ogl/src/misc.h +++ b/utils/ogl/src/misc.h @@ -103,5 +103,11 @@ extern wxCursor *GraphicsBullseyeCursor; extern wxFont *MatchFont(int point_size); +extern wxString oglColourToHex(const wxColour& colour); +extern wxColour oglHexToColour(const wxString& hex); +extern void oglDecToHex(unsigned int dec, char *buf); +extern unsigned int oglHexToDec(char* buf); + + #endif // _OGL_MISC_H_ -- 2.45.2