From a313f7d3f08f537982ec7ea7e10883c79cd60dc6 Mon Sep 17 00:00:00 2001 From: Bryan Petty Date: Tue, 30 Mar 2004 21:46:20 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'wxPy_2_5_1_4'. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/wxPy_2_5_1_4@26509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/build/animate/animate_animatedll.dsp | 266 -- contrib/build/animate/animate_animatelib.dsp | 249 -- contrib/build/fl/fl_fldll.dsp | 330 -- contrib/build/fl/fl_fllib.dsp | 313 -- contrib/build/net/netutils.dsp | 474 --- contrib/build/ogl/ogl_ogldll.dsp | 310 -- contrib/build/ogl/ogl_ogllib.dsp | 293 -- contrib/build/stc/stc_stcdll.dsp | 452 -- contrib/build/stc/stc_stclib.dsp | 435 -- contrib/build/svg/svg_svgdll.dsp | 266 -- contrib/build/svg/svg_svglib.dsp | 249 -- contrib/src/stc/stc.cpp | 6 +- contrib/src/stc/stc.cpp.in | 6 +- demos/dbbrowse/makefile.gtk | 15 - include/wx/mac/carbon/accel.h | 53 - include/wx/mac/carbon/aga.h | 13 - include/wx/mac/carbon/app.h | 207 - include/wx/mac/carbon/apptbase.h | 39 - include/wx/mac/carbon/apptrait.h | 42 - include/wx/mac/carbon/bitmap.h | 225 - include/wx/mac/carbon/bmpbuttn.h | 65 - include/wx/mac/carbon/brush.h | 82 - include/wx/mac/carbon/button.h | 55 - include/wx/mac/carbon/checkbox.h | 84 - include/wx/mac/carbon/checklst.h | 105 - include/wx/mac/carbon/chkconf.h | 30 - include/wx/mac/carbon/choice.h | 111 - include/wx/mac/carbon/clipbrd.h | 81 - include/wx/mac/carbon/colordlg.h | 46 - include/wx/mac/carbon/colour.h | 101 - include/wx/mac/carbon/combobox.h | 136 - include/wx/mac/carbon/control.h | 109 - include/wx/mac/carbon/cursor.h | 85 - include/wx/mac/carbon/dataform.h | 61 - include/wx/mac/carbon/dataobj.h | 35 - include/wx/mac/carbon/dataobj2.h | 86 - include/wx/mac/carbon/dc.h | 293 -- include/wx/mac/carbon/dcclient.h | 74 - include/wx/mac/carbon/dcmemory.h | 37 - include/wx/mac/carbon/dcprint.h | 49 - include/wx/mac/carbon/dcscreen.h | 39 - include/wx/mac/carbon/dialog.h | 105 - include/wx/mac/carbon/dirdlg.h | 50 - include/wx/mac/carbon/display.h | 46 - include/wx/mac/carbon/dnd.h | 114 - include/wx/mac/carbon/filedlg.h | 50 - include/wx/mac/carbon/font.h | 116 - include/wx/mac/carbon/fontdlg.h | 46 - include/wx/mac/carbon/frame.h | 124 - include/wx/mac/carbon/gauge.h | 67 - include/wx/mac/carbon/gdiobj.h | 48 - include/wx/mac/carbon/glcanvas.h | 134 - include/wx/mac/carbon/gsockmac.h | 93 - include/wx/mac/carbon/helpxxxx.h | 53 - include/wx/mac/carbon/icon.h | 95 - include/wx/mac/carbon/imaglist.h | 147 - include/wx/mac/carbon/joystick.h | 93 - include/wx/mac/carbon/listbox.h | 181 - include/wx/mac/carbon/listctrl.h | 451 -- include/wx/mac/carbon/macnotfy.h | 33 - include/wx/mac/carbon/macsock.h | 0 include/wx/mac/carbon/mdi.h | 180 - include/wx/mac/carbon/menu.h | 169 - include/wx/mac/carbon/menuitem.h | 81 - include/wx/mac/carbon/metafile.h | 166 - include/wx/mac/carbon/mimetype.h | 122 - include/wx/mac/carbon/minifram.h | 46 - include/wx/mac/carbon/msgdlg.h | 55 - include/wx/mac/carbon/notebook.h | 157 - include/wx/mac/carbon/palette.h | 68 - include/wx/mac/carbon/pen.h | 103 - include/wx/mac/carbon/pnghand.h | 37 - include/wx/mac/carbon/pngread.h | 290 -- include/wx/mac/carbon/printdlg.h | 73 - include/wx/mac/carbon/printmac.h | 64 - include/wx/mac/carbon/private.h | 238 -- include/wx/mac/carbon/private/hid.h | 63 - include/wx/mac/carbon/private/print.h | 107 - include/wx/mac/carbon/radiobox.h | 108 - include/wx/mac/carbon/radiobut.h | 94 - include/wx/mac/carbon/region.h | 177 - include/wx/mac/carbon/scrolbar.h | 71 - include/wx/mac/carbon/setup.h | 938 ----- include/wx/mac/carbon/setup0.h | 933 ----- include/wx/mac/carbon/slider.h | 110 - include/wx/mac/carbon/sound.h | 53 - include/wx/mac/carbon/spinbutt.h | 79 - include/wx/mac/carbon/spinctrl.h | 188 - include/wx/mac/carbon/statbmp.h | 68 - include/wx/mac/carbon/statbox.h | 57 - include/wx/mac/carbon/statline.h | 61 - include/wx/mac/carbon/stattext.h | 62 - include/wx/mac/carbon/statusbr.h | 53 - include/wx/mac/carbon/tabctrl.h | 138 - include/wx/mac/carbon/taskbarosx.h | 48 - include/wx/mac/carbon/textctrl.h | 184 - include/wx/mac/carbon/tglbtn.h | 59 - include/wx/mac/carbon/timer.h | 48 - include/wx/mac/carbon/toolbar.h | 96 - include/wx/mac/carbon/tooltip.h | 48 - include/wx/mac/carbon/toplevel.h | 146 - include/wx/mac/carbon/treectrl.h | 295 -- include/wx/mac/carbon/uma.h | 131 - include/wx/mac/carbon/window.h | 269 -- include/wx/mac/classic/accel.h | 53 - include/wx/mac/classic/aga.h | 13 - include/wx/mac/classic/app.h | 207 - include/wx/mac/classic/apptbase.h | 39 - include/wx/mac/classic/apptrait.h | 42 - include/wx/mac/classic/bitmap.h | 225 - include/wx/mac/classic/bmpbuttn.h | 65 - include/wx/mac/classic/brush.h | 82 - include/wx/mac/classic/button.h | 55 - include/wx/mac/classic/checkbox.h | 84 - include/wx/mac/classic/checklst.h | 105 - include/wx/mac/classic/chkconf.h | 30 - include/wx/mac/classic/choice.h | 111 - include/wx/mac/classic/clipbrd.h | 81 - include/wx/mac/classic/colordlg.h | 46 - include/wx/mac/classic/colour.h | 101 - include/wx/mac/classic/combobox.h | 136 - include/wx/mac/classic/control.h | 109 - include/wx/mac/classic/cursor.h | 85 - include/wx/mac/classic/dataform.h | 61 - include/wx/mac/classic/dataobj.h | 35 - include/wx/mac/classic/dataobj2.h | 86 - include/wx/mac/classic/dc.h | 293 -- include/wx/mac/classic/dcclient.h | 74 - include/wx/mac/classic/dcmemory.h | 37 - include/wx/mac/classic/dcprint.h | 49 - include/wx/mac/classic/dcscreen.h | 39 - include/wx/mac/classic/dialog.h | 105 - include/wx/mac/classic/dirdlg.h | 50 - include/wx/mac/classic/display.h | 46 - include/wx/mac/classic/dnd.h | 114 - include/wx/mac/classic/filedlg.h | 50 - include/wx/mac/classic/font.h | 116 - include/wx/mac/classic/fontdlg.h | 46 - include/wx/mac/classic/frame.h | 124 - include/wx/mac/classic/gauge.h | 67 - include/wx/mac/classic/gdiobj.h | 48 - include/wx/mac/classic/glcanvas.h | 134 - include/wx/mac/classic/gsockmac.h | 93 - include/wx/mac/classic/helpxxxx.h | 53 - include/wx/mac/classic/icon.h | 95 - include/wx/mac/classic/imaglist.h | 147 - include/wx/mac/classic/joystick.h | 93 - include/wx/mac/classic/listbox.h | 181 - include/wx/mac/classic/listctrl.h | 451 -- include/wx/mac/classic/macnotfy.h | 33 - include/wx/mac/classic/macsock.h | 0 include/wx/mac/classic/mdi.h | 180 - include/wx/mac/classic/menu.h | 169 - include/wx/mac/classic/menuitem.h | 81 - include/wx/mac/classic/metafile.h | 166 - include/wx/mac/classic/mimetype.h | 122 - include/wx/mac/classic/minifram.h | 46 - include/wx/mac/classic/msgdlg.h | 55 - include/wx/mac/classic/notebook.h | 157 - include/wx/mac/classic/palette.h | 68 - include/wx/mac/classic/pen.h | 103 - include/wx/mac/classic/pnghand.h | 37 - include/wx/mac/classic/pngread.h | 290 -- include/wx/mac/classic/printdlg.h | 73 - include/wx/mac/classic/printmac.h | 64 - include/wx/mac/classic/private.h | 238 -- include/wx/mac/classic/private/hid.h | 63 - include/wx/mac/classic/private/print.h | 107 - include/wx/mac/classic/radiobox.h | 108 - include/wx/mac/classic/radiobut.h | 94 - include/wx/mac/classic/region.h | 177 - include/wx/mac/classic/scrolbar.h | 71 - include/wx/mac/classic/setup.h | 938 ----- include/wx/mac/classic/setup0.h | 933 ----- include/wx/mac/classic/slider.h | 110 - include/wx/mac/classic/sound.h | 53 - include/wx/mac/classic/spinbutt.h | 79 - include/wx/mac/classic/spinctrl.h | 188 - include/wx/mac/classic/statbmp.h | 68 - include/wx/mac/classic/statbox.h | 57 - include/wx/mac/classic/statline.h | 61 - include/wx/mac/classic/stattext.h | 62 - include/wx/mac/classic/statusbr.h | 53 - include/wx/mac/classic/tabctrl.h | 138 - include/wx/mac/classic/taskbarosx.h | 48 - include/wx/mac/classic/textctrl.h | 184 - include/wx/mac/classic/tglbtn.h | 59 - include/wx/mac/classic/timer.h | 48 - include/wx/mac/classic/toolbar.h | 96 - include/wx/mac/classic/tooltip.h | 48 - include/wx/mac/classic/toplevel.h | 146 - include/wx/mac/classic/treectrl.h | 295 -- include/wx/mac/classic/uma.h | 131 - include/wx/mac/classic/window.h | 269 -- include/wx/platform.h | 23 - lib/vms_gtk_univ.opt | 14 + samples/taskbar/mondrian.ico | Bin 0 -> 766 bytes samples/taskbar/mondrian.xpm | 34 + samples/taskbar/tbtest.rc | 3 + samples/treectrl/treetest.dsp | 155 - src/common/toplvcmn.cpp | 2 - src/common/wincmn.cpp | 4 +- src/generic/treectlg.cpp | 2 - src/html/helpfrm.cpp | 10 +- src/html/htmlfilter.cpp | 172 - src/html/htmlhelp.cpp | 839 ---- src/html/search.cpp | 72 - src/mac/carbon/Info.plist.in | 36 - src/mac/carbon/accel.cpp | 108 - src/mac/carbon/aga.cpp | 2 - src/mac/carbon/app.cpp | 2439 ----------- src/mac/carbon/apprsrc.h | 6 - src/mac/carbon/apprsrc.r | 32 - src/mac/carbon/bitmap.cpp | 1436 ------- src/mac/carbon/bmpbuttn.cpp | 113 - src/mac/carbon/brush.cpp | 229 -- src/mac/carbon/button.cpp | 132 - src/mac/carbon/carbrsrc.r | 7 - src/mac/carbon/checkbox.cpp | 179 - src/mac/carbon/checklst.cpp | 453 -- src/mac/carbon/choice.cpp | 300 -- src/mac/carbon/clipbrd.cpp | 406 -- src/mac/carbon/colordlg.cpp | 70 - src/mac/carbon/colour.cpp | 116 - src/mac/carbon/combobox.cpp | 540 --- src/mac/carbon/control.cpp | 814 ---- src/mac/carbon/corersrc.r | 159 - src/mac/carbon/cursor.cpp | 505 --- src/mac/carbon/data.cpp | 25 - src/mac/carbon/dataobj.cpp | 308 -- src/mac/carbon/dc.cpp | 2297 ----------- src/mac/carbon/dcclient.cpp | 175 - src/mac/carbon/dcmemory.cpp | 100 - src/mac/carbon/dcprint.cpp | 416 -- src/mac/carbon/dcscreen.cpp | 63 - src/mac/carbon/dialog.cpp | 268 -- src/mac/carbon/dirdlg.cpp | 146 - src/mac/carbon/dirmac.cpp | 322 -- src/mac/carbon/display.cpp | 446 -- src/mac/carbon/dnd.cpp | 607 --- src/mac/carbon/filedlg.cpp | 647 --- src/mac/carbon/font.cpp | 446 -- src/mac/carbon/fontdlg.cpp | 54 - src/mac/carbon/fontenum.cpp | 173 - src/mac/carbon/fontutil.cpp | 117 - src/mac/carbon/frame.cpp | 338 -- src/mac/carbon/gauge.cpp | 95 - src/mac/carbon/gdiobj.cpp | 22 - src/mac/carbon/glcanvas.cpp | 385 -- src/mac/carbon/gsocket.c | 1653 -------- src/mac/carbon/gsockosx.c | 181 - src/mac/carbon/gsockosx.cpp | 181 - src/mac/carbon/helpxxxx.cpp | 84 - src/mac/carbon/hid.cpp | 417 -- src/mac/carbon/icon.cpp | 132 - src/mac/carbon/joystick.cpp | 286 -- src/mac/carbon/listbox.cpp | 1023 ----- src/mac/carbon/macnotfy.cpp | 162 - src/mac/carbon/main.cpp | 12 - src/mac/carbon/mdi.cpp | 395 -- src/mac/carbon/menu.cpp | 881 ---- src/mac/carbon/menuitem.cpp | 283 -- src/mac/carbon/metafile.cpp | 219 - src/mac/carbon/mimetmac.cpp | 228 -- src/mac/carbon/minifram.cpp | 22 - src/mac/carbon/msgdlg.cpp | 262 -- src/mac/carbon/notebmac.cpp | 729 ---- src/mac/carbon/palette.cpp | 118 - src/mac/carbon/pen.cpp | 186 - src/mac/carbon/pnghand.cpp | 904 ---- src/mac/carbon/printdlg.cpp | 124 - src/mac/carbon/printmac.cpp | 781 ---- src/mac/carbon/radiobox.cpp | 580 --- src/mac/carbon/radiobut.cpp | 150 - src/mac/carbon/region.cpp | 437 -- src/mac/carbon/renderer.cpp | 283 -- src/mac/carbon/scrolbar.cpp | 184 - src/mac/carbon/settings.cpp | 279 -- src/mac/carbon/slider.cpp | 433 -- src/mac/carbon/sound.cpp | 243 -- src/mac/carbon/spinbutt.cpp | 182 - src/mac/carbon/spinctrl.cpp | 333 -- src/mac/carbon/statbmp.cpp | 86 - src/mac/carbon/statbox.cpp | 56 - src/mac/carbon/statbrma.cpp | 155 - src/mac/carbon/statline.cpp | 61 - src/mac/carbon/statlmac.cpp | 67 - src/mac/carbon/stattext.cpp | 262 -- src/mac/carbon/tabctrl.cpp | 206 - src/mac/carbon/textctrl.cpp | 1810 -------- src/mac/carbon/tglbtn.cpp | 127 - src/mac/carbon/thread.cpp | 921 ----- src/mac/carbon/timer.cpp | 143 - src/mac/carbon/toolbar.cpp | 620 --- src/mac/carbon/tooltip.cpp | 408 -- src/mac/carbon/toplevel.cpp | 1463 ------- src/mac/carbon/treectrl.cpp | 419 -- src/mac/carbon/uma.cpp | 815 ---- src/mac/carbon/utils.cpp | 1395 ------- src/mac/carbon/utilsexc.cpp | 223 - src/mac/carbon/window.cpp | 2096 ---------- src/mac/carbon/wxmac.icns | Bin 36901 -> 0 bytes src/mac/classic/Info.plist.in | 36 - src/mac/classic/accel.cpp | 108 - src/mac/classic/aga.cpp | 2 - src/mac/classic/app.cpp | 2439 ----------- src/mac/classic/apprsrc.h | 6 - src/mac/classic/apprsrc.r | 32 - src/mac/classic/bitmap.cpp | 1436 ------- src/mac/classic/bmpbuttn.cpp | 113 - src/mac/classic/brush.cpp | 229 -- src/mac/classic/button.cpp | 132 - src/mac/classic/carbrsrc.r | 7 - src/mac/classic/checkbox.cpp | 179 - src/mac/classic/checklst.cpp | 453 -- src/mac/classic/choice.cpp | 300 -- src/mac/classic/clipbrd.cpp | 406 -- src/mac/classic/colordlg.cpp | 70 - src/mac/classic/colour.cpp | 116 - src/mac/classic/combobox.cpp | 540 --- src/mac/classic/control.cpp | 814 ---- src/mac/classic/corersrc.r | 159 - src/mac/classic/cursor.cpp | 505 --- src/mac/classic/data.cpp | 25 - src/mac/classic/dataobj.cpp | 308 -- src/mac/classic/dc.cpp | 2297 ----------- src/mac/classic/dcclient.cpp | 175 - src/mac/classic/dcmemory.cpp | 100 - src/mac/classic/dcprint.cpp | 416 -- src/mac/classic/dcscreen.cpp | 63 - src/mac/classic/dialog.cpp | 268 -- src/mac/classic/dirdlg.cpp | 146 - src/mac/classic/dirmac.cpp | 322 -- src/mac/classic/display.cpp | 446 -- src/mac/classic/dnd.cpp | 607 --- src/mac/classic/filedlg.cpp | 647 --- src/mac/classic/font.cpp | 446 -- src/mac/classic/fontdlg.cpp | 54 - src/mac/classic/fontenum.cpp | 173 - src/mac/classic/fontutil.cpp | 117 - src/mac/classic/frame.cpp | 338 -- src/mac/classic/gauge.cpp | 95 - src/mac/classic/gdiobj.cpp | 22 - src/mac/classic/glcanvas.cpp | 385 -- src/mac/classic/gsocket.c | 1653 -------- src/mac/classic/gsockosx.c | 181 - src/mac/classic/gsockosx.cpp | 181 - src/mac/classic/helpxxxx.cpp | 84 - src/mac/classic/hid.cpp | 417 -- src/mac/classic/icon.cpp | 132 - src/mac/classic/joystick.cpp | 286 -- src/mac/classic/listbox.cpp | 1023 ----- src/mac/classic/macnotfy.cpp | 162 - src/mac/classic/main.cpp | 12 - src/mac/classic/mdi.cpp | 395 -- src/mac/classic/menu.cpp | 881 ---- src/mac/classic/menuitem.cpp | 283 -- src/mac/classic/metafile.cpp | 219 - src/mac/classic/mimetmac.cpp | 228 -- src/mac/classic/minifram.cpp | 22 - src/mac/classic/morefile/DirectoryCopy.c | 685 ---- src/mac/classic/morefile/DirectoryCopy.h | 559 --- src/mac/classic/morefile/FSpCompat.c | 946 ----- src/mac/classic/morefile/FSpCompat.h | 586 --- src/mac/classic/morefile/FileCopy.c | 611 --- src/mac/classic/morefile/FileCopy.h | 271 -- src/mac/classic/morefile/FullPath.c | 282 -- src/mac/classic/morefile/FullPath.h | 311 -- src/mac/classic/morefile/IterateDirectory.c | 207 - src/mac/classic/morefile/IterateDirectory.h | 222 - src/mac/classic/morefile/MoreDesktopMgr.c | 1270 ------ src/mac/classic/morefile/MoreDesktopMgr.h | 628 --- src/mac/classic/morefile/MoreFiles.c | 643 --- src/mac/classic/morefile/MoreFiles.h | 1420 ------- src/mac/classic/morefile/MoreFilesExtras.c | 3632 ----------------- src/mac/classic/morefile/MoreFilesExtras.h | 3597 ---------------- src/mac/classic/morefile/Optimization.h | 109 - src/mac/classic/morefile/OptimizationEnd.h | 56 - src/mac/classic/morefile/Search.c | 1300 ------ src/mac/classic/morefile/Search.h | 304 -- src/mac/classic/msgdlg.cpp | 262 -- src/mac/classic/notebmac.cpp | 729 ---- src/mac/classic/palette.cpp | 118 - src/mac/classic/pen.cpp | 186 - src/mac/classic/pnghand.cpp | 904 ---- src/mac/classic/printdlg.cpp | 124 - src/mac/classic/printmac.cpp | 781 ---- src/mac/classic/radiobox.cpp | 580 --- src/mac/classic/radiobut.cpp | 150 - src/mac/classic/region.cpp | 437 -- src/mac/classic/renderer.cpp | 283 -- src/mac/classic/scrolbar.cpp | 184 - src/mac/classic/settings.cpp | 279 -- src/mac/classic/slider.cpp | 433 -- src/mac/classic/sound.cpp | 243 -- src/mac/classic/spinbutt.cpp | 182 - src/mac/classic/spinctrl.cpp | 333 -- src/mac/classic/statbmp.cpp | 86 - src/mac/classic/statbox.cpp | 56 - src/mac/classic/statbrma.cpp | 155 - src/mac/classic/statline.cpp | 61 - src/mac/classic/statlmac.cpp | 67 - src/mac/classic/stattext.cpp | 262 -- src/mac/classic/tabctrl.cpp | 206 - src/mac/classic/textctrl.cpp | 1810 -------- src/mac/classic/tglbtn.cpp | 127 - src/mac/classic/thread.cpp | 921 ----- src/mac/classic/timer.cpp | 143 - src/mac/classic/toolbar.cpp | 620 --- src/mac/classic/tooltip.cpp | 408 -- src/mac/classic/toplevel.cpp | 1463 ------- src/mac/classic/treectrl.cpp | 419 -- src/mac/classic/uma.cpp | 815 ---- src/mac/classic/utils.cpp | 1395 ------- src/mac/classic/utilsexc.cpp | 223 - src/mac/classic/window.cpp | 2096 ---------- src/mac/classic/wxmac.icns | Bin 36901 -> 0 bytes src/mac/corefoundation/gsockosx.cpp | 181 - src/motif/gauge.cpp | 7 +- src/motif/xmcombo/xmcombo.c | 5 - src/msw/toplevel.cpp | 3 + src/png/makefile.nt | 68 - src/stc/stc.cpp | 6 +- src/stc/stc.cpp.in | 6 +- src/unix/net.cpp | 422 -- utils/HelpGen/helpgen.dsp | 471 --- utils/HelpGen/makefile.bcc | 181 - utils/HelpGen/makefile.gcc | 166 - utils/HelpGen/makefile.vc | 219 - utils/HelpGen/makefile.wat | 225 - utils/wxprop/src/prop.cpp | 1119 ----- wxPython/b.bat | 1 - wxPython/config.py | 4 +- wxPython/contrib/activex/activex_wrap.cpp | 10 +- wxPython/contrib/gizmos/gizmos.i | 8 +- wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp | 53 +- wxPython/contrib/gizmos/mac/gizmos_wrap.cpp | 53 +- wxPython/contrib/gizmos/msw/gizmos_wrap.cpp | 53 +- .../contrib/glcanvas/gtk/glcanvas_wrap.cpp | 10 +- .../contrib/glcanvas/mac/glcanvas_wrap.cpp | 10 +- .../contrib/glcanvas/msw/glcanvas_wrap.cpp | 10 +- wxPython/contrib/iewin/iewin_wrap.cpp | 10 +- wxPython/contrib/ogl/gtk/ogl_wrap.cpp | 55 +- wxPython/contrib/ogl/mac/ogl_wrap.cpp | 55 +- wxPython/contrib/ogl/msw/ogl_wrap.cpp | 55 +- wxPython/contrib/stc/stc_wrap.cpp | 10 +- wxPython/contrib/xrc/xrc_wrap.cpp | 10 +- wxPython/demo/ActiveX_FlashWindow.py | 5 +- wxPython/demo/ActiveX_PDFWindow.py | 3 +- wxPython/demo/BitmapButton.py | 4 +- wxPython/demo/Main.py | 1 - wxPython/demo/Mask.py | 1 + wxPython/demo/NewNamespace.py | 47 - wxPython/demo/Timer.py | 2 +- wxPython/demo/XmlResourceHandler.py | 60 +- wxPython/demo/XmlResourceSubclass.py | 19 +- wxPython/demo/data/wxPackage.html | 290 -- wxPython/distrib/DIRLIST | 3 - wxPython/distrib/README.devel.txt | 4 +- wxPython/distrib/howto-distrib.txt | 16 +- wxPython/distrib/mac/wxPythonOSX/Info.icns | Bin 0 -> 59052 bytes wxPython/distrib/mac/wxPythonOSX/build | 44 +- wxPython/distrib/make_installer.py | 15 +- wxPython/distrib/viewdocs.py | 34 +- wxPython/docs/BUILD.html | 9 +- wxPython/docs/CHANGES.html | 32 +- wxPython/docs/CHANGES.txt | 29 +- wxPython/docs/INSTALL.html | 6 +- wxPython/docs/MigrationGuide.html | 188 +- wxPython/docs/MigrationGuide.txt | 100 +- wxPython/docs/PyManual.html | 20 +- wxPython/docs/PyManual.txt | 10 +- wxPython/docs/README.html | 4 - wxPython/docs/docutils.conf | 1 - wxPython/docs/screenshots/PyShell.png | Bin 0 -> 35825 bytes wxPython/docs/screenshots/hello-linux.png | Bin 62715 -> 0 bytes wxPython/docs/screenshots/hello-mac.png | Bin 61195 -> 0 bytes wxPython/docs/screenshots/hello-win98.png | Bin 49310 -> 0 bytes wxPython/docs/wxPackage.html | 104 +- wxPython/docs/wxPackage.txt | 14 +- wxPython/docs/wxPythonDocs.html | 77 - wxPython/docs/wxPythonDocs.txt | 77 - wxPython/docs/wxPythonExamples.html | 226 - wxPython/docs/wxPythonExamples.txt | 118 - wxPython/docs/wxPythonManual.html | 62 +- wxPython/docs/wxPythonManual.txt | 48 +- wxPython/docs/wxPythonTutorial.html | 128 - wxPython/docs/wxPythonTutorial.txt | 43 - wxPython/docs/xml/wxPython-metadata.xml | 735 +--- wxPython/include/wx/wxPython/pyclasses.h | 1 + wxPython/include/wx/wxPython/wxPython_int.h | 22 + wxPython/samples/simple/simple.py | 14 +- .../samples/wx_examples/basic/__init__.py | 1 - wxPython/samples/wx_examples/basic/app.py | 27 - wxPython/samples/wx_examples/basic/frame.py | 33 - .../samples/wx_examples/hello/__init__.py | 1 - wxPython/samples/wx_examples/hello/hello.py | 38 - .../samples/wx_examples/hello/wxPython.jpg | Bin 14557 -> 0 bytes wxPython/scripts/CreateBatchFiles.py | 2 +- wxPython/scripts/pywrap.bat | 2 +- wxPython/src/_button.i | 4 +- wxPython/src/_checkbox.i | 2 + wxPython/src/_choice.i | 2 + wxPython/src/_cmndlgs.i | 10 + wxPython/src/_combobox.i | 2 + wxPython/src/_cursor.i | 2 + wxPython/src/_pycontrol.i | 10 +- wxPython/src/_pywindows.i | 149 +- wxPython/src/_radio.i | 2 +- wxPython/src/_slider.i | 2 +- wxPython/src/_splitter.i | 357 +- wxPython/src/_window.i | 2 + wxPython/src/_windows_rename.i | 1 + wxPython/src/calendar.i | 2 + wxPython/src/gtk/calendar_wrap.cpp | 14 +- wxPython/src/gtk/controls.py | 18 +- wxPython/src/gtk/controls_wrap.cpp | 101 +- wxPython/src/gtk/core_wrap.cpp | 34 +- wxPython/src/gtk/gdi_wrap.cpp | 46 +- wxPython/src/gtk/grid_wrap.cpp | 59 +- wxPython/src/gtk/html_wrap.cpp | 59 +- wxPython/src/gtk/misc_wrap.cpp | 34 +- wxPython/src/gtk/windows.py | 412 +- wxPython/src/gtk/windows_wrap.cpp | 1205 +++++- wxPython/src/gtk/wizard_wrap.cpp | 30 +- wxPython/src/helpers.cpp | 13 +- wxPython/src/mac/calendar_wrap.cpp | 14 +- wxPython/src/mac/controls.py | 18 +- wxPython/src/mac/controls_wrap.cpp | 101 +- wxPython/src/mac/core_wrap.cpp | 34 +- wxPython/src/mac/gdi_wrap.cpp | 46 +- wxPython/src/mac/grid_wrap.cpp | 59 +- wxPython/src/mac/html_wrap.cpp | 59 +- wxPython/src/mac/misc_wrap.cpp | 34 +- wxPython/src/mac/windows.py | 412 +- wxPython/src/mac/windows_wrap.cpp | 1205 +++++- wxPython/src/mac/wizard_wrap.cpp | 30 +- wxPython/src/msw/calendar_wrap.cpp | 14 +- wxPython/src/msw/controls.py | 18 +- wxPython/src/msw/controls_wrap.cpp | 101 +- wxPython/src/msw/core_wrap.cpp | 34 +- wxPython/src/msw/gdi_wrap.cpp | 46 +- wxPython/src/msw/grid_wrap.cpp | 59 +- wxPython/src/msw/html.py | 4 + wxPython/src/msw/html_wrap.cpp | 86 +- wxPython/src/msw/misc_wrap.cpp | 34 +- wxPython/src/msw/windows.py | 413 +- wxPython/src/msw/windows_wrap.cpp | 1205 +++++- wxPython/src/msw/wizard_wrap.cpp | 30 +- wxPython/src/my_typemaps.i | 56 + wxPython/wx/build/.cvsignore | 1 + wxPython/wx/py/editwindow.py | 66 +- wxPython/wxPython/controls.py | 1 + wxPython/wxPython/windows.py | 5 + 554 files changed, 7305 insertions(+), 128599 deletions(-) delete mode 100644 contrib/build/animate/animate_animatedll.dsp delete mode 100644 contrib/build/animate/animate_animatelib.dsp delete mode 100644 contrib/build/fl/fl_fldll.dsp delete mode 100644 contrib/build/fl/fl_fllib.dsp delete mode 100644 contrib/build/net/netutils.dsp delete mode 100644 contrib/build/ogl/ogl_ogldll.dsp delete mode 100644 contrib/build/ogl/ogl_ogllib.dsp delete mode 100644 contrib/build/stc/stc_stcdll.dsp delete mode 100644 contrib/build/stc/stc_stclib.dsp delete mode 100644 contrib/build/svg/svg_svgdll.dsp delete mode 100644 contrib/build/svg/svg_svglib.dsp delete mode 100644 demos/dbbrowse/makefile.gtk delete mode 100644 include/wx/mac/carbon/accel.h delete mode 100644 include/wx/mac/carbon/aga.h delete mode 100644 include/wx/mac/carbon/app.h delete mode 100644 include/wx/mac/carbon/apptbase.h delete mode 100644 include/wx/mac/carbon/apptrait.h delete mode 100644 include/wx/mac/carbon/bitmap.h delete mode 100644 include/wx/mac/carbon/bmpbuttn.h delete mode 100644 include/wx/mac/carbon/brush.h delete mode 100644 include/wx/mac/carbon/button.h delete mode 100644 include/wx/mac/carbon/checkbox.h delete mode 100644 include/wx/mac/carbon/checklst.h delete mode 100644 include/wx/mac/carbon/chkconf.h delete mode 100644 include/wx/mac/carbon/choice.h delete mode 100644 include/wx/mac/carbon/clipbrd.h delete mode 100644 include/wx/mac/carbon/colordlg.h delete mode 100644 include/wx/mac/carbon/colour.h delete mode 100644 include/wx/mac/carbon/combobox.h delete mode 100644 include/wx/mac/carbon/control.h delete mode 100644 include/wx/mac/carbon/cursor.h delete mode 100644 include/wx/mac/carbon/dataform.h delete mode 100644 include/wx/mac/carbon/dataobj.h delete mode 100644 include/wx/mac/carbon/dataobj2.h delete mode 100644 include/wx/mac/carbon/dc.h delete mode 100644 include/wx/mac/carbon/dcclient.h delete mode 100644 include/wx/mac/carbon/dcmemory.h delete mode 100644 include/wx/mac/carbon/dcprint.h delete mode 100644 include/wx/mac/carbon/dcscreen.h delete mode 100644 include/wx/mac/carbon/dialog.h delete mode 100644 include/wx/mac/carbon/dirdlg.h delete mode 100644 include/wx/mac/carbon/display.h delete mode 100644 include/wx/mac/carbon/dnd.h delete mode 100644 include/wx/mac/carbon/filedlg.h delete mode 100644 include/wx/mac/carbon/font.h delete mode 100644 include/wx/mac/carbon/fontdlg.h delete mode 100644 include/wx/mac/carbon/frame.h delete mode 100644 include/wx/mac/carbon/gauge.h delete mode 100644 include/wx/mac/carbon/gdiobj.h delete mode 100644 include/wx/mac/carbon/glcanvas.h delete mode 100644 include/wx/mac/carbon/gsockmac.h delete mode 100644 include/wx/mac/carbon/helpxxxx.h delete mode 100644 include/wx/mac/carbon/icon.h delete mode 100644 include/wx/mac/carbon/imaglist.h delete mode 100644 include/wx/mac/carbon/joystick.h delete mode 100644 include/wx/mac/carbon/listbox.h delete mode 100644 include/wx/mac/carbon/listctrl.h delete mode 100644 include/wx/mac/carbon/macnotfy.h delete mode 100644 include/wx/mac/carbon/macsock.h delete mode 100644 include/wx/mac/carbon/mdi.h delete mode 100644 include/wx/mac/carbon/menu.h delete mode 100644 include/wx/mac/carbon/menuitem.h delete mode 100644 include/wx/mac/carbon/metafile.h delete mode 100644 include/wx/mac/carbon/mimetype.h delete mode 100644 include/wx/mac/carbon/minifram.h delete mode 100644 include/wx/mac/carbon/msgdlg.h delete mode 100644 include/wx/mac/carbon/notebook.h delete mode 100644 include/wx/mac/carbon/palette.h delete mode 100644 include/wx/mac/carbon/pen.h delete mode 100644 include/wx/mac/carbon/pnghand.h delete mode 100644 include/wx/mac/carbon/pngread.h delete mode 100644 include/wx/mac/carbon/printdlg.h delete mode 100644 include/wx/mac/carbon/printmac.h delete mode 100644 include/wx/mac/carbon/private.h delete mode 100644 include/wx/mac/carbon/private/hid.h delete mode 100644 include/wx/mac/carbon/private/print.h delete mode 100644 include/wx/mac/carbon/radiobox.h delete mode 100644 include/wx/mac/carbon/radiobut.h delete mode 100644 include/wx/mac/carbon/region.h delete mode 100644 include/wx/mac/carbon/scrolbar.h delete mode 100644 include/wx/mac/carbon/setup.h delete mode 100644 include/wx/mac/carbon/setup0.h delete mode 100644 include/wx/mac/carbon/slider.h delete mode 100644 include/wx/mac/carbon/sound.h delete mode 100644 include/wx/mac/carbon/spinbutt.h delete mode 100755 include/wx/mac/carbon/spinctrl.h delete mode 100644 include/wx/mac/carbon/statbmp.h delete mode 100644 include/wx/mac/carbon/statbox.h delete mode 100644 include/wx/mac/carbon/statline.h delete mode 100644 include/wx/mac/carbon/stattext.h delete mode 100644 include/wx/mac/carbon/statusbr.h delete mode 100644 include/wx/mac/carbon/tabctrl.h delete mode 100644 include/wx/mac/carbon/taskbarosx.h delete mode 100644 include/wx/mac/carbon/textctrl.h delete mode 100644 include/wx/mac/carbon/tglbtn.h delete mode 100644 include/wx/mac/carbon/timer.h delete mode 100644 include/wx/mac/carbon/toolbar.h delete mode 100644 include/wx/mac/carbon/tooltip.h delete mode 100644 include/wx/mac/carbon/toplevel.h delete mode 100644 include/wx/mac/carbon/treectrl.h delete mode 100644 include/wx/mac/carbon/uma.h delete mode 100644 include/wx/mac/carbon/window.h delete mode 100644 include/wx/mac/classic/accel.h delete mode 100644 include/wx/mac/classic/aga.h delete mode 100644 include/wx/mac/classic/app.h delete mode 100644 include/wx/mac/classic/apptbase.h delete mode 100644 include/wx/mac/classic/apptrait.h delete mode 100644 include/wx/mac/classic/bitmap.h delete mode 100644 include/wx/mac/classic/bmpbuttn.h delete mode 100644 include/wx/mac/classic/brush.h delete mode 100644 include/wx/mac/classic/button.h delete mode 100644 include/wx/mac/classic/checkbox.h delete mode 100644 include/wx/mac/classic/checklst.h delete mode 100644 include/wx/mac/classic/chkconf.h delete mode 100644 include/wx/mac/classic/choice.h delete mode 100644 include/wx/mac/classic/clipbrd.h delete mode 100644 include/wx/mac/classic/colordlg.h delete mode 100644 include/wx/mac/classic/colour.h delete mode 100644 include/wx/mac/classic/combobox.h delete mode 100644 include/wx/mac/classic/control.h delete mode 100644 include/wx/mac/classic/cursor.h delete mode 100644 include/wx/mac/classic/dataform.h delete mode 100644 include/wx/mac/classic/dataobj.h delete mode 100644 include/wx/mac/classic/dataobj2.h delete mode 100644 include/wx/mac/classic/dc.h delete mode 100644 include/wx/mac/classic/dcclient.h delete mode 100644 include/wx/mac/classic/dcmemory.h delete mode 100644 include/wx/mac/classic/dcprint.h delete mode 100644 include/wx/mac/classic/dcscreen.h delete mode 100644 include/wx/mac/classic/dialog.h delete mode 100644 include/wx/mac/classic/dirdlg.h delete mode 100644 include/wx/mac/classic/display.h delete mode 100644 include/wx/mac/classic/dnd.h delete mode 100644 include/wx/mac/classic/filedlg.h delete mode 100644 include/wx/mac/classic/font.h delete mode 100644 include/wx/mac/classic/fontdlg.h delete mode 100644 include/wx/mac/classic/frame.h delete mode 100644 include/wx/mac/classic/gauge.h delete mode 100644 include/wx/mac/classic/gdiobj.h delete mode 100644 include/wx/mac/classic/glcanvas.h delete mode 100644 include/wx/mac/classic/gsockmac.h delete mode 100644 include/wx/mac/classic/helpxxxx.h delete mode 100644 include/wx/mac/classic/icon.h delete mode 100644 include/wx/mac/classic/imaglist.h delete mode 100644 include/wx/mac/classic/joystick.h delete mode 100644 include/wx/mac/classic/listbox.h delete mode 100644 include/wx/mac/classic/listctrl.h delete mode 100644 include/wx/mac/classic/macnotfy.h delete mode 100644 include/wx/mac/classic/macsock.h delete mode 100644 include/wx/mac/classic/mdi.h delete mode 100644 include/wx/mac/classic/menu.h delete mode 100644 include/wx/mac/classic/menuitem.h delete mode 100644 include/wx/mac/classic/metafile.h delete mode 100644 include/wx/mac/classic/mimetype.h delete mode 100644 include/wx/mac/classic/minifram.h delete mode 100644 include/wx/mac/classic/msgdlg.h delete mode 100644 include/wx/mac/classic/notebook.h delete mode 100644 include/wx/mac/classic/palette.h delete mode 100644 include/wx/mac/classic/pen.h delete mode 100644 include/wx/mac/classic/pnghand.h delete mode 100644 include/wx/mac/classic/pngread.h delete mode 100644 include/wx/mac/classic/printdlg.h delete mode 100644 include/wx/mac/classic/printmac.h delete mode 100644 include/wx/mac/classic/private.h delete mode 100644 include/wx/mac/classic/private/hid.h delete mode 100644 include/wx/mac/classic/private/print.h delete mode 100644 include/wx/mac/classic/radiobox.h delete mode 100644 include/wx/mac/classic/radiobut.h delete mode 100644 include/wx/mac/classic/region.h delete mode 100644 include/wx/mac/classic/scrolbar.h delete mode 100644 include/wx/mac/classic/setup.h delete mode 100644 include/wx/mac/classic/setup0.h delete mode 100644 include/wx/mac/classic/slider.h delete mode 100644 include/wx/mac/classic/sound.h delete mode 100644 include/wx/mac/classic/spinbutt.h delete mode 100755 include/wx/mac/classic/spinctrl.h delete mode 100644 include/wx/mac/classic/statbmp.h delete mode 100644 include/wx/mac/classic/statbox.h delete mode 100644 include/wx/mac/classic/statline.h delete mode 100644 include/wx/mac/classic/stattext.h delete mode 100644 include/wx/mac/classic/statusbr.h delete mode 100644 include/wx/mac/classic/tabctrl.h delete mode 100644 include/wx/mac/classic/taskbarosx.h delete mode 100644 include/wx/mac/classic/textctrl.h delete mode 100644 include/wx/mac/classic/tglbtn.h delete mode 100644 include/wx/mac/classic/timer.h delete mode 100644 include/wx/mac/classic/toolbar.h delete mode 100644 include/wx/mac/classic/tooltip.h delete mode 100644 include/wx/mac/classic/toplevel.h delete mode 100644 include/wx/mac/classic/treectrl.h delete mode 100644 include/wx/mac/classic/uma.h delete mode 100644 include/wx/mac/classic/window.h create mode 100644 lib/vms_gtk_univ.opt create mode 100644 samples/taskbar/mondrian.ico create mode 100644 samples/taskbar/mondrian.xpm create mode 100644 samples/taskbar/tbtest.rc delete mode 100644 samples/treectrl/treetest.dsp delete mode 100644 src/html/htmlfilter.cpp delete mode 100644 src/html/htmlhelp.cpp delete mode 100644 src/html/search.cpp delete mode 100644 src/mac/carbon/Info.plist.in delete mode 100644 src/mac/carbon/accel.cpp delete mode 100644 src/mac/carbon/aga.cpp delete mode 100644 src/mac/carbon/app.cpp delete mode 100644 src/mac/carbon/apprsrc.h delete mode 100644 src/mac/carbon/apprsrc.r delete mode 100644 src/mac/carbon/bitmap.cpp delete mode 100644 src/mac/carbon/bmpbuttn.cpp delete mode 100644 src/mac/carbon/brush.cpp delete mode 100644 src/mac/carbon/button.cpp delete mode 100644 src/mac/carbon/carbrsrc.r delete mode 100644 src/mac/carbon/checkbox.cpp delete mode 100644 src/mac/carbon/checklst.cpp delete mode 100644 src/mac/carbon/choice.cpp delete mode 100644 src/mac/carbon/clipbrd.cpp delete mode 100644 src/mac/carbon/colordlg.cpp delete mode 100644 src/mac/carbon/colour.cpp delete mode 100644 src/mac/carbon/combobox.cpp delete mode 100644 src/mac/carbon/control.cpp delete mode 100644 src/mac/carbon/corersrc.r delete mode 100644 src/mac/carbon/cursor.cpp delete mode 100644 src/mac/carbon/data.cpp delete mode 100644 src/mac/carbon/dataobj.cpp delete mode 100644 src/mac/carbon/dc.cpp delete mode 100644 src/mac/carbon/dcclient.cpp delete mode 100644 src/mac/carbon/dcmemory.cpp delete mode 100644 src/mac/carbon/dcprint.cpp delete mode 100644 src/mac/carbon/dcscreen.cpp delete mode 100644 src/mac/carbon/dialog.cpp delete mode 100644 src/mac/carbon/dirdlg.cpp delete mode 100644 src/mac/carbon/dirmac.cpp delete mode 100644 src/mac/carbon/display.cpp delete mode 100644 src/mac/carbon/dnd.cpp delete mode 100644 src/mac/carbon/filedlg.cpp delete mode 100644 src/mac/carbon/font.cpp delete mode 100644 src/mac/carbon/fontdlg.cpp delete mode 100644 src/mac/carbon/fontenum.cpp delete mode 100644 src/mac/carbon/fontutil.cpp delete mode 100644 src/mac/carbon/frame.cpp delete mode 100644 src/mac/carbon/gauge.cpp delete mode 100644 src/mac/carbon/gdiobj.cpp delete mode 100644 src/mac/carbon/glcanvas.cpp delete mode 100644 src/mac/carbon/gsocket.c delete mode 100644 src/mac/carbon/gsockosx.c delete mode 100644 src/mac/carbon/gsockosx.cpp delete mode 100644 src/mac/carbon/helpxxxx.cpp delete mode 100644 src/mac/carbon/hid.cpp delete mode 100644 src/mac/carbon/icon.cpp delete mode 100644 src/mac/carbon/joystick.cpp delete mode 100644 src/mac/carbon/listbox.cpp delete mode 100644 src/mac/carbon/macnotfy.cpp delete mode 100644 src/mac/carbon/main.cpp delete mode 100644 src/mac/carbon/mdi.cpp delete mode 100644 src/mac/carbon/menu.cpp delete mode 100644 src/mac/carbon/menuitem.cpp delete mode 100644 src/mac/carbon/metafile.cpp delete mode 100644 src/mac/carbon/mimetmac.cpp delete mode 100644 src/mac/carbon/minifram.cpp delete mode 100644 src/mac/carbon/msgdlg.cpp delete mode 100644 src/mac/carbon/notebmac.cpp delete mode 100644 src/mac/carbon/palette.cpp delete mode 100644 src/mac/carbon/pen.cpp delete mode 100644 src/mac/carbon/pnghand.cpp delete mode 100644 src/mac/carbon/printdlg.cpp delete mode 100644 src/mac/carbon/printmac.cpp delete mode 100644 src/mac/carbon/radiobox.cpp delete mode 100644 src/mac/carbon/radiobut.cpp delete mode 100644 src/mac/carbon/region.cpp delete mode 100644 src/mac/carbon/renderer.cpp delete mode 100644 src/mac/carbon/scrolbar.cpp delete mode 100644 src/mac/carbon/settings.cpp delete mode 100644 src/mac/carbon/slider.cpp delete mode 100644 src/mac/carbon/sound.cpp delete mode 100644 src/mac/carbon/spinbutt.cpp delete mode 100644 src/mac/carbon/spinctrl.cpp delete mode 100644 src/mac/carbon/statbmp.cpp delete mode 100644 src/mac/carbon/statbox.cpp delete mode 100644 src/mac/carbon/statbrma.cpp delete mode 100644 src/mac/carbon/statline.cpp delete mode 100644 src/mac/carbon/statlmac.cpp delete mode 100644 src/mac/carbon/stattext.cpp delete mode 100644 src/mac/carbon/tabctrl.cpp delete mode 100644 src/mac/carbon/textctrl.cpp delete mode 100644 src/mac/carbon/tglbtn.cpp delete mode 100644 src/mac/carbon/thread.cpp delete mode 100644 src/mac/carbon/timer.cpp delete mode 100644 src/mac/carbon/toolbar.cpp delete mode 100644 src/mac/carbon/tooltip.cpp delete mode 100644 src/mac/carbon/toplevel.cpp delete mode 100644 src/mac/carbon/treectrl.cpp delete mode 100644 src/mac/carbon/uma.cpp delete mode 100644 src/mac/carbon/utils.cpp delete mode 100644 src/mac/carbon/utilsexc.cpp delete mode 100644 src/mac/carbon/window.cpp delete mode 100644 src/mac/carbon/wxmac.icns delete mode 100644 src/mac/classic/Info.plist.in delete mode 100644 src/mac/classic/accel.cpp delete mode 100644 src/mac/classic/aga.cpp delete mode 100644 src/mac/classic/app.cpp delete mode 100644 src/mac/classic/apprsrc.h delete mode 100644 src/mac/classic/apprsrc.r delete mode 100644 src/mac/classic/bitmap.cpp delete mode 100644 src/mac/classic/bmpbuttn.cpp delete mode 100644 src/mac/classic/brush.cpp delete mode 100644 src/mac/classic/button.cpp delete mode 100644 src/mac/classic/carbrsrc.r delete mode 100644 src/mac/classic/checkbox.cpp delete mode 100644 src/mac/classic/checklst.cpp delete mode 100644 src/mac/classic/choice.cpp delete mode 100644 src/mac/classic/clipbrd.cpp delete mode 100644 src/mac/classic/colordlg.cpp delete mode 100644 src/mac/classic/colour.cpp delete mode 100644 src/mac/classic/combobox.cpp delete mode 100644 src/mac/classic/control.cpp delete mode 100644 src/mac/classic/corersrc.r delete mode 100644 src/mac/classic/cursor.cpp delete mode 100644 src/mac/classic/data.cpp delete mode 100644 src/mac/classic/dataobj.cpp delete mode 100644 src/mac/classic/dc.cpp delete mode 100644 src/mac/classic/dcclient.cpp delete mode 100644 src/mac/classic/dcmemory.cpp delete mode 100644 src/mac/classic/dcprint.cpp delete mode 100644 src/mac/classic/dcscreen.cpp delete mode 100644 src/mac/classic/dialog.cpp delete mode 100644 src/mac/classic/dirdlg.cpp delete mode 100644 src/mac/classic/dirmac.cpp delete mode 100644 src/mac/classic/display.cpp delete mode 100644 src/mac/classic/dnd.cpp delete mode 100644 src/mac/classic/filedlg.cpp delete mode 100644 src/mac/classic/font.cpp delete mode 100644 src/mac/classic/fontdlg.cpp delete mode 100644 src/mac/classic/fontenum.cpp delete mode 100644 src/mac/classic/fontutil.cpp delete mode 100644 src/mac/classic/frame.cpp delete mode 100644 src/mac/classic/gauge.cpp delete mode 100644 src/mac/classic/gdiobj.cpp delete mode 100644 src/mac/classic/glcanvas.cpp delete mode 100644 src/mac/classic/gsocket.c delete mode 100644 src/mac/classic/gsockosx.c delete mode 100644 src/mac/classic/gsockosx.cpp delete mode 100644 src/mac/classic/helpxxxx.cpp delete mode 100644 src/mac/classic/hid.cpp delete mode 100644 src/mac/classic/icon.cpp delete mode 100644 src/mac/classic/joystick.cpp delete mode 100644 src/mac/classic/listbox.cpp delete mode 100644 src/mac/classic/macnotfy.cpp delete mode 100644 src/mac/classic/main.cpp delete mode 100644 src/mac/classic/mdi.cpp delete mode 100644 src/mac/classic/menu.cpp delete mode 100644 src/mac/classic/menuitem.cpp delete mode 100644 src/mac/classic/metafile.cpp delete mode 100644 src/mac/classic/mimetmac.cpp delete mode 100644 src/mac/classic/minifram.cpp delete mode 100644 src/mac/classic/morefile/DirectoryCopy.c delete mode 100644 src/mac/classic/morefile/DirectoryCopy.h delete mode 100644 src/mac/classic/morefile/FSpCompat.c delete mode 100644 src/mac/classic/morefile/FSpCompat.h delete mode 100644 src/mac/classic/morefile/FileCopy.c delete mode 100644 src/mac/classic/morefile/FileCopy.h delete mode 100644 src/mac/classic/morefile/FullPath.c delete mode 100644 src/mac/classic/morefile/FullPath.h delete mode 100644 src/mac/classic/morefile/IterateDirectory.c delete mode 100644 src/mac/classic/morefile/IterateDirectory.h delete mode 100644 src/mac/classic/morefile/MoreDesktopMgr.c delete mode 100644 src/mac/classic/morefile/MoreDesktopMgr.h delete mode 100644 src/mac/classic/morefile/MoreFiles.c delete mode 100644 src/mac/classic/morefile/MoreFiles.h delete mode 100644 src/mac/classic/morefile/MoreFilesExtras.c delete mode 100644 src/mac/classic/morefile/MoreFilesExtras.h delete mode 100644 src/mac/classic/morefile/Optimization.h delete mode 100644 src/mac/classic/morefile/OptimizationEnd.h delete mode 100644 src/mac/classic/morefile/Search.c delete mode 100644 src/mac/classic/morefile/Search.h delete mode 100644 src/mac/classic/msgdlg.cpp delete mode 100644 src/mac/classic/notebmac.cpp delete mode 100644 src/mac/classic/palette.cpp delete mode 100644 src/mac/classic/pen.cpp delete mode 100644 src/mac/classic/pnghand.cpp delete mode 100644 src/mac/classic/printdlg.cpp delete mode 100644 src/mac/classic/printmac.cpp delete mode 100644 src/mac/classic/radiobox.cpp delete mode 100644 src/mac/classic/radiobut.cpp delete mode 100644 src/mac/classic/region.cpp delete mode 100644 src/mac/classic/renderer.cpp delete mode 100644 src/mac/classic/scrolbar.cpp delete mode 100644 src/mac/classic/settings.cpp delete mode 100644 src/mac/classic/slider.cpp delete mode 100644 src/mac/classic/sound.cpp delete mode 100644 src/mac/classic/spinbutt.cpp delete mode 100644 src/mac/classic/spinctrl.cpp delete mode 100644 src/mac/classic/statbmp.cpp delete mode 100644 src/mac/classic/statbox.cpp delete mode 100644 src/mac/classic/statbrma.cpp delete mode 100644 src/mac/classic/statline.cpp delete mode 100644 src/mac/classic/statlmac.cpp delete mode 100644 src/mac/classic/stattext.cpp delete mode 100644 src/mac/classic/tabctrl.cpp delete mode 100644 src/mac/classic/textctrl.cpp delete mode 100644 src/mac/classic/tglbtn.cpp delete mode 100644 src/mac/classic/thread.cpp delete mode 100644 src/mac/classic/timer.cpp delete mode 100644 src/mac/classic/toolbar.cpp delete mode 100644 src/mac/classic/tooltip.cpp delete mode 100644 src/mac/classic/toplevel.cpp delete mode 100644 src/mac/classic/treectrl.cpp delete mode 100644 src/mac/classic/uma.cpp delete mode 100644 src/mac/classic/utils.cpp delete mode 100644 src/mac/classic/utilsexc.cpp delete mode 100644 src/mac/classic/window.cpp delete mode 100644 src/mac/classic/wxmac.icns delete mode 100644 src/mac/corefoundation/gsockosx.cpp delete mode 100644 src/png/makefile.nt delete mode 100644 src/unix/net.cpp delete mode 100644 utils/HelpGen/helpgen.dsp delete mode 100644 utils/HelpGen/makefile.bcc delete mode 100644 utils/HelpGen/makefile.gcc delete mode 100644 utils/HelpGen/makefile.vc delete mode 100644 utils/HelpGen/makefile.wat delete mode 100644 utils/wxprop/src/prop.cpp delete mode 100644 wxPython/demo/NewNamespace.py delete mode 100644 wxPython/demo/data/wxPackage.html create mode 100644 wxPython/distrib/mac/wxPythonOSX/Info.icns create mode 100644 wxPython/docs/screenshots/PyShell.png delete mode 100644 wxPython/docs/screenshots/hello-linux.png delete mode 100644 wxPython/docs/screenshots/hello-mac.png delete mode 100644 wxPython/docs/screenshots/hello-win98.png delete mode 100644 wxPython/docs/wxPythonDocs.html delete mode 100644 wxPython/docs/wxPythonDocs.txt delete mode 100644 wxPython/docs/wxPythonExamples.html delete mode 100644 wxPython/docs/wxPythonExamples.txt delete mode 100644 wxPython/docs/wxPythonTutorial.html delete mode 100644 wxPython/docs/wxPythonTutorial.txt delete mode 100644 wxPython/samples/wx_examples/basic/__init__.py delete mode 100755 wxPython/samples/wx_examples/basic/app.py delete mode 100755 wxPython/samples/wx_examples/basic/frame.py delete mode 100644 wxPython/samples/wx_examples/hello/__init__.py delete mode 100755 wxPython/samples/wx_examples/hello/hello.py delete mode 100644 wxPython/samples/wx_examples/hello/wxPython.jpg create mode 100644 wxPython/wx/build/.cvsignore diff --git a/contrib/build/animate/animate_animatedll.dsp b/contrib/build/animate/animate_animatedll.dsp deleted file mode 100644 index f57686ce8e..0000000000 --- a/contrib/build/animate/animate_animatedll.dsp +++ /dev/null @@ -1,266 +0,0 @@ -# Microsoft Developer Studio Project File - Name="animatedll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=animatedll - Win32 DLL Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "animate_animatedll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "animate_animatedll.mak" CFG="animatedll - Win32 DLL Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "animatedll - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "animatedll - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "animatedll - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw250d_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw250d_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw250d_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw25d_animate.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw250d_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswddll\wxmsw25d_animate.lib" /debug - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswdll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw250_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswdll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw250_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswdll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswdll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw250_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswdll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw25_animate.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw250_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswdll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswdll\wxmsw25_animate.lib" - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswuddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw250ud_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswuddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw250ud_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswuddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswuddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw250ud_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw25ud_animate.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw250ud_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswuddll\wxmsw25ud_animate.lib" /debug - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswudll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw250u_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswudll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw250u_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswudll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswudll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw250u_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswudll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw25u_animate.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw250u_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswudll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswudll\wxmsw25u_animate.lib" - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_animate.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_animate.lib" /debug - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivdll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv250_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivdll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv250_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivdll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivdll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv250_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv25_animate.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv250_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivdll\wxmswuniv25_animate.lib" - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_animatedll.pch" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_animate.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_animate.lib" /debug - -!ELSEIF "$(CFG)" == "animatedll - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\animatedll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\animatedll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivudll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivudll" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_animatedll.pch" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_animate_vc_custom.pdb /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_ANIMATE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivudll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\animate\..\..\..\include" /i "..\..\src\animate\..\..\..\lib\vc_mswunivudll" /i "..\..\src\animate\..\..\..\src\tiff" /i "..\..\src\animate\..\..\..\src\jpeg" /i "..\..\src\animate\..\..\..\src\png" /i "..\..\src\animate\..\..\..\src\zlib" /i "..\..\src\animate\..\..\..\src\regex" /i "..\..\src\animate\..\..\..\src\expat\lib" /i "..\..\src\animate\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_ANIMATE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_animate.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_animate_vc_custom.dll" /libpath:"..\..\src\animate\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\animate\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_animate.lib" - -!ENDIF - -# Begin Target - -# Name "animatedll - Win32 DLL Debug" -# Name "animatedll - Win32 DLL Release" -# Name "animatedll - Win32 DLL Unicode Debug" -# Name "animatedll - Win32 DLL Unicode Release" -# Name "animatedll - Win32 DLL Universal Debug" -# Name "animatedll - Win32 DLL Universal Release" -# Name "animatedll - Win32 DLL Universal Unicode Debug" -# Name "animatedll - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/animate\animate.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/animate\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/animate/animate_animatelib.dsp b/contrib/build/animate/animate_animatelib.dsp deleted file mode 100644 index 29c5d673d9..0000000000 --- a/contrib/build/animate/animate_animatelib.dsp +++ /dev/null @@ -1,249 +0,0 @@ -# Microsoft Developer Studio Project File - Name="animatelib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=animatelib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "animate_animatelib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "animate_animatelib.mak" CFG="animatelib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "animatelib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "animatelib - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "animatelib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswd" -# PROP Intermediate_Dir "vc_mswd\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswd" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswd\wxmsw25d_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswd" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswd\wxmsw25d_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswd\wxmsw25d_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswd\wxmsw25d_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_msw" -# PROP Intermediate_Dir "vc_msw\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_msw" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_msw\wxmsw25_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_msw" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_msw\wxmsw25_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_msw\wxmsw25_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_msw\wxmsw25_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswud" -# PROP Intermediate_Dir "vc_mswud\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswud" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswud\wxmsw25ud_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswud" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswud\wxmsw25ud_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswud\wxmsw25ud_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswud\wxmsw25ud_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswu" -# PROP Intermediate_Dir "vc_mswu\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswu" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswu\wxmsw25u_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswu" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswu\wxmsw25u_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswu\wxmsw25u_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswu\wxmsw25u_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivd" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivd\wxmswuniv25d_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivd" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivd\wxmswuniv25d_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivd\wxmswuniv25d_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivd\wxmswuniv25d_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswuniv" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswuniv\wxmswuniv25_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswuniv" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswuniv\wxmswuniv25_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswuniv\wxmswuniv25_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswuniv\wxmswuniv25_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivud" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivud" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\animate\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_animate.lib" - -!ELSEIF "$(CFG)" == "animatelib - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\animatelib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\animate\..\..\..\lib\vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\animatelib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivu" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivu\wxmswuniv25u_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\animate\..\..\..\include" /I "..\..\src\animate\..\..\..\lib\vc_mswunivu" /I "..\..\src\animate\..\..\..\src\tiff" /I "..\..\src\animate\..\..\..\src\jpeg" /I "..\..\src\animate\..\..\..\src\png" /I "..\..\src\animate\..\..\..\src\zlib" /I "..\..\src\animate\..\..\..\src\regex" /I "..\..\src\animate\..\..\..\src\expat\lib" /Fd..\..\src\animate\..\..\..\lib\vc_mswunivu\wxmswuniv25u_animate.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_animatelib.pch" /I "..\..\src\animate\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivu\wxmswuniv25u_animate.lib" -# ADD LIB32 /nologo /out:"..\..\src\animate\..\..\..\lib\vc_mswunivu\wxmswuniv25u_animate.lib" - -!ENDIF - -# Begin Target - -# Name "animatelib - Win32 Debug" -# Name "animatelib - Win32 Release" -# Name "animatelib - Win32 Unicode Debug" -# Name "animatelib - Win32 Unicode Release" -# Name "animatelib - Win32 Universal Debug" -# Name "animatelib - Win32 Universal Release" -# Name "animatelib - Win32 Universal Unicode Debug" -# Name "animatelib - Win32 Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/animate\animate.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/animate\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/fl/fl_fldll.dsp b/contrib/build/fl/fl_fldll.dsp deleted file mode 100644 index 899e49dfe6..0000000000 --- a/contrib/build/fl/fl_fldll.dsp +++ /dev/null @@ -1,330 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fldll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fldll - Win32 DLL Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fl_fldll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fl_fldll.mak" CFG="fldll - Win32 DLL Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fldll - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fldll - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fldll - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw250d_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw250d_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw250d_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw25d_fl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw250d_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswddll\wxmsw25d_fl.lib" /debug - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswdll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw250_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswdll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw250_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswdll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswdll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw250_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswdll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw25_fl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw250_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswdll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswdll\wxmsw25_fl.lib" - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswuddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw250ud_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswuddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw250ud_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswuddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswuddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw250ud_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw25ud_fl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw250ud_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswuddll\wxmsw25ud_fl.lib" /debug - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswudll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw250u_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswudll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw250u_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswudll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswudll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw250u_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswudll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw25u_fl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw250u_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswudll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswudll\wxmsw25u_fl.lib" - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_fl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_fl.lib" /debug - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivdll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivdll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivdll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivdll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv25_fl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivdll\wxmswuniv25_fl.lib" - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_fldll.pch" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_fl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_fl.lib" /debug - -!ELSEIF "$(CFG)" == "fldll - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\fldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\fldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivudll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivudll" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_fldll.pch" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_fl_vc_custom.pdb /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_FL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivudll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\fl\..\..\..\include" /i "..\..\src\fl\..\..\..\lib\vc_mswunivudll" /i "..\..\src\fl\..\..\..\src\tiff" /i "..\..\src\fl\..\..\..\src\jpeg" /i "..\..\src\fl\..\..\..\src\png" /i "..\..\src\fl\..\..\..\src\zlib" /i "..\..\src\fl\..\..\..\src\regex" /i "..\..\src\fl\..\..\..\src\expat\lib" /i "..\..\src\fl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_FL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_fl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_fl_vc_custom.dll" /libpath:"..\..\src\fl\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\fl\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_fl.lib" - -!ENDIF - -# Begin Target - -# Name "fldll - Win32 DLL Debug" -# Name "fldll - Win32 DLL Release" -# Name "fldll - Win32 DLL Unicode Debug" -# Name "fldll - Win32 DLL Unicode Release" -# Name "fldll - Win32 DLL Universal Debug" -# Name "fldll - Win32 DLL Universal Release" -# Name "fldll - Win32 DLL Universal Unicode Debug" -# Name "fldll - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/fl\antiflickpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\bardragpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\barhintspl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\cbcustom.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\controlbar.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - -SOURCE=../../src/fl\dyntbar.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\dyntbarhnd.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\frmview.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\garbagec.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\gcupdatesmgr.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\hintanimpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\newbmpbtn.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\panedrawpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\rowdragpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\rowlayoutpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\toolwnd.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\updatesmgr.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/fl/fl_fllib.dsp b/contrib/build/fl/fl_fllib.dsp deleted file mode 100644 index cb52972bba..0000000000 --- a/contrib/build/fl/fl_fllib.dsp +++ /dev/null @@ -1,313 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fllib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=fllib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fl_fllib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fl_fllib.mak" CFG="fllib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fllib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "fllib - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fllib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswd" -# PROP Intermediate_Dir "vc_mswd\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswd" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswd\wxmsw25d_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswd" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswd\wxmsw25d_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswd\wxmsw25d_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswd\wxmsw25d_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_msw" -# PROP Intermediate_Dir "vc_msw\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_msw" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_msw\wxmsw25_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_msw" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_msw\wxmsw25_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_msw\wxmsw25_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_msw\wxmsw25_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswud" -# PROP Intermediate_Dir "vc_mswud\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswud" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswud\wxmsw25ud_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswud" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswud\wxmsw25ud_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswud\wxmsw25ud_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswud\wxmsw25ud_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswu" -# PROP Intermediate_Dir "vc_mswu\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswu" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswu\wxmsw25u_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswu" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswu\wxmsw25u_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswu\wxmsw25u_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswu\wxmsw25u_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivd" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivd" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswuniv" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswuniv\wxmswuniv25_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswuniv" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswuniv\wxmswuniv25_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswuniv\wxmswuniv25_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswuniv\wxmswuniv25_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivud" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivud" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\fl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_fl.lib" - -!ELSEIF "$(CFG)" == "fllib - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\fllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\fl\..\..\..\lib\vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\fllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivu" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\fl\..\..\..\include" /I "..\..\src\fl\..\..\..\lib\vc_mswunivu" /I "..\..\src\fl\..\..\..\src\tiff" /I "..\..\src\fl\..\..\..\src\jpeg" /I "..\..\src\fl\..\..\..\src\png" /I "..\..\src\fl\..\..\..\src\zlib" /I "..\..\src\fl\..\..\..\src\regex" /I "..\..\src\fl\..\..\..\src\expat\lib" /Fd..\..\src\fl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_fl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_fllib.pch" /I "..\..\src\fl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_fl.lib" -# ADD LIB32 /nologo /out:"..\..\src\fl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_fl.lib" - -!ENDIF - -# Begin Target - -# Name "fllib - Win32 Debug" -# Name "fllib - Win32 Release" -# Name "fllib - Win32 Unicode Debug" -# Name "fllib - Win32 Unicode Release" -# Name "fllib - Win32 Universal Debug" -# Name "fllib - Win32 Universal Release" -# Name "fllib - Win32 Universal Unicode Debug" -# Name "fllib - Win32 Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/fl\antiflickpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\bardragpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\barhintspl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\cbcustom.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\controlbar.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - -SOURCE=../../src/fl\dyntbar.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\dyntbarhnd.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\frmview.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\garbagec.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\gcupdatesmgr.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\hintanimpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\newbmpbtn.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\panedrawpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\rowdragpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\rowlayoutpl.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\toolwnd.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/fl\updatesmgr.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/net/netutils.dsp b/contrib/build/net/netutils.dsp deleted file mode 100644 index 14e8e27738..0000000000 --- a/contrib/build/net/netutils.dsp +++ /dev/null @@ -1,474 +0,0 @@ -# Microsoft Developer Studio Project File - Name="netutils" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=netutils - Win32 DLL Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "netutils.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "netutils.mak" CFG="netutils - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "netutils - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "netutils - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "netutils - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "netutils - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswd\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswd\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswd" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25d_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswd" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25d_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25d_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25d_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_msw\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_msw\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\msw" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\msw" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswud\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswud\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswud" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25ud_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswud" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25ud_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25ud_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25ud_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswu\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswu\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswu" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25u_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswu" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmsw25u_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "_UNICODE" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25u_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmsw25u_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswunivd\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswunivd\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivd" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25d_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivd" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25d_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25d_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25d_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswuniv\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswuniv\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswuniv" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswuniv" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswunivud\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswunivud\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivud" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25ud_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivud" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25ud_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25ud_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25ud_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP BASE Intermediate_Dir "vc_mswunivu\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_lib" -# PROP Intermediate_Dir "vc_mswunivu\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivu" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25u_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_lib\mswunivu" /Fd..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25u_netutils.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_netutilslib.pch" /I "..\..\src\net\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25u_netutils.lib" -# ADD LIB32 /nologo /out:"..\..\src\net\..\..\..\lib\vc_lib\wxmswuniv25u_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswddll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswddll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswd" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250d_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswd" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250d_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswd" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswd" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250d_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25d_netutils.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250d_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25d_netutils.lib" /debug - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswdll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswdll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\msw" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\msw" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\msw" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\msw" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25_netutils.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswuddll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswuddll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswud" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250ud_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswud" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250ud_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswud" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswud" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250ud_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25ud_netutils.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250ud_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25ud_netutils.lib" /debug - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswudll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswudll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswu" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250u_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswu" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmsw250u_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswu" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswu" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250u_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25u_netutils.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw250u_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmsw25u_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswunivddll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivd" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250d_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivd" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250d_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivd" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivd" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250d_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25d_netutils.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250d_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25d_netutils.lib" /debug - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswunivdll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswuniv" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswuniv" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswuniv" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswuniv" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25_netutils.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25_netutils.lib" - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswunivuddll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivud" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250ud_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MDd /Od /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivud" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_netutilsdll.pch" /Zi /Gm /GZ /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250ud_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivud" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivud" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250ud_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25ud_netutils.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250ud_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25ud_netutils.lib" /debug - -!ELSEIF "$(CFG)" == "netutils - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\netutils" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\net\..\..\..\lib\vc_dll" -# PROP Intermediate_Dir "vc_mswunivudll\netutils" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivu" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250u_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD CPP /nologo /FD /W4 /GR /GX /MD /O1 /I "..\..\src\net\..\..\..\include" /I "..\..\src\net\..\..\..\lib\vc_dll\mswunivu" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_netutilsdll.pch" /Fd..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250u_netutils_vc_custom.pdb /I "..\..\src\net\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "WXMAKINGDLL_NETUTILS" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivu" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i "..\..\src\net\..\..\..\include" /i "..\..\src\net\..\..\..\lib\vc_dll\mswunivu" /i "..\..\src\net\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_NETUTILS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250u_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25u_netutils.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv250u_netutils_vc_custom.dll" /libpath:"..\..\src\net\..\..\..\lib\vc_dll" /implib:"..\..\src\net\..\..\..\lib\vc_dll\wxmswuniv25u_netutils.lib" - -!ENDIF - -# Begin Target - -# Name "netutils - Win32 Debug" -# Name "netutils - Win32 Release" -# Name "netutils - Win32 Unicode Debug" -# Name "netutils - Win32 Unicode Release" -# Name "netutils - Win32 Universal Debug" -# Name "netutils - Win32 Universal Release" -# Name "netutils - Win32 Universal Unicode Debug" -# Name "netutils - Win32 Universal Unicode Release" -# Name "netutils - Win32 DLL Debug" -# Name "netutils - Win32 DLL Release" -# Name "netutils - Win32 DLL Unicode Debug" -# Name "netutils - Win32 DLL Unicode Release" -# Name "netutils - Win32 DLL Universal Debug" -# Name "netutils - Win32 DLL Universal Release" -# Name "netutils - Win32 DLL Universal Unicode Debug" -# Name "netutils - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/net\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - -SOURCE=../../src/net\email.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/net\smapi.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/net\web.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/ogl/ogl_ogldll.dsp b/contrib/build/ogl/ogl_ogldll.dsp deleted file mode 100644 index 5dfa984e7d..0000000000 --- a/contrib/build/ogl/ogl_ogldll.dsp +++ /dev/null @@ -1,310 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ogldll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ogldll - Win32 DLL Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ogl_ogldll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ogl_ogldll.mak" CFG="ogldll - Win32 DLL Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ogldll - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ogldll - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ogldll - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw250d_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw250d_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw250d_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw25d_ogl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw250d_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswddll\wxmsw25d_ogl.lib" /debug - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswdll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw250_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswdll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw250_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswdll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswdll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw250_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswdll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw25_ogl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw250_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswdll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswdll\wxmsw25_ogl.lib" - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswuddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw250ud_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswuddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw250ud_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswuddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswuddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw250ud_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw25ud_ogl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw250ud_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswuddll\wxmsw25ud_ogl.lib" /debug - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswudll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw250u_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswudll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw250u_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswudll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswudll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw250u_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswudll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw25u_ogl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw250u_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswudll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswudll\wxmsw25u_ogl.lib" - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_ogl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_ogl.lib" /debug - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv25_ogl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv250_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivdll\wxmswuniv25_ogl.lib" - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_ogldll.pch" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_ogl.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_ogl.lib" /debug - -!ELSEIF "$(CFG)" == "ogldll - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\ogldll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\ogldll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_ogldll.pch" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_ogl_vc_custom.pdb /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_OGL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\ogl\..\..\..\include" /i "..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /i "..\..\src\ogl\..\..\..\src\tiff" /i "..\..\src\ogl\..\..\..\src\jpeg" /i "..\..\src\ogl\..\..\..\src\png" /i "..\..\src\ogl\..\..\..\src\zlib" /i "..\..\src\ogl\..\..\..\src\regex" /i "..\..\src\ogl\..\..\..\src\expat\lib" /i "..\..\src\ogl\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_OGL -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_ogl.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_ogl_vc_custom.dll" /libpath:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\ogl\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_ogl.lib" - -!ENDIF - -# Begin Target - -# Name "ogldll - Win32 DLL Debug" -# Name "ogldll - Win32 DLL Release" -# Name "ogldll - Win32 DLL Unicode Debug" -# Name "ogldll - Win32 DLL Unicode Release" -# Name "ogldll - Win32 DLL Universal Debug" -# Name "ogldll - Win32 DLL Universal Release" -# Name "ogldll - Win32 DLL Universal Unicode Debug" -# Name "ogldll - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/ogl\basic.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\basic2.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\bmpshape.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\canvas.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\composit.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\constrnt.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\divided.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\drawn.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\lines.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\mfutils.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\ogldiag.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\oglmisc.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/ogl/ogl_ogllib.dsp b/contrib/build/ogl/ogl_ogllib.dsp deleted file mode 100644 index f15f18d6f9..0000000000 --- a/contrib/build/ogl/ogl_ogllib.dsp +++ /dev/null @@ -1,293 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ogllib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=ogllib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ogl_ogllib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ogl_ogllib.mak" CFG="ogllib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ogllib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "ogllib - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ogllib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswd" -# PROP Intermediate_Dir "vc_mswd\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswd" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswd\wxmsw25d_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswd" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswd\wxmsw25d_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswd\wxmsw25d_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswd\wxmsw25d_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_msw" -# PROP Intermediate_Dir "vc_msw\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_msw" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_msw\wxmsw25_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_msw" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_msw\wxmsw25_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_msw\wxmsw25_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_msw\wxmsw25_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswud" -# PROP Intermediate_Dir "vc_mswud\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswud" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswud\wxmsw25ud_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswud" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswud\wxmsw25ud_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswud\wxmsw25ud_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswud\wxmsw25ud_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswu" -# PROP Intermediate_Dir "vc_mswu\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswu" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswu\wxmsw25u_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswu" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswu\wxmsw25u_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswu\wxmsw25u_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswu\wxmsw25u_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivd" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivd" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivd\wxmswuniv25d_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswuniv" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswuniv\wxmswuniv25_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswuniv" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswuniv\wxmswuniv25_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswuniv\wxmswuniv25_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswuniv\wxmswuniv25_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivud" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivud" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_ogl.lib" - -!ELSEIF "$(CFG)" == "ogllib - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\ogllib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\ogl\..\..\..\lib\vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\ogllib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivu" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\ogl\..\..\..\include" /I "..\..\src\ogl\..\..\..\lib\vc_mswunivu" /I "..\..\src\ogl\..\..\..\src\tiff" /I "..\..\src\ogl\..\..\..\src\jpeg" /I "..\..\src\ogl\..\..\..\src\png" /I "..\..\src\ogl\..\..\..\src\zlib" /I "..\..\src\ogl\..\..\..\src\regex" /I "..\..\src\ogl\..\..\..\src\expat\lib" /Fd..\..\src\ogl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_ogl.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_ogllib.pch" /I "..\..\src\ogl\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_ogl.lib" -# ADD LIB32 /nologo /out:"..\..\src\ogl\..\..\..\lib\vc_mswunivu\wxmswuniv25u_ogl.lib" - -!ENDIF - -# Begin Target - -# Name "ogllib - Win32 Debug" -# Name "ogllib - Win32 Release" -# Name "ogllib - Win32 Unicode Debug" -# Name "ogllib - Win32 Unicode Release" -# Name "ogllib - Win32 Universal Debug" -# Name "ogllib - Win32 Universal Release" -# Name "ogllib - Win32 Universal Unicode Debug" -# Name "ogllib - Win32 Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/ogl\basic.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\basic2.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\bmpshape.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\canvas.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\composit.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\constrnt.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\divided.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\drawn.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\lines.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\mfutils.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\ogldiag.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/ogl\oglmisc.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/stc/stc_stcdll.dsp b/contrib/build/stc/stc_stcdll.dsp deleted file mode 100644 index 6c609728c8..0000000000 --- a/contrib/build/stc/stc_stcdll.dsp +++ /dev/null @@ -1,452 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stcdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=stcdll - Win32 DLL Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "stc_stcdll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "stc_stcdll.mak" CFG="stcdll - Win32 DLL Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "stcdll - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "stcdll - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "stcdll - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw250d_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw250d_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw250d_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw25d_stc.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw250d_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswddll\wxmsw25d_stc.lib" /debug - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswdll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw250_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswdll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw250_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswdll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswdll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw250_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswdll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw25_stc.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw250_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswdll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswdll\wxmsw25_stc.lib" - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswuddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw250ud_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswuddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw250ud_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswuddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswuddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw250ud_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw25ud_stc.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw250ud_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswuddll\wxmsw25ud_stc.lib" /debug - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswudll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw250u_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswudll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw250u_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswudll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswudll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw250u_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswudll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw25u_stc.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw250u_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswudll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswudll\wxmsw25u_stc.lib" - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_stc.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_stc.lib" /debug - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivdll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv250_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivdll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv250_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivdll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivdll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv250_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv25_stc.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv250_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivdll\wxmswuniv25_stc.lib" - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_stc.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_stc.lib" /debug - -!ELSEIF "$(CFG)" == "stcdll - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\stcdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\stcdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivudll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivudll" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_stc_vc_custom.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /D "WXUSINGDLL" /D "WXMAKINGDLL_STC" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivudll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\stc\..\..\..\include" /i "..\..\src\stc\..\..\..\lib\vc_mswunivudll" /i "..\..\src\stc\..\..\..\src\tiff" /i "..\..\src\stc\..\..\..\src\jpeg" /i "..\..\src\stc\..\..\..\src\png" /i "..\..\src\stc\..\..\..\src\zlib" /i "..\..\src\stc\..\..\..\src\regex" /i "..\..\src\stc\..\..\..\src\expat\lib" /i "..\..\src\stc\..\..\include" /i "..\..\src\stc\scintilla\include" /i "..\..\src\stc\scintilla\src" /d "__WX__" /d "SCI_LEXER" /d "LINK_LEXERS" /d "WXUSINGDLL" /d WXMAKINGDLL_STC -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_stc.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_stc_vc_custom.dll" /libpath:"..\..\src\stc\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\stc\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_stc.lib" - -!ENDIF - -# Begin Target - -# Name "stcdll - Win32 DLL Debug" -# Name "stcdll - Win32 DLL Release" -# Name "stcdll - Win32 DLL Unicode Debug" -# Name "stcdll - Win32 DLL Unicode Release" -# Name "stcdll - Win32 DLL Universal Debug" -# Name "stcdll - Win32 DLL Universal Release" -# Name "stcdll - Win32 DLL Universal Unicode Debug" -# Name "stcdll - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\AutoComplete.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\CallTip.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\CellBuffer.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ContractionState.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Document.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\DocumentAccessor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Editor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ExternalLexer.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Indicator.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\KeyMap.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\KeyWords.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAVE.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAda.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAsm.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexBaan.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexBullant.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCPP.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCSS.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexConf.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCrontab.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexEScript.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexEiffel.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexFortran.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexHTML.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLisp.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLout.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLua.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexMatlab.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexOthers.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPOV.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPascal.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPerl.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPython.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexRuby.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexSQL.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexVB.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LineMarker.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\PlatWX.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\PropSet.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\RESearch.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ScintillaBase.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\ScintillaWX.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Style.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\StyleContext.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\UniConversion.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ViewStyle.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\WindowAccessor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\XPM.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\stc.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/stc/stc_stclib.dsp b/contrib/build/stc/stc_stclib.dsp deleted file mode 100644 index 5e90a35aa0..0000000000 --- a/contrib/build/stc/stc_stclib.dsp +++ /dev/null @@ -1,435 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stclib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=stclib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "stc_stclib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "stc_stclib.mak" CFG="stclib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "stclib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "stclib - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "stclib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswd" -# PROP Intermediate_Dir "vc_mswd\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswd" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswd\wxmsw25d_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswd" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswd\wxmsw25d_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswd\wxmsw25d_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswd\wxmsw25d_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_msw" -# PROP Intermediate_Dir "vc_msw\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_msw" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_msw\wxmsw25_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_msw" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_msw\wxmsw25_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_msw\wxmsw25_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_msw\wxmsw25_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswud" -# PROP Intermediate_Dir "vc_mswud\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswud" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswud\wxmsw25ud_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswud" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswud\wxmsw25ud_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswud\wxmsw25ud_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswud\wxmsw25ud_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswu" -# PROP Intermediate_Dir "vc_mswu\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswu" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswu\wxmsw25u_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswu" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswu\wxmsw25u_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswu\wxmsw25u_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswu\wxmsw25u_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivd" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivd\wxmswuniv25d_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivd" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivd\wxmswuniv25d_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivd\wxmswuniv25d_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivd\wxmswuniv25d_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswuniv" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswuniv\wxmswuniv25_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswuniv" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswuniv\wxmswuniv25_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswuniv\wxmswuniv25_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswuniv\wxmswuniv25_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivud" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivud" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\stc\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_stc.lib" - -!ELSEIF "$(CFG)" == "stclib - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\stclib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\stc\..\..\..\lib\vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\stclib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivu" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivu\wxmswuniv25u_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\stc\..\..\..\include" /I "..\..\src\stc\..\..\..\lib\vc_mswunivu" /I "..\..\src\stc\..\..\..\src\tiff" /I "..\..\src\stc\..\..\..\src\jpeg" /I "..\..\src\stc\..\..\..\src\png" /I "..\..\src\stc\..\..\..\src\zlib" /I "..\..\src\stc\..\..\..\src\regex" /I "..\..\src\stc\..\..\..\src\expat\lib" /Fd..\..\src\stc\..\..\..\lib\vc_mswunivu\wxmswuniv25u_stc.pdb /I "..\..\src\stc\..\..\include" /I "..\..\src\stc\scintilla\include" /I "..\..\src\stc\scintilla\src" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "__WX__" /D "SCI_LEXER" /D "LINK_LEXERS" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivu\wxmswuniv25u_stc.lib" -# ADD LIB32 /nologo /out:"..\..\src\stc\..\..\..\lib\vc_mswunivu\wxmswuniv25u_stc.lib" - -!ENDIF - -# Begin Target - -# Name "stclib - Win32 Debug" -# Name "stclib - Win32 Release" -# Name "stclib - Win32 Unicode Debug" -# Name "stclib - Win32 Unicode Release" -# Name "stclib - Win32 Universal Debug" -# Name "stclib - Win32 Universal Release" -# Name "stclib - Win32 Universal Unicode Debug" -# Name "stclib - Win32 Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\AutoComplete.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\CallTip.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\CellBuffer.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ContractionState.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Document.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\DocumentAccessor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Editor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ExternalLexer.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Indicator.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\KeyMap.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\KeyWords.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAVE.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAda.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexAsm.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexBaan.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexBullant.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCPP.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCSS.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexConf.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexCrontab.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexEScript.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexEiffel.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexFortran.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexHTML.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLisp.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLout.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexLua.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexMatlab.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexOthers.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPOV.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPascal.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPerl.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexPython.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexRuby.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexSQL.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LexVB.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\LineMarker.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\PlatWX.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\PropSet.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\RESearch.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ScintillaBase.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\ScintillaWX.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\Style.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\StyleContext.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\UniConversion.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\ViewStyle.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\WindowAccessor.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\scintilla\src\XPM.cxx -# End Source File -# Begin Source File - -SOURCE=../../src/stc\stc.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/svg/svg_svgdll.dsp b/contrib/build/svg/svg_svgdll.dsp deleted file mode 100644 index 867f3db1b8..0000000000 --- a/contrib/build/svg/svg_svgdll.dsp +++ /dev/null @@ -1,266 +0,0 @@ -# Microsoft Developer Studio Project File - Name="svgdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=svgdll - Win32 DLL Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "svg_svgdll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "svg_svgdll.mak" CFG="svgdll - Win32 DLL Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "svgdll - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Universal Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Universal Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "svgdll - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "svgdll - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw250d_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw250d_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw250d_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw25d_svg.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw250d_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswddll\wxmsw25d_svg.lib" /debug - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswdll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw250_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswdll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswdll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw250_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswdll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "__WXMSW__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswdll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw250_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswdll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw25_svg.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw250_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswdll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswdll\wxmsw25_svg.lib" - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswuddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw250ud_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswuddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswuddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw250ud_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswuddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswuddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw250ud_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw25ud_svg.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw250ud_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswuddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswuddll\wxmsw25ud_svg.lib" /debug - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswudll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw250u_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswudll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswudll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw250u_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswudll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "__WXMSW__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswudll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw250u_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswudll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw25u_svg.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmsw25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw250u_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswudll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswudll\wxmsw25u_svg.lib" - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_svg.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25d_core.lib wxbase25d.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv250d_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivddll\wxmswuniv25d_svg.lib" /debug - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivdll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv250_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivdll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivdll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv250_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivdll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivdll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv250_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv25_svg.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25_core.lib wxbase25.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv250_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivdll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivdll\wxmswuniv25_svg.lib" - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivuddll\wxprec_svgdll.pch" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_svg.lib" /debug -# ADD LINK32 wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25ud_core.lib wxbase25ud.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv250ud_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivuddll\wxmswuniv25ud_svg.lib" /debug - -!ELSEIF "$(CFG)" == "svgdll - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\svgdll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\svgdll" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivudll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivudll" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Yu"wx/wxprec.h" /Fp"vc_mswunivudll\wxprec_svgdll.pch" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_svg_vc_custom.pdb /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /D "WXUSINGDLL" /D "WXMAKINGDLL_SVG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivudll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d wxUSE_UNICODE=1 /i "..\..\src\svg\..\..\..\include" /i "..\..\src\svg\..\..\..\lib\vc_mswunivudll" /i "..\..\src\svg\..\..\..\src\tiff" /i "..\..\src\svg\..\..\..\src\jpeg" /i "..\..\src\svg\..\..\..\src\png" /i "..\..\src\svg\..\..\..\src\zlib" /i "..\..\src\svg\..\..\..\src\regex" /i "..\..\src\svg\..\..\..\src\expat\lib" /i "..\..\src\svg\..\..\include" /d "WXUSINGDLL" /d WXMAKINGDLL_SVG -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_svg.lib" -# ADD LINK32 wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wxmswuniv25u_core.lib wxbase25u.lib /nologo /dll /machine:i386 /out:"..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv250u_svg_vc_custom.dll" /libpath:"..\..\src\svg\..\..\..\lib\vc_mswunivudll" /implib:"..\..\src\svg\..\..\..\lib\vc_mswunivudll\wxmswuniv25u_svg.lib" - -!ENDIF - -# Begin Target - -# Name "svgdll - Win32 DLL Debug" -# Name "svgdll - Win32 DLL Release" -# Name "svgdll - Win32 DLL Unicode Debug" -# Name "svgdll - Win32 DLL Unicode Release" -# Name "svgdll - Win32 DLL Universal Debug" -# Name "svgdll - Win32 DLL Universal Release" -# Name "svgdll - Win32 DLL Universal Unicode Debug" -# Name "svgdll - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/svg\dcsvg.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/svg\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/build/svg/svg_svglib.dsp b/contrib/build/svg/svg_svglib.dsp deleted file mode 100644 index 135662f173..0000000000 --- a/contrib/build/svg/svg_svglib.dsp +++ /dev/null @@ -1,249 +0,0 @@ -# Microsoft Developer Studio Project File - Name="svglib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=svglib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "svg_svglib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "svg_svglib.mak" CFG="svglib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "svglib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Universal Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Universal Release" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Universal Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "svglib - Win32 Universal Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "svglib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswd" -# PROP Intermediate_Dir "vc_mswd\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswd" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswd\wxmsw25d_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswd" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswd\wxmsw25d_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswd\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswd\wxmsw25d_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswd\wxmsw25d_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_msw" -# PROP Intermediate_Dir "vc_msw\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_msw" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_msw\wxmsw25_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_msw" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_msw\wxmsw25_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_msw\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_msw\wxmsw25_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_msw\wxmsw25_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswud" -# PROP Intermediate_Dir "vc_mswud\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswud" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswud\wxmsw25ud_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswud" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswud\wxmsw25ud_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswud\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswud\wxmsw25ud_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswud\wxmsw25ud_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswu" -# PROP Intermediate_Dir "vc_mswu\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswu" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswu\wxmsw25u_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswu" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswu\wxmsw25u_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswu\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswu\wxmsw25u_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswu\wxmsw25u_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivd" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivd\wxmswuniv25d_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivd" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivd\wxmswuniv25d_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivd\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivd\wxmswuniv25d_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivd\wxmswuniv25d_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswuniv" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswuniv\wxmswuniv25_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswuniv" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswuniv\wxmswuniv25_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswuniv\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswuniv\wxmswuniv25_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswuniv\wxmswuniv25_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivud" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MDd /Od /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivud" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Zi /Gm /GZ /Fd..\..\src\svg\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivud\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivud\wxmswuniv25ud_svg.lib" - -!ELSEIF "$(CFG)" == "svglib - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\svglib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\src\svg\..\..\..\lib\vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\svglib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivu" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivu\wxmswuniv25u_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD CPP /nologo /FD /W4 /MD /O1 /I "..\..\src\svg\..\..\..\include" /I "..\..\src\svg\..\..\..\lib\vc_mswunivu" /I "..\..\src\svg\..\..\..\src\tiff" /I "..\..\src\svg\..\..\..\src\jpeg" /I "..\..\src\svg\..\..\..\src\png" /I "..\..\src\svg\..\..\..\src\zlib" /I "..\..\src\svg\..\..\..\src\regex" /I "..\..\src\svg\..\..\..\src\expat\lib" /Fd..\..\src\svg\..\..\..\lib\vc_mswunivu\wxmswuniv25u_svg.pdb /Yu"wx/wxprec.h" /Fp"vc_mswunivu\wxprec_svglib.pch" /I "..\..\src\svg\..\..\include" /D "WIN32" /D "_LIB" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D wxUSE_UNICODE=1 /c -# ADD BASE RSC /l 0x405 -# ADD RSC /l 0x405 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivu\wxmswuniv25u_svg.lib" -# ADD LIB32 /nologo /out:"..\..\src\svg\..\..\..\lib\vc_mswunivu\wxmswuniv25u_svg.lib" - -!ENDIF - -# Begin Target - -# Name "svglib - Win32 Debug" -# Name "svglib - Win32 Release" -# Name "svglib - Win32 Unicode Debug" -# Name "svglib - Win32 Unicode Release" -# Name "svglib - Win32 Universal Debug" -# Name "svglib - Win32 Universal Release" -# Name "svglib - Win32 Universal Unicode Debug" -# Name "svglib - Win32 Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=../../src/svg\dcsvg.cpp -# End Source File -# Begin Source File - -SOURCE=../../src/svg\..\..\..\src\msw\dummy.cpp -# ADD BASE CPP /Yc"wx/wxprec.h" -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# End Group -# End Target -# End Project - diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index efedc9d763..c3a5c5a725 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -2549,8 +2549,10 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #if wxUSE_UNICODE wxMemoryBuffer buffer(len+1); success = (file.Read(buffer.GetData(), len) == len); - ((char*)buffer.GetData())[len] = 0; - contents = wxString(buffer, *wxConvCurrent); + if (success) { + ((char*)buffer.GetData())[len] = 0; + contents = wxString(buffer, *wxConvCurrent, len); + } #else wxString buffer; success = (file.Read(wxStringBuffer(buffer, len), len) == len); diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 473e08d38e..a859ec1a47 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -358,8 +358,10 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #if wxUSE_UNICODE wxMemoryBuffer buffer(len+1); success = (file.Read(buffer.GetData(), len) == len); - ((char*)buffer.GetData())[len] = 0; - contents = wxString(buffer, *wxConvCurrent); + if (success) { + ((char*)buffer.GetData())[len] = 0; + contents = wxString(buffer, *wxConvCurrent, len); + } #else wxString buffer; success = (file.Read(wxStringBuffer(buffer, len), len) == len); diff --git a/demos/dbbrowse/makefile.gtk b/demos/dbbrowse/makefile.gtk deleted file mode 100644 index cd8a960812..0000000000 --- a/demos/dbbrowse/makefile.gtk +++ /dev/null @@ -1,15 +0,0 @@ - -# Top dir of wxWindows -top_builddir = /gtm/bart/wxGTK - -PROGRAM=dbbrowser_gtk - - -OBJECTS= dbbrowse.o doc.o pgmctrl.o tabpgwin.o\ - browsedb.o dbtree.o dbgrid.o dlguser.o - - - - -include $(top_builddir)/src/makeprog.env - diff --git a/include/wx/mac/carbon/accel.h b/include/wx/mac/carbon/accel.h deleted file mode 100644 index 25acc73bea..0000000000 --- a/include/wx/mac/carbon/accel.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: accel.h -// Purpose: wxAcceleratorTable class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCEL_H_ -#define _WX_ACCEL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "accel.h" -#endif - -#include "wx/string.h" -#include "wx/event.h" - -class WXDLLEXPORT wxAcceleratorTable: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) -public: - wxAcceleratorTable(); - wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array - - // Copy constructors - wxAcceleratorTable(const wxAcceleratorTable& accel) - : wxObject() - { Ref(accel); } - wxAcceleratorTable(const wxAcceleratorTable* accel) - { if (accel) Ref(*accel); } - - ~wxAcceleratorTable(); - - wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) - { if (*this == accel) return (*this); Ref(accel); return *this; } - bool operator == (const wxAcceleratorTable& accel) - { return m_refData == accel.m_refData; } - bool operator != (const wxAcceleratorTable& accel) - { return m_refData != accel.m_refData; } - - bool Ok() const; - - int GetCommand( wxKeyEvent &event ); -}; - -// WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable; - -#endif - // _WX_ACCEL_H_ diff --git a/include/wx/mac/carbon/aga.h b/include/wx/mac/carbon/aga.h deleted file mode 100644 index 5868b3f8ee..0000000000 --- a/include/wx/mac/carbon/aga.h +++ /dev/null @@ -1,13 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: aga.h -// Purpose: Gray Controls implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// NOT NEEDED ANYMORE \ No newline at end of file diff --git a/include/wx/mac/carbon/app.h b/include/wx/mac/carbon/app.h deleted file mode 100644 index efc50cbea2..0000000000 --- a/include/wx/mac/carbon/app.h +++ /dev/null @@ -1,207 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.h -// Purpose: wxApp class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_APP_H_ -#define _WX_APP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "app.h" -#endif - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/gdicmn.h" -#include "wx/event.h" - -class WXDLLEXPORT wxFrame; -class WXDLLEXPORT wxWindowMac; -class WXDLLEXPORT wxApp ; -class WXDLLEXPORT wxKeyEvent; -class WXDLLEXPORT wxLog; - -#define wxPRINT_WINDOWS 1 -#define wxPRINT_POSTSCRIPT 2 - -WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; - -// Force an exit from main loop -void WXDLLEXPORT wxExit(); - -// Yield to other apps/messages -bool WXDLLEXPORT wxYield(); - -// Represents the application. Derive OnInit and declare -// a new App object to start application -class WXDLLEXPORT wxApp: public wxAppBase -{ - DECLARE_DYNAMIC_CLASS(wxApp) - - wxApp(); - virtual ~wxApp() {} - - virtual int MainLoop(); - virtual void ExitMainLoop(); - virtual bool Pending() ; - virtual bool Dispatch() ; - - virtual void Exit(); - - virtual bool Yield(bool onlyIfNeeded = FALSE); - virtual void WakeUpIdle(); - - virtual void SetPrintMode(int mode) { m_printMode = mode; } - virtual int GetPrintMode() const { return m_printMode; } - -#if wxUSE_GUI - // setting up all MacOS Specific Event-Handlers etc - virtual bool OnInitGui(); -#endif // wxUSE_GUI - // implementation only - void OnIdle(wxIdleEvent& event); - void OnEndSession(wxCloseEvent& event); - void OnQueryEndSession(wxCloseEvent& event); - - // Windows only, but for compatibility... - inline void SetAuto3D(bool flag) { m_auto3D = flag; } - inline bool GetAuto3D() const { return m_auto3D; } - -protected: - bool m_showOnInit; - int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT - bool m_auto3D ; // Always use 3D controls, except - // where overriden -public: - - static bool sm_isEmbedded; - // Implementation - virtual bool Initialize(int& argc, wxChar **argv); - virtual void CleanUp(); - - bool IsExiting() { return !m_keepGoing ; } -#if TARGET_CARBON - // the installed application event handler - WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } - WXEVENTHANDLERREF MacGetCurrentEventHandlerCallRef() { return m_macCurrentEventHandlerCallRef ; } - void MacSetCurrentEvent( WXEVENTREF event , WXEVENTHANDLERCALLREF handler ) - { m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; } -#endif - -public: - static long sm_lastMessageTime; - static wxWindow* s_captureWindow ; - static int s_lastMouseDown ; // 0 = none , 1 = left , 2 = right - static WXHRGN s_macCursorRgn ; - static long s_lastModifiers ; - - int m_nCmdShow; - -private: - bool m_keepGoing ; - - // mac specifics -#if TARGET_CARBON - WXEVENTHANDLERREF m_macEventHandler ; - WXEVENTHANDLERCALLREF m_macCurrentEventHandlerCallRef ; -#endif - WXEVENTREF m_macCurrentEvent ; - -public: - static bool s_macSupportPCMenuShortcuts ; - static long s_macAboutMenuItemId ; - static long s_macPreferencesMenuItemId ; - static long s_macExitMenuItemId ; - static wxString s_macHelpMenuTitleName ; - - static bool s_macHasAppearance ; - static long s_macAppearanceVersion ; - static bool s_macHasNavigation ; - static bool s_macNavigationVersion ; - static bool s_macHasWindowManager ; - static long s_macWindowManagerVersion ; - static bool s_macHasMenuManager ; - static long s_macMenuManagerVersion ; - static bool s_macHasDialogManager ; - static long s_macDialogManagerVersion ; - - WXHRGN m_macCursorRgn ; - WXHRGN m_macSleepRgn ; - WXHRGN m_macHelpRgn ; - - virtual void MacSuspend( bool convertClipboard ) ; - virtual void MacResume( bool convertClipboard ) ; - virtual void MacConvertPrivateToPublicScrap() ; - virtual void MacConvertPublicToPrivateScrap() ; - - void MacDoOneEvent() ; - WXEVENTREF MacGetCurrentEvent() { return m_macCurrentEvent ; } - void MacHandleOneEvent( WXEVENTREF ev ) ; - - // For embedded use. By default does nothing. - virtual void MacHandleUnhandledEvent( WXEVENTREF ev ); - -#if !TARGET_CARBON - virtual void MacHandleMenuSelect( int menuid , int menuitem ) ; - virtual void MacHandleMouseUpEvent( WXEVENTREF ev ) ; - virtual void MacHandleOSEvent( WXEVENTREF ev ) ; - virtual void MacHandleDiskEvent( WXEVENTREF ev ) ; - virtual void MacHandleActivateEvent( WXEVENTREF ev ) ; - virtual void MacHandleUpdateEvent( WXEVENTREF ev ) ; - virtual void MacHandleMouseDownEvent( WXEVENTREF ev ) ; - - void MacHandleModifierEvents( WXEVENTREF ev ) ; - - virtual void MacHandleKeyDownEvent( WXEVENTREF ev ) ; - virtual void MacHandleKeyUpEvent( WXEVENTREF ev ) ; - virtual void MacHandleHighLevelEvent( WXEVENTREF ev ) ; - -#else - virtual void MacHandleMouseMovedEvent( wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; -#endif - - void MacHandleMenuCommand( wxUint32 command ) ; - bool MacSendKeyDownEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ; - bool MacSendKeyUpEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ; - - virtual short MacHandleAEODoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEPDoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAERApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - - // in response of an open-document apple event - virtual void MacOpenFile(const wxString &fileName) ; - // in response of a print-document apple event - virtual void MacPrintFile(const wxString &fileName) ; - // in response of a open-application apple event - virtual void MacNewFile() ; - // in response of a reopen-application apple event - virtual void MacReopenApp() ; - - DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxStAppResource -{ -public: - wxStAppResource() ; - ~wxStAppResource() ; - - // opaque pointer for CFragInitBlock - static void OpenSharedLibraryResource(const void *) ; - static void CloseSharedLibraryResource() ; - -private: - short m_currentRefNum ; -} ; - -#endif - // _WX_APP_H_ - diff --git a/include/wx/mac/carbon/apptbase.h b/include/wx/mac/carbon/apptbase.h deleted file mode 100644 index 84c68cd0ee..0000000000 --- a/include/wx/mac/carbon/apptbase.h +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/apptbase.h -// Purpose: declaration of wxAppTraits for Mac systems -// Author: Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 23.06.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_APPTBASE_H_ -#define _WX_MAC_APPTBASE_H_ - -// ---------------------------------------------------------------------------- -// wxAppTraits: the Mac version adds extra hooks needed by Mac code -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAppTraits : public wxAppTraitsBase -{ -public: - // wxExecute() support methods - // --------------------------- - - // TODO - - // wxThread helpers - // ---------------- - - - // TODO - - // other miscellaneous helpers - // --------------------------- - -}; - -#endif // _WX_MAC_APPTBASE_H_ - diff --git a/include/wx/mac/carbon/apptrait.h b/include/wx/mac/carbon/apptrait.h deleted file mode 100644 index 88b424ab1a..0000000000 --- a/include/wx/mac/carbon/apptrait.h +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/apptrait.h -// Purpose: standard implementations of wxAppTraits for MacOS -// Author: Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 23.06.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_APPTRAIT_H_ -#define _WX_MAC_APPTRAIT_H_ - -// ---------------------------------------------------------------------------- -// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxConsoleAppTraits : public wxConsoleAppTraitsBase -{ -public: - // other miscellaneous helpers - // --------------------------- - - virtual wxToolkitInfo& GetToolkitInfo(); -}; - -#if wxUSE_GUI - -class WXDLLEXPORT wxGUIAppTraits : public wxGUIAppTraitsBase -{ -public: - // other miscellaneous helpers - // --------------------------- - - virtual wxToolkitInfo& GetToolkitInfo(); -}; - -#endif // wxUSE_GUI - -#endif // _WX_MAC_APPTRAIT_H_ - diff --git a/include/wx/mac/carbon/bitmap.h b/include/wx/mac/carbon/bitmap.h deleted file mode 100644 index a8e2439362..0000000000 --- a/include/wx/mac/carbon/bitmap.h +++ /dev/null @@ -1,225 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.h -// Purpose: wxBitmap class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BITMAP_H_ -#define _WX_BITMAP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "bitmap.h" -#endif - -#include "wx/palette.h" - -// Bitmap -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxBitmapHandler; -class WXDLLEXPORT wxControl; -class WXDLLEXPORT wxCursor; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxImage; -class WXDLLEXPORT wxPixelDataBase; - -// A mask is a bitmap used for drawing bitmaps -// it can be a monochrome bitmap or a multi-bit bitmap which transfers to alpha channels -// transparently. -class WXDLLEXPORT wxMask: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxMask) - DECLARE_NO_COPY_CLASS(wxMask) - -public: - wxMask(); - - // Construct a mask from a bitmap and a colour indicating - // the transparent area - wxMask(const wxBitmap& bitmap, const wxColour& colour); - - // Construct a mask from a bitmap and a palette index indicating - // the transparent area - wxMask(const wxBitmap& bitmap, int paletteIndex); - - // Construct a mask from a mono bitmap (copies the bitmap). - wxMask(const wxBitmap& bitmap); - - ~wxMask(); - - bool Create(const wxBitmap& bitmap, const wxColour& colour); - bool Create(const wxBitmap& bitmap, int paletteIndex); - bool Create(const wxBitmap& bitmap); - - // Implementation - bool PointMasked(int x, int y); - inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; } - inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; } - int GetDepth() const { return m_depth ; } - void SetDepth( int depth ) { m_depth = depth ; } -protected: - WXHBITMAP m_maskBitmap; - int m_depth ; -}; - -enum { kMacBitmapTypeUnknownType , kMacBitmapTypeGrafWorld, kMacBitmapTypePict , kMacBitmapTypeIcon } ; - -class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData -{ - DECLARE_NO_COPY_CLASS(wxBitmapRefData) - - friend class WXDLLEXPORT wxBitmap; - friend class WXDLLEXPORT wxIcon; - friend class WXDLLEXPORT wxCursor; -public: - wxBitmapRefData(); - ~wxBitmapRefData(); - -public: - int m_width; - int m_height; - int m_depth; - bool m_ok; - int m_numColors; -#if wxUSE_PALETTE - wxPalette m_bitmapPalette; -#endif // wxUSE_PALETTE - int m_quality; - - int m_bitmapType ; - WXHMETAFILE m_hPict ; - WXHBITMAP m_hBitmap; - WXHICON m_hIcon ; - wxMask * m_bitmapMask; // Optional mask - bool m_hasAlpha; -}; - -#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) - -class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmapHandler) -public: - wxBitmapHandler() : m_name(), m_extension(), m_type(0) { } - virtual ~wxBitmapHandler(); - - virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1); - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); - virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); - - void SetName(const wxString& name) { m_name = name; } - void SetExtension(const wxString& ext) { m_extension = ext; } - void SetType(long type) { m_type = type; } - wxString GetName() const { return m_name; } - wxString GetExtension() const { return m_extension; } - long GetType() const { return m_type; } - -protected: - wxString m_name; - wxString m_extension; - long m_type; -}; - -#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) - -class WXDLLEXPORT wxBitmap: public wxBitmapBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmap) - - friend class WXDLLEXPORT wxBitmapHandler; - -public: - wxBitmap(); // Platform-specific - - // Copy constructors - wxBitmap(const wxBitmap& bitmap) - : wxBitmapBase() - { Ref(bitmap); } - - // Initialize with raw data. - wxBitmap(const char bits[], int width, int height, int depth = 1); - - // Initialize with XPM data - bool CreateFromXpm(const char **bits); - wxBitmap(const char **bits); - wxBitmap(char **bits); - - // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE); - - // Constructor for generalised creation from data - wxBitmap(void *data, wxBitmapType type, int width, int height, int depth = 1); - - // If depth is omitted, will create a bitmap compatible with the display - wxBitmap(int width, int height, int depth = -1); - - // Convert from wxImage: - wxBitmap(const wxImage& image, int depth = -1); - - ~wxBitmap(); - - wxImage ConvertToImage() const; - - // get the given part of bitmap - wxBitmap GetSubBitmap( const wxRect& rect ) const; - - virtual bool Create(int width, int height, int depth = -1); - virtual bool Create(void *data, wxBitmapType type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); - virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; - - // copies the contents and mask of the given (colour) icon to the bitmap - virtual bool CopyFromIcon(const wxIcon& icon); - - bool Ok() const; - int GetWidth() const; - int GetHeight() const; - int GetDepth() const; - int GetQuality() const; - void SetWidth(int w); - void SetHeight(int h); - void SetDepth(int d); - void SetQuality(int q); - void SetOk(bool isOk); - -#if wxUSE_PALETTE - wxPalette* GetPalette() const; - void SetPalette(const wxPalette& palette); -#endif // wxUSE_PALETTE - - wxMask *GetMask() const; - void SetMask(wxMask *mask) ; - - int GetBitmapType() const; - - inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } - inline bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; } - inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } - - static void InitStandardHandlers(); - - // raw bitmap access support functions, for internal use only - void *GetRawData(wxPixelDataBase& data, int bpp); - void UngetRawData(wxPixelDataBase& data); - - void UseAlpha(); - -public: - WXHBITMAP GetHBITMAP() const; - inline WXHICON GetHICON() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hIcon : 0); } - WXHMETAFILE GetPict(bool *created = NULL ) const; - - void SetHBITMAP(WXHBITMAP bmp); - void SetHICON(WXHICON ico); - void SetPict( WXHMETAFILE pict ) ; - - bool FreeResource(bool force = FALSE); -}; -#endif - // _WX_BITMAP_H_ diff --git a/include/wx/mac/carbon/bmpbuttn.h b/include/wx/mac/carbon/bmpbuttn.h deleted file mode 100644 index 28a91ed93f..0000000000 --- a/include/wx/mac/carbon/bmpbuttn.h +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.h -// Purpose: wxBitmapButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BMPBUTTN_H_ -#define _WX_BMPBUTTN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "bmpbuttn.h" -#endif - -#include "wx/button.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; - -#define wxDEFAULT_BUTTON_MARGIN 4 - -class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmapButton) - -public: - wxBitmapButton() - { - SetMargins(wxDEFAULT_BUTTON_MARGIN, wxDEFAULT_BUTTON_MARGIN); - } - - wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Create(parent, id, bitmap, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual void SetBitmapLabel(const wxBitmap& bitmap); - -/* - // TODO: Implementation - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel ); - virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel ); - virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ); -*/ - -protected: - virtual wxSize DoGetBestSize() const; -}; - -#endif - // _WX_BMPBUTTN_H_ diff --git a/include/wx/mac/carbon/brush.h b/include/wx/mac/carbon/brush.h deleted file mode 100644 index 12e60e06d1..0000000000 --- a/include/wx/mac/carbon/brush.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: brush.h -// Purpose: wxBrush class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BRUSH_H_ -#define _WX_BRUSH_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "brush.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/gdiobj.h" -#include "wx/bitmap.h" - -class WXDLLEXPORT wxBrush; - -typedef enum -{ - kwxMacBrushColour , - kwxMacBrushTheme , - kwxMacBrushThemeBackground -} wxMacBrushKind ; - -// Brush -class WXDLLEXPORT wxBrush: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxBrush) - -public: - wxBrush(); - wxBrush(short macThemeBrush ) ; - wxBrush(const wxColour& col, int style = wxSOLID); - wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) - : wxGDIObject() - { Ref(brush); } - ~wxBrush(); - - virtual void SetColour(const wxColour& col) ; - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; - virtual void SetStyle(int style) ; - virtual void SetStipple(const wxBitmap& stipple) ; - virtual void SetMacTheme(short macThemeBrush) ; - virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; - - wxBrush& operator = (const wxBrush& brush) - { if (*this == brush) return (*this); Ref(brush); return *this; } - bool operator == (const wxBrush& brush) - { return m_refData == brush.m_refData; } - bool operator != (const wxBrush& brush) - { return m_refData != brush.m_refData; } - - wxMacBrushKind MacGetBrushKind() const ; - - unsigned long GetMacThemeBackground(WXRECTPTR extent) const ; - short GetMacTheme() const ; - wxColour& GetColour() const ; - int GetStyle() const ; - wxBitmap *GetStipple() const ; - - virtual bool Ok() const { return (m_refData != NULL) ; } - -// Implementation - - // Useful helper: create the brush resource - bool RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_BRUSH_H_ diff --git a/include/wx/mac/carbon/button.h b/include/wx/mac/carbon/button.h deleted file mode 100644 index 23e9044f00..0000000000 --- a/include/wx/mac/carbon/button.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: button.h -// Purpose: wxButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUTTON_H_ -#define _WX_BUTTON_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "button.h" -#endif - -#include "wx/control.h" -#include "wx/gdicmn.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; - -// Pushbutton -class WXDLLEXPORT wxButton: public wxButtonBase -{ - DECLARE_DYNAMIC_CLASS(wxButton) - public: - inline wxButton() {} - inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - static wxSize GetDefaultSize(); - - virtual void SetDefault(); - virtual void Command(wxCommandEvent& event); -protected: - virtual wxSize DoGetBestSize() const ; -}; - -#endif - // _WX_BUTTON_H_ diff --git a/include/wx/mac/carbon/checkbox.h b/include/wx/mac/carbon/checkbox.h deleted file mode 100644 index a426cb734b..0000000000 --- a/include/wx/mac/carbon/checkbox.h +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.h -// Purpose: wxCheckBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKBOX_H_ -#define _WX_CHECKBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "checkbox.h" -#endif - -// Checkbox item (single checkbox) -class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase -{ -public: - wxCheckBox() { } - wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - virtual void SetValue(bool); - virtual bool GetValue() const; - - void DoSet3StateValue(wxCheckBoxState val); - virtual wxCheckBoxState DoGet3StateValue() const; - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ); - virtual void Command(wxCommandEvent& event); - - DECLARE_DYNAMIC_CLASS(wxCheckBox) -}; - -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox -{ -public: - int checkWidth; - int checkHeight; - - wxBitmapCheckBox() - : checkWidth(-1), checkHeight(-1) - { } - - wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - virtual void SetValue(bool); - virtual bool GetValue() const; - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - virtual void SetLabel(const wxBitmap *bitmap); - virtual void SetLabel( const wxString & WXUNUSED(name) ) {} - - DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox) -}; -#endif - // _WX_CHECKBOX_H_ diff --git a/include/wx/mac/carbon/checklst.h b/include/wx/mac/carbon/checklst.h deleted file mode 100644 index 35f3bd885d..0000000000 --- a/include/wx/mac/carbon/checklst.h +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: checklst.h -// Purpose: wxCheckListBox class - a listbox with checkable items -// Note: this is an optional class. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKLST_H_ -#define _WX_CHECKLST_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "checklst.h" -#endif - -#if !defined(__MWERKS__) && !defined(__UNIX__) -typedef unsigned int size_t; -#endif - -class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxCheckListBox) -public: - // ctors - wxCheckListBox() { Init(); } - wxCheckListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int nStrings = 0, - const wxString *choices = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Init(); - - Create(parent, id, pos, size, nStrings, choices, style, validator, name); - } - wxCheckListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Init(); - - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int nStrings = 0, - const wxString *choices = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - - // items may be checked - bool IsChecked(size_t uiIndex) const; - void Check(size_t uiIndex, bool bCheck = TRUE); - void OnChar(wxKeyEvent& event) ; - void OnLeftClick(wxMouseEvent& event) ; - - // metrics - wxInt32 m_checkBoxWidth; - wxInt32 m_checkBoxHeight; - wxInt32 m_TextBaseLineOffset; - - // the array containing the checked status of the items - wxArrayInt m_checks; - - // override all methods which add/delete items to update m_checks array as - // well - virtual void Delete(int n); -protected: - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - virtual void DoClear(); - // common part of all ctors - void Init(); -private: - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_CHECKLST_H_ diff --git a/include/wx/mac/carbon/chkconf.h b/include/wx/mac/carbon/chkconf.h deleted file mode 100644 index e7c5d596c5..0000000000 --- a/include/wx/mac/carbon/chkconf.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Name: wx/mac/chkconf.h - * Purpose: Compiler-specific configuration checking - * Author: Julian Smart - * Modified by: - * Created: 01/02/97 - * RCS-ID: $Id$ - * Copyright: (c) Julian Smart - * Licence: wxWindows licence - */ - -#ifndef _WX_MAC_CHKCONF_H_ -#define _WX_MAC_CHKCONF_H_ - -/* - * disable the settings which don't work for some compilers - */ - -/* - * wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior - */ - -#if defined(__MWERKS__) - #undef wxUSE_DEBUG_NEW_ALWAYS - #define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#endif - /* _WX_MAC_CHKCONF_H_ */ - diff --git a/include/wx/mac/carbon/choice.h b/include/wx/mac/carbon/choice.h deleted file mode 100644 index 4c10bab315..0000000000 --- a/include/wx/mac/carbon/choice.h +++ /dev/null @@ -1,111 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: choice.h -// Purpose: wxChoice class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICE_H_ -#define _WX_CHOICE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "choice.h" -#endif - -#include "wx/control.h" - -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr; - -WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ; - -// Choice item -class WXDLLEXPORT wxChoice: public wxChoiceBase -{ - DECLARE_DYNAMIC_CLASS(wxChoice) - -public: - wxChoice() - : m_strings(), m_datas(), m_macPopUpMenuHandle(NULL) - {} - - virtual ~wxChoice() ; - - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetCount() const ; - virtual int GetSelection() const ; - virtual void SetSelection(int n); - - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual void SetString( int , const wxString& s ) ; - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - virtual wxSize DoGetBestSize() const ; - -public: // for wxComboBox only - virtual void DoSetItemClientData( int n, void* clientData ); - virtual void* DoGetItemClientData( int n ) const; - virtual void DoSetItemClientObject( int n, wxClientData* clientData ); - virtual wxClientData* DoGetItemClientObject( int n ) const; - -protected: - // free all memory we have (used by Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() - void FreeData(); - - wxArrayString m_strings; - wxChoiceDataArray m_datas ; - WXHMENU m_macPopUpMenuHandle ; -}; - -#endif - // _WX_CHOICE_H_ diff --git a/include/wx/mac/carbon/clipbrd.h b/include/wx/mac/carbon/clipbrd.h deleted file mode 100644 index 34bb3e3129..0000000000 --- a/include/wx/mac/carbon/clipbrd.h +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: clipbrd.h -// Purpose: Clipboard functionality. -// Note: this functionality is under review, and -// is derived from wxWindows 1.xx code. Please contact -// the wxWindows developers for further information. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLIPBRD_H_ -#define _WX_CLIPBRD_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "clipbrd.h" -#endif - -#if wxUSE_CLIPBOARD - -#include "wx/list.h" -#include "wx/module.h" -#include "wx/dataobj.h" // for wxDataFormat - -//----------------------------------------------------------------------------- -// wxClipboard -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObject; -class WXDLLEXPORT wxClipboard : public wxClipboardBase -{ - DECLARE_DYNAMIC_CLASS(wxClipboard) - -public: - wxClipboard(); - ~wxClipboard(); - - // open the clipboard before SetData() and GetData() - virtual bool Open(); - - // close the clipboard after SetData() and GetData() - virtual void Close(); - - // query whether the clipboard is opened - virtual bool IsOpened() const; - - // set the clipboard data. all other formats will be deleted. - virtual bool SetData( wxDataObject *data ); - - // add to the clipboard data. - virtual bool AddData( wxDataObject *data ); - - // ask if data in correct format is available - virtual bool IsSupported( const wxDataFormat& format ); - - // fill data with data on the clipboard (if available) - virtual bool GetData( wxDataObject& data ); - - // clears wxTheClipboard and the system's clipboard if possible - virtual void Clear(); - - // flushes the clipboard: this means that the data which is currently on - // clipboard will stay available even after the application exits (possibly - // eating memory), otherwise the clipboard will be emptied on exit - virtual bool Flush(); - - // X11 has two clipboards which get selected by this call. Empty on MSW. - void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } - -private: - wxDataObject *m_data; - bool m_open; -}; - -#endif // wxUSE_CLIPBOARD - -#endif - // _WX_CLIPBRD_H_ diff --git a/include/wx/mac/carbon/colordlg.h b/include/wx/mac/carbon/colordlg.h deleted file mode 100644 index 443ba6fd68..0000000000 --- a/include/wx/mac/carbon/colordlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colordlg.h -// Purpose: wxColourDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLORDLG_H_ -#define _WX_COLORDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "colordlg.h" -#endif - -#include "wx/setup.h" -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * Platform-specific colour dialog implementation - */ - -class WXDLLEXPORT wxColourDialog: public wxDialog -{ -DECLARE_DYNAMIC_CLASS(wxColourDialog) -public: - wxColourDialog(); - wxColourDialog(wxWindow *parent, wxColourData *data = NULL); - - bool Create(wxWindow *parent, wxColourData *data = NULL); - - int ShowModal(); - wxColourData& GetColourData() { return m_colourData; } - -protected: - wxColourData m_colourData; - wxWindow* m_dialogParent; -}; - -#endif - // _WX_COLORDLG_H_ diff --git a/include/wx/mac/carbon/colour.h b/include/wx/mac/carbon/colour.h deleted file mode 100644 index 158e631d64..0000000000 --- a/include/wx/mac/carbon/colour.h +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colour.h -// Purpose: wxColour class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLOUR_H_ -#define _WX_COLOUR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "colour.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" - -// Colour -class WXDLLEXPORT wxColour: public wxObject -{ -public: - // ctors - // default - wxColour() { Init(); } - // from RGB - wxColour( unsigned char red, unsigned char green, unsigned char blue ) - { Set(red, green, blue); } - wxColour( unsigned long colRGB ) - { Set(colRGB); } - - // implicit conversion from the colour name - wxColour( const wxString &colourName ) - { InitFromName(colourName); } - wxColour( const wxChar *colourName ) - { InitFromName(colourName); } - - // copy ctors and assignment operators - wxColour( const wxColour& col ); - wxColour( const wxColour* col ); - wxColour& operator = ( const wxColour& col ); - - // dtor - ~wxColour(); - - // Set() functions - void Set( unsigned char red, unsigned char green, unsigned char blue ); - void Set( unsigned long colRGB ) - { - // we don't need to know sizeof(long) here because we assume that the three - // least significant bytes contain the R, G and B values - Set((unsigned char)colRGB, - (unsigned char)(colRGB >> 8), - (unsigned char)(colRGB >> 16)); - } - - // accessors - bool Ok() const {return m_isInit; } - - unsigned char Red() const { return m_red; } - unsigned char Green() const { return m_green; } - unsigned char Blue() const { return m_blue; } - - // comparison - bool operator == (const wxColour& colour) const - { - return (m_isInit == colour.m_isInit - && m_red == colour.m_red - && m_green == colour.m_green - && m_blue == colour.m_blue); - } - bool operator != (const wxColour& colour) const { return !(*this == colour); } - - const WXCOLORREF& GetPixel() const { return m_pixel; }; - - void InitFromName(const wxString& col); - -protected : - - // Helper function - void Init(); - -private: - bool m_isInit; - unsigned char m_red; - unsigned char m_blue; - unsigned char m_green; - -public: - WXCOLORREF m_pixel ; - void Set( const WXCOLORREF* color ) ; - -private: - DECLARE_DYNAMIC_CLASS(wxColour) -}; - -#endif - // _WX_COLOUR_H_ diff --git a/include/wx/mac/carbon/combobox.h b/include/wx/mac/carbon/combobox.h deleted file mode 100644 index 68b3b02820..0000000000 --- a/include/wx/mac/carbon/combobox.h +++ /dev/null @@ -1,136 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h -// Purpose: wxComboBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOBOX_H_ -#define _WX_COMBOBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "combobox.h" -#endif - -#include "wx/textctrl.h" -#include "wx/choice.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr; - -// Combobox item -class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxComboBox) - - public: - inline wxComboBox() {} - virtual ~wxComboBox(); - // override the base class virtuals involved in geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - - // forward these functions to all subcontrols - virtual bool Enable(bool enable = TRUE); - virtual bool Show(bool show = TRUE); - virtual void SetFocus(); - - // callback functions - virtual void DelegateTextChanged( const wxString& value ); - virtual void DelegateChoice( const wxString& value ); - - inline wxComboBox(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - { - Create(parent, id, value, pos, size, n, choices, style, validator, name); - } - inline wxComboBox(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - { - Create(parent, id, value, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - - // List functions - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetSelection() const ; - virtual void SetSelection(int n); - virtual void Select(int n) { SetSelection(n) ; } - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual wxString GetStringSelection() const ; - virtual void SetString(int n, const wxString& s) ; - virtual bool SetStringSelection(const wxString& sel); - - // Text field functions - virtual wxString GetValue() const ; - virtual void SetValue(const wxString& value); - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const ; - virtual long GetLastPosition() const ; - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - virtual int GetCount() const { return m_choice->GetCount() ; } - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - -protected: - virtual int DoAppend(const wxString& item) ; - virtual int DoInsert(const wxString& item, int pos) ; - - virtual void DoSetItemClientData(int n, void* clientData) ; - virtual void* DoGetItemClientData(int n) const ; - virtual void DoSetItemClientObject(int n, wxClientData* clientData) ; - virtual wxClientData* DoGetItemClientObject(int n) const ; - - void FreeData(); - - // the subcontrols - wxTextCtrl* m_text; - wxChoice* m_choice; -}; - -#endif - // _WX_COMBOBOX_H_ diff --git a/include/wx/mac/carbon/control.h b/include/wx/mac/carbon/control.h deleted file mode 100644 index cc588f3861..0000000000 --- a/include/wx/mac/carbon/control.h +++ /dev/null @@ -1,109 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: control.h -// Purpose: wxControl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONTROL_H_ -#define _WX_CONTROL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "control.h" -#endif - -WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr; - -// General item class -class WXDLLEXPORT wxControl : public wxControlBase -{ - DECLARE_ABSTRACT_CLASS(wxControl) - -public: - wxControl(); - wxControl(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxControlNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxControlNameStr); - virtual ~wxControl(); - - // Simulates an event - virtual void Command(wxCommandEvent& event) { ProcessCommand(event); } - - // implementation from now on - // -------------------------- - - // Calls the callback and appropriate event handlers - bool ProcessCommand(wxCommandEvent& event); - virtual void SetLabel(const wxString& title) ; - - wxList& GetSubcontrols() { return m_subControls; } - - void OnEraseBackground(wxEraseEvent& event); - - virtual bool Enable(bool enable = TRUE) ; - virtual bool Show(bool show = TRUE) ; - virtual void DoSetWindowVariant( wxWindowVariant variant ) ; - - virtual void MacRedrawControl () ; - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label , - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name , - WXRECTPTR outBounds , - unsigned char* maclabel ) ; - virtual void MacPostControlCreate() ; - virtual void MacAdjustControlRect() ; - virtual WXWidget MacGetContainerForEmbedding() ; - virtual void MacSuperChangedPosition() ; - virtual void MacSuperEnabled( bool enabled ) ; - virtual void MacSuperShown( bool show ) ; - virtual bool MacCanFocus() const ; - virtual void MacUpdateDimensions() ; - void* MacGetControlAction() { return m_macControlAction ; } - - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; - void OnKeyDown( wxKeyEvent &event ) ; - void OnMouseEvent( wxMouseEvent &event ) ; - void OnPaint(wxPaintEvent& event) ; - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ; - WXWidget GetMacControl() { return m_macControl ;} - -protected: - // For controls like radiobuttons which are really composite - WXWidget m_macControl ; - void* m_macControlAction ; - bool m_macControlIsShown ; - wxList m_subControls; - int m_macHorizontalBorder ; - int m_macVerticalBorder ; - - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_EVENT_TABLE() -}; - - -wxControl *wxFindControlFromMacControl(WXWidget inControl ) ; -void wxAssociateControlWithMacControl(WXWidget inControl, wxControl *control) ; -void wxRemoveMacControlAssociation(wxControl *control) ; - -#endif - // _WX_CONTROL_H_ diff --git a/include/wx/mac/carbon/cursor.h b/include/wx/mac/carbon/cursor.h deleted file mode 100644 index c8414a4ee0..0000000000 --- a/include/wx/mac/carbon/cursor.h +++ /dev/null @@ -1,85 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cursor.h -// Purpose: wxCursor class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CURSOR_H_ -#define _WX_CURSOR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "cursor.h" -#endif - -#include "wx/bitmap.h" - -class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData -{ - DECLARE_NO_COPY_CLASS(wxCursorRefData) - - friend class WXDLLEXPORT wxBitmap; - friend class WXDLLEXPORT wxCursor; -public: - wxCursorRefData(); - ~wxCursorRefData(); - -protected: - WXHCURSOR m_hCursor; - bool m_disposeHandle; - bool m_releaseHandle; - bool m_isColorCursor ; - long m_themeCursor ; -}; - -#define M_CURSORDATA ((wxCursorRefData *)m_refData) -#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) - -// Cursor -class WXDLLEXPORT wxCursor: public wxBitmap -{ - DECLARE_DYNAMIC_CLASS(wxCursor) - -public: - wxCursor(); - - // Copy constructors - wxCursor(const wxCursor& cursor) - : wxBitmap() - { Ref(cursor); } - - wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, - const char maskBits[] = NULL); - - wxCursor(const wxImage & image) ; - wxCursor(const char **bits) ; - wxCursor(char **bits) ; - wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE, - int hotSpotX = 0, int hotSpotY = 0); - - wxCursor(int cursor_type); - ~wxCursor(); - - bool CreateFromXpm(const char **bits) ; - virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } - - 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; } - inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } - - void MacInstall() const ; - - void SetHCURSOR(WXHCURSOR cursor); - inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } -private : - void CreateFromImage(const wxImage & image) ; -}; - -extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); - -#endif - // _WX_CURSOR_H_ diff --git a/include/wx/mac/carbon/dataform.h b/include/wx/mac/carbon/dataform.h deleted file mode 100644 index 6e8846c6da..0000000000 --- a/include/wx/mac/carbon/dataform.h +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataform.h -// Purpose: declaration of the wxDataFormat class -// Author: Stefan Csomor (lifted from dnd.h) -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DATAFORM_H -#define _WX_MAC_DATAFORM_H - -class WXDLLEXPORT wxDataFormat -{ -public: - typedef unsigned long NativeFormat; - - wxDataFormat(); - wxDataFormat(wxDataFormatId vType); - wxDataFormat(const wxString& rId); - wxDataFormat(const wxChar* pId); - wxDataFormat(NativeFormat vFormat); - - wxDataFormat& operator=(NativeFormat vFormat) - { SetId(vFormat); return *this; } - - // comparison (must have both versions) - bool operator==(NativeFormat format) const - { return m_format == (NativeFormat)format; } - bool operator!=(NativeFormat format) const - { return m_format != (NativeFormat)format; } - bool operator==(wxDataFormatId format) const - { return m_type == (wxDataFormatId)format; } - bool operator!=(wxDataFormatId format) const - { return m_type != (wxDataFormatId)format; } - - // explicit and implicit conversions to NativeFormat which is one of - // standard data types (implicit conversion is useful for preserving the - // compatibility with old code) - NativeFormat GetFormatId() const { return m_format; } - operator NativeFormat() const { return m_format; } - - void SetId(NativeFormat format); - - // string ids are used for custom types - this SetId() must be used for - // application-specific formats - wxString GetId() const; - void SetId(const wxChar* pId); - - // implementation - wxDataFormatId GetType() const { return m_type; } - void SetType( wxDataFormatId type ); - -private: - wxDataFormatId m_type; - NativeFormat m_format; -}; - -#endif // _WX_MAC_DATAFORM_H diff --git a/include/wx/mac/carbon/dataobj.h b/include/wx/mac/carbon/dataobj.h deleted file mode 100644 index 15b58e3a37..0000000000 --- a/include/wx/mac/carbon/dataobj.h +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.h -// Purpose: declaration of the wxDataObject -// Author: Stefan Csomor (adapted from Robert Roebling's gtk port) -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DATAOBJ_H_ -#define _WX_MAC_DATAOBJ_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// wxDataObject is the same as wxDataObjectBase under wxGTK -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObject : public wxDataObjectBase -{ -public: - wxDataObject(); -#ifdef __DARWIN__ - ~wxDataObject() { } -#endif - - virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const; -}; - -#endif // _WX_MAC_DATAOBJ_H_ - diff --git a/include/wx/mac/carbon/dataobj2.h b/include/wx/mac/carbon/dataobj2.h deleted file mode 100644 index 64b0ac084a..0000000000 --- a/include/wx/mac/carbon/dataobj2.h +++ /dev/null @@ -1,86 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: os2/dataobj2.h -// Purpose: declaration of standard wxDataObjectSimple-derived classes -// Author: David Webster (adapted from Robert Roebling's gtk port -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GTK_DATAOBJ2_H_ -#define _WX_GTK_DATAOBJ2_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject is a specialization of wxDataObject for bitmaps -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapDataObject : public wxBitmapDataObjectBase -{ -public: - // ctors - wxBitmapDataObject(); - wxBitmapDataObject(const wxBitmap& bitmap); - - // destr - ~wxBitmapDataObject(); - - // override base class virtual to update PNG data too - virtual void SetBitmap(const wxBitmap& bitmap); - - // implement base class pure virtuals - // ---------------------------------- - - virtual size_t GetDataSize() const ; - virtual bool GetDataHere(void *buf) const ; - virtual bool SetData(size_t len, const void *buf); - -protected : - void Init() ; - void Clear() ; - - void* m_pictHandle ; - bool m_pictCreated ; -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -}; - -// ---------------------------------------------------------------------------- -// wxFileDataObject is a specialization of wxDataObject for file names -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDataObject : public wxFileDataObjectBase -{ -public: - // implement base class pure virtuals - // ---------------------------------- - - void AddFile( const wxString &filename ); - - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t len, const void *buf); - -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -}; - -#endif // _WX_GTK_DATAOBJ2_H_ - diff --git a/include/wx/mac/carbon/dc.h b/include/wx/mac/carbon/dc.h deleted file mode 100644 index 5fc2601e55..0000000000 --- a/include/wx/mac/carbon/dc.h +++ /dev/null @@ -1,293 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.h -// Purpose: wxDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DC_H_ -#define _WX_DC_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dc.h" -#endif - -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/icon.h" -#include "wx/font.h" -#include "wx/gdicmn.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#ifndef MM_TEXT -#define MM_TEXT 0 -#define MM_ISOTROPIC 1 -#define MM_ANISOTROPIC 2 -#define MM_LOMETRIC 3 -#define MM_HIMETRIC 4 -#define MM_TWIPS 5 -#define MM_POINTS 6 -#define MM_METRIC 7 -#endif - -//----------------------------------------------------------------------------- -// global variables -//----------------------------------------------------------------------------- - -extern int wxPageNumber; - -class wxMacPortStateHelper ; -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDC: public wxDCBase -{ - DECLARE_DYNAMIC_CLASS(wxDC) - DECLARE_NO_COPY_CLASS(wxDC) - - public: - - wxDC(); - ~wxDC(); - - - // implement base class pure virtuals - // ---------------------------------- - - virtual void Clear(); - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } - virtual void EndDoc(void) {}; - - virtual void StartPage(void) {}; - virtual void EndPage(void) {}; - - virtual void SetFont(const wxFont& font); - virtual void SetPen(const wxPen& pen); - virtual void SetBrush(const wxBrush& brush); - virtual void SetBackground(const wxBrush& brush); - virtual void SetBackgroundMode(int mode); - virtual void SetPalette(const wxPalette& palette); - - virtual void DestroyClippingRegion(); - - virtual wxCoord GetCharHeight() const; - virtual wxCoord GetCharWidth() const; - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; - virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; - - virtual bool CanDrawBitmap() const; - virtual bool CanGetTextExtent() const; - virtual int GetDepth() const; - virtual wxSize GetPPI() const; - - virtual void SetMapMode(int mode); - virtual void SetUserScale(double x, double y); - - virtual void SetLogicalScale(double x, double y); - virtual void SetLogicalOrigin(wxCoord x, wxCoord y); - virtual void SetDeviceOrigin(wxCoord x, wxCoord y); - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - virtual void SetLogicalFunction(int function); - - virtual void SetTextForeground(const wxColour& colour) ; - virtual void SetTextBackground(const wxColour& colour) ; - - void ComputeScaleAndOrigin(void); - public: - - - wxCoord XDEV2LOG(wxCoord x) const - { - long new_x = x - m_deviceOriginX ; - if (new_x > 0) - return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX; - else - return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX; - } - wxCoord XDEV2LOGREL(wxCoord x) const - { - if (x > 0) - return (wxCoord)((double)(x) / m_scaleX + 0.5); - else - return (wxCoord)((double)(x) / m_scaleX - 0.5); - } - wxCoord YDEV2LOG(wxCoord y) const - { - long new_y = y - m_deviceOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY; - else - return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY; - } - wxCoord YDEV2LOGREL(wxCoord y) const - { - if (y > 0) - return (wxCoord)((double)(y) / m_scaleY + 0.5); - else - return (wxCoord)((double)(y) / m_scaleY - 0.5); - } - wxCoord XLOG2DEV(wxCoord x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX ; - else - return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX ; - } - wxCoord XLOG2DEVREL(wxCoord x) const - { - if (x > 0) - return (wxCoord)((double)(x) * m_scaleX + 0.5); - else - return (wxCoord)((double)(x) * m_scaleX - 0.5); - } - wxCoord YLOG2DEV(wxCoord y) const - { - long new_y = y - m_logicalOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY ; - else - return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY ; - } - wxCoord YLOG2DEVREL(wxCoord y) const - { - if (y > 0) - return (wxCoord)((double)(y) * m_scaleY + 0.5); - else - return (wxCoord)((double)(y) * m_scaleY - 0.5); - } - wxCoord XLOG2DEVMAC(wxCoord x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ; - else - return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ; - } - wxCoord YLOG2DEVMAC(wxCoord y) const - { - long new_y = y - m_logicalOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ; - else - return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ; - } - - WXHRGN MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; } - static void MacSetupBackgroundForCurrentPort(const wxBrush& background ) ; -// - -protected: - virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); - - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; - - virtual void DoDrawPoint(wxCoord x, wxCoord y); - virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - - virtual void DoDrawArc(wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc); - - virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea); - - virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double radius); - virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - - virtual void DoCrossHair(wxCoord x, wxCoord y); - - virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); - virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); - - virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); - virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, - double angle); - - virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); - virtual void DoSetClippingRegion(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y, - wxCoord *width, wxCoord *height) - { - GetClippingBox(x, y, width, height); - } - - virtual void DoGetSizeMM(int* width, int* height) const; - - virtual void DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset); - virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); - - protected: - //begin wxmac - // Variables used for scaling - double m_mm_to_pix_x,m_mm_to_pix_y; - // not yet used - bool m_needComputeScaleX,m_needComputeScaleY; - // If un-scrolled is non-zero or d.o. changes with scrolling. - // Set using SetInternalDeviceOrigin(). - long m_internalDeviceOriginX,m_internalDeviceOriginY; - // To be set by external classes such as wxScrolledWindow - // using SetDeviceOrigin() - long m_externalDeviceOriginX,m_externalDeviceOriginY; - - // Begin implementation for Mac - public: - - WXHDC m_macPort ; - WXHBITMAP m_macMask ; - - // in order to preserve the const inheritance of the virtual functions, we have to - // use mutable variables starting from CWPro 5 - - void MacInstallFont() const ; - void MacInstallPen() const ; - void MacInstallBrush() const ; - - mutable bool m_macFontInstalled ; - mutable bool m_macPenInstalled ; - mutable bool m_macBrushInstalled ; - - WXHRGN m_macBoundaryClipRgn ; - WXHRGN m_macCurrentClipRgn ; - wxPoint m_macLocalOrigin ; - void MacSetupPort( wxMacPortStateHelper* ph ) const ; - void MacCleanupPort( wxMacPortStateHelper* ph ) const ; - mutable void* m_macATSUIStyle ; - mutable wxMacPortStateHelper* m_macCurrentPortStateHelper ; - mutable bool m_macFormerAliasState ; - mutable short m_macFormerAliasSize ; - mutable bool m_macAliasWasEnabled ; - mutable void* m_macForegroundPixMap ; - mutable void* m_macBackgroundPixMap ; -}; - -#endif - // _WX_DC_H_ diff --git a/include/wx/mac/carbon/dcclient.h b/include/wx/mac/carbon/dcclient.h deleted file mode 100644 index 8e01314084..0000000000 --- a/include/wx/mac/carbon/dcclient.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.h -// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCCLIENT_H_ -#define _WX_DCCLIENT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcclient.h" -#endif - -#include "wx/dc.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxPaintDC; -class WXDLLEXPORT wxWindow; - -class WXDLLEXPORT wxWindowDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxWindowDC) - - public: - wxWindowDC(void); - - // Create a DC corresponding to a canvas - wxWindowDC(wxWindow *win); - - ~wxWindowDC(void); - virtual void DoGetSize( int *width, int *height ) const; - protected : - wxWindow *m_window; -}; - - -class WXDLLEXPORT wxClientDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxClientDC) - - public: - wxClientDC(void); - - // Create a DC corresponding to a canvas - wxClientDC(wxWindow *win); - - ~wxClientDC(void); - virtual void DoGetSize( int *width, int *height ) const; -}; - -class WXDLLEXPORT wxPaintDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxPaintDC) - - public: - wxPaintDC(void); - - // Create a DC corresponding to a canvas - wxPaintDC(wxWindow *win); - - ~wxPaintDC(void); - virtual void DoGetSize( int *width, int *height ) const; -}; - -#endif - // _WX_DCCLIENT_H_ diff --git a/include/wx/mac/carbon/dcmemory.h b/include/wx/mac/carbon/dcmemory.h deleted file mode 100644 index c8ea44e5ad..0000000000 --- a/include/wx/mac/carbon/dcmemory.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.h -// Purpose: wxMemoryDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCMEMORY_H_ -#define _WX_DCMEMORY_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcmemory.h" -#endif - -#include "wx/dcclient.h" - -class WXDLLEXPORT wxMemoryDC: public wxPaintDC -{ - DECLARE_DYNAMIC_CLASS(wxMemoryDC) - - public: - wxMemoryDC(void); - wxMemoryDC( wxDC *dc ); // Create compatible DC - ~wxMemoryDC(void); - virtual void SelectObject( const wxBitmap& bitmap ); - virtual void DoGetSize( int *width, int *height ) const; - wxBitmap GetSelectedObject() { return m_selected ; } - private: - wxBitmap m_selected; -}; - -#endif - // _WX_DCMEMORY_H_ diff --git a/include/wx/mac/carbon/dcprint.h b/include/wx/mac/carbon/dcprint.h deleted file mode 100644 index 0e2b5bcf0d..0000000000 --- a/include/wx/mac/carbon/dcprint.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcprint.h -// Purpose: wxPrinterDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCPRINT_H_ -#define _WX_DCPRINT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcprint.h" -#endif - -#include "wx/dc.h" -#include "wx/cmndata.h" - -class wxNativePrinterDC ; - -class WXDLLEXPORT wxPrinterDC: public wxDC -{ - public: - DECLARE_CLASS(wxPrinterDC) - -#if wxUSE_PRINTING_ARCHITECTURE - // Create a printer DC - wxPrinterDC(const wxPrintData& printdata ); - ~wxPrinterDC(); - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) ; - virtual void EndDoc(void) ; - virtual void StartPage(void) ; - virtual void EndPage(void) ; - wxPrintData& GetPrintData() { return m_printData; } - virtual void DoGetSize( int *width, int *height ) const; - - protected: - wxPrintData m_printData ; - wxNativePrinterDC* m_nativePrinterDC ; -#endif // wxUSE_PRINTING_ARCHITECTURE -}; - -#endif - // _WX_DCPRINT_H_ - diff --git a/include/wx/mac/carbon/dcscreen.h b/include/wx/mac/carbon/dcscreen.h deleted file mode 100644 index ab83b37618..0000000000 --- a/include/wx/mac/carbon/dcscreen.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcscreen.h -// Purpose: wxScreenDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCSCREEN_H_ -#define _WX_DCSCREEN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcscreen.h" -#endif - -#include "wx/dcclient.h" - -class WXDLLEXPORT wxScreenDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxScreenDC) - - public: - // Create a DC representing the whole screen - wxScreenDC(); - ~wxScreenDC(); - - // Compatibility with X's requirements for - // drawing on top of all windows - static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; } - static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; } - static bool EndDrawingOnTop() { return TRUE; } -}; - -#endif - // _WX_DCSCREEN_H_ - diff --git a/include/wx/mac/carbon/dialog.h b/include/wx/mac/carbon/dialog.h deleted file mode 100644 index e6834011c5..0000000000 --- a/include/wx/mac/carbon/dialog.h +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.h -// Purpose: wxDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_ -#define _WX_DIALOG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dialog.h" -#endif - -#include "wx/panel.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr; - -WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr; - -class WXDLLEXPORT wxMacToolTip ; - -// Dialog boxes -class WXDLLEXPORT wxDialog : public wxDialogBase -{ - DECLARE_DYNAMIC_CLASS(wxDialog) - -public: - wxDialog(); - - // Constructor with a modal flag, but no window id - the old convention - wxDialog(wxWindow *parent, - const wxString& title, bool modal, - int x = -1, int y= -1, int width = 500, int height = 500, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; - Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), - style | modalStyle, name); - } - - // Constructor with no modal flag - the new convention. - wxDialog(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - ~wxDialog(); - -// virtual bool Destroy(); - bool Show(bool show = true); - - void SetModal(bool flag); - virtual bool IsModal() const; - - // For now, same as Show(TRUE) but returns return code - virtual int ShowModal(); - - // may be called to terminate the dialog with the given return code - virtual void EndModal(int retCode); - - // returns TRUE if we're in a modal loop - bool IsModalShowing() const; - - // implementation - // -------------- - - // event handlers - void OnCharHook(wxKeyEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - // Standard buttons - void OnOK(wxCommandEvent& event); - void OnApply(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // show modal dialog and enter modal loop - void DoShowModal(); - -private: - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_DIALOG_H_ diff --git a/include/wx/mac/carbon/dirdlg.h b/include/wx/mac/carbon/dirdlg.h deleted file mode 100644 index 734292ade3..0000000000 --- a/include/wx/mac/carbon/dirdlg.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.h -// Purpose: wxDirDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRDLG_H_ -#define _WX_DIRDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dirdlg.h" -#endif - -class WXDLLEXPORT wxDirDialog : public wxDialog -{ -public: - wxDirDialog(wxWindow *parent, - const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = _T(""), - long style = 0, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - const wxString& name = wxDirDialogNameStr); - - void SetMessage(const wxString& message) { m_message = message; } - void SetPath(const wxString& path) { m_path = path; } - void SetStyle(long style) { m_dialogStyle = style; } - - wxString GetMessage() const { return m_message; } - wxString GetPath() const { return m_path; } - long GetStyle() const { return m_dialogStyle; } - - virtual int ShowModal(); - -protected: - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; - wxString m_path; - - DECLARE_DYNAMIC_CLASS(wxDirDialog) -}; - -#endif - // _WX_DIRDLG_H_ diff --git a/include/wx/mac/carbon/display.h b/include/wx/mac/carbon/display.h deleted file mode 100644 index 060c9c7ef4..0000000000 --- a/include/wx/mac/carbon/display.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: display.h -// Purpose: wxDisplay class customization for Mac -// Author: Brian Victor -// Modified by: Royce Mitchell III -// Created: 06/21/02 -// RCS-ID: $Id$ -// Copyright: (c) wxWindows team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DISPLAY_H_ -#define _WX_MAC_DISPLAY_H_ - -#include "wx/object.h" -#include "wx/display.h" - -class wxDisplayMacPriv; -class wxRect; -class wxString; - -class WXDLLEXPORT wxDisplay : public wxDisplayBase -{ -public: - wxDisplay ( size_t index = 0 ); - - ~wxDisplay(); - - virtual wxRect GetGeometry() const; - virtual int GetDepth() const; - virtual wxString GetName() const; - - virtual wxArrayVideoModes - GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const; - - virtual wxVideoMode GetCurrentMode() const; - - virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode); - -private: - wxDisplayMacPriv* m_priv; - - DECLARE_NO_COPY_CLASS(wxDisplay) -}; - -#endif // _WX_MAC_DISPLAY_H_ diff --git a/include/wx/mac/carbon/dnd.h b/include/wx/mac/carbon/dnd.h deleted file mode 100644 index 989a977628..0000000000 --- a/include/wx/mac/carbon/dnd.h +++ /dev/null @@ -1,114 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dnd.h -// Purpose: Declaration of the wxDropTarget, wxDropSource class etc. -// Author: Stefan Csomor -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DND_H_ -#define _WX_DND_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dnd.h" -#endif - -#if wxUSE_DRAG_AND_DROP - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" -#include "wx/string.h" -#include "wx/dataobj.h" -#include "wx/cursor.h" - -//------------------------------------------------------------------------- -// classes -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindow; - -class WXDLLEXPORT wxDropTarget; -class WXDLLEXPORT wxTextDropTarget; -class WXDLLEXPORT wxFileDropTarget; - -class WXDLLEXPORT wxDropSource; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// this macro may be used instead for wxDropSource ctor arguments: it will use -// the icon 'name' from an XPM file under GTK, but will expand to something -// else under MSW. If you don't use it, you will have to use #ifdef in the -// application code. -#define wxDROP_ICON(X) wxCursor( (const char**) X##_xpm ) - -//------------------------------------------------------------------------- -// wxDropTarget -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropTarget: public wxDropTargetBase -{ - public: - - wxDropTarget(wxDataObject *dataObject = (wxDataObject*) NULL ); - - virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); - virtual bool OnDrop(wxCoord x, wxCoord y); - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); - virtual bool GetData(); - - bool CurrentDragHasSupportedFormat() ; - void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; } - void* GetCurrentDrag() { return m_currentDrag ; } - protected : - void* m_currentDrag ; -}; - -//------------------------------------------------------------------------- -// wxDropSource -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropSource: public wxDropSourceBase -{ -public: - // ctors: if you use default ctor you must call SetData() later! - // - // NB: the "wxWindow *win" parameter is unused and is here only for wxGTK - // compatibility, as well as both icon parameters - wxDropSource( wxWindow *win = (wxWindow *)NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - - /* constructor for setting one data object */ - wxDropSource( wxDataObject& data, - wxWindow *win, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - - ~wxDropSource(); - - // do it (call this in response to a mouse button press, for example) - // params: if bAllowMove is false, data can be only copied - virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); - - wxWindow* GetWindow() { return m_window ; } - void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; } - void* GetCurrentDrag() { return m_currentDrag ; } - bool MacInstallDefaultCursor(wxDragResult effect) ; - protected : - - wxWindow *m_window; - void* m_currentDrag ; -}; - -#endif - // D&D - -#endif - //_WX_DND_H_ - diff --git a/include/wx/mac/carbon/filedlg.h b/include/wx/mac/carbon/filedlg.h deleted file mode 100644 index 4cc0387a08..0000000000 --- a/include/wx/mac/carbon/filedlg.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: filedlg.h -// Purpose: wxFileDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDLG_H_ -#define _WX_FILEDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "filedlg.h" -#endif - -//------------------------------------------------------------------------- -// wxFileDialog -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDialog: public wxFileDialogBase -{ -DECLARE_DYNAMIC_CLASS(wxFileDialog) -protected: - wxArrayString m_fileNames; - wxArrayString m_paths; - -public: - wxFileDialog(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = 0, - const wxPoint& pos = wxDefaultPosition); - - virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; } - virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; } - - virtual int ShowModal(); - - // not supported for file dialog, RR - virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} -}; - -#endif // _WX_FILEDLG_H_ diff --git a/include/wx/mac/carbon/font.h b/include/wx/mac/carbon/font.h deleted file mode 100644 index 78aa2f4d5f..0000000000 --- a/include/wx/mac/carbon/font.h +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: font.h -// Purpose: wxFont class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONT_H_ -#define _WX_FONT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "font.h" -#endif - -// ---------------------------------------------------------------------------- -// wxFont -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFont : public wxFontBase -{ -public: - // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) - : wxFontBase() - { - Init(); - Ref(font); - } - - wxFont(int size, - int family, - int style, - int weight, - bool underlined = FALSE, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - Init(); - - (void)Create(size, family, style, weight, underlined, face, encoding); - } - - wxFont(const wxNativeFontInfo& info) - { - Init(); - - (void)Create(info); - } - - wxFont(const wxString& fontDesc); - - bool Create(int size, - int family, - int style, - int weight, - bool underlined = FALSE, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - - bool Create(const wxNativeFontInfo& info); - - virtual ~wxFont(); - - // assignment - wxFont& operator=(const wxFont& font); - - // implement base class pure virtuals - virtual int GetPointSize() const; - virtual int GetFamily() const; - virtual int GetStyle() const; - virtual int GetWeight() const; - virtual bool GetUnderlined() const; - virtual wxString GetFaceName() const; - virtual wxFontEncoding GetEncoding() const; - virtual const wxNativeFontInfo *GetNativeFontInfo() const; - - virtual void SetPointSize(int pointSize); - virtual void SetFamily(int family); - virtual void SetStyle(int style); - virtual void SetWeight(int weight); - virtual void SetFaceName(const wxString& faceName); - virtual void SetUnderlined(bool underlined); - virtual void SetEncoding(wxFontEncoding encoding); - - // implementation only from now on - // ------------------------------- - - virtual bool RealizeResource(); - - // Unofficial API, don't use - virtual void SetNoAntiAliasing( bool noAA = TRUE ) ; - virtual bool GetNoAntiAliasing() ; - - // Mac-specific, risks to change, don't use in portable code - short GetMacFontNum() const; - short GetMacFontSize() const; - wxByte GetMacFontStyle() const; - wxUint32 GetMacATSUFontID() const; - -protected: - // common part of all ctors - void Init(); - - void Unshare(); - -private: - DECLARE_DYNAMIC_CLASS(wxFont) -}; - -#endif - // _WX_FONT_H_ diff --git a/include/wx/mac/carbon/fontdlg.h b/include/wx/mac/carbon/fontdlg.h deleted file mode 100644 index 3d654b56c8..0000000000 --- a/include/wx/mac/carbon/fontdlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.h -// Purpose: wxFontDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTDLG_H_ -#define _WX_FONTDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "fontdlg.h" -#endif - -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * Font dialog - */ - -class WXDLLEXPORT wxFontDialog: public wxDialog -{ -DECLARE_DYNAMIC_CLASS(wxFontDialog) -public: - wxFontDialog(); - wxFontDialog(wxWindow *parent, const wxFontData& data); - - bool Create(wxWindow *parent, const wxFontData& data); - - int ShowModal(); - wxFontData& GetFontData() { return m_fontData; } - -protected: - wxWindow* m_dialogParent; - wxFontData m_fontData; -}; - -#endif - // _WX_FONTDLG_H_ - diff --git a/include/wx/mac/carbon/frame.h b/include/wx/mac/carbon/frame.h deleted file mode 100644 index f92f7196fc..0000000000 --- a/include/wx/mac/carbon/frame.h +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.h -// Purpose: wxFrame class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAME_H_ -#define _WX_FRAME_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "frame.h" -#endif - -#include "wx/window.h" -#include "wx/toolbar.h" -#include "wx/accel.h" -#include "wx/icon.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; - -class WXDLLEXPORT wxMenuBar; -class WXDLLEXPORT wxStatusBar; -class WXDLLEXPORT wxMacToolTip ; - -class WXDLLEXPORT wxFrame: public wxFrameBase -{ -public: - // construction - wxFrame() { Init(); } - wxFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init(); - - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - virtual ~wxFrame(); - - // implementation only from now on - // ------------------------------- - - // override some more virtuals - virtual bool Enable(bool enable = TRUE) ; - - // get the origin of the client area (which may be different from (0, 0) - // if the frame has a toolbar) in client coordinates - virtual wxPoint GetClientAreaOrigin() const; - - // event handlers - void OnActivate(wxActivateEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Toolbar -#if wxUSE_TOOLBAR - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = -1, - const wxString& name = wxToolBarNameStr); - - virtual void PositionToolBar(); -#endif // wxUSE_TOOLBAR - - // Status bar -#if wxUSE_STATUSBAR - virtual wxStatusBar* OnCreateStatusBar(int number = 1, - long style = wxST_SIZEGRIP, - wxWindowID id = 0, - const wxString& name = wxStatusLineNameStr); - - virtual void PositionStatusBar(); -#endif // wxUSE_STATUSBAR - - // tooltip management -#if wxUSE_TOOLTIPS - wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; } - void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; } - wxMacToolTip* m_hwndToolTip ; -#endif // tooltips - - // called by wxWindow whenever it gets focus - void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } - wxWindow *GetLastFocus() const { return m_winLastFocused; } - -protected: - // common part of all ctors - void Init(); - - // override base class virtuals - virtual void DoGetClientSize(int *width, int *height) const; - virtual void DoSetClientSize(int width, int height); - - virtual void DetachMenuBar(); - virtual void AttachMenuBar(wxMenuBar *menubar); - -protected: - // the last focused child: we restore focus to it on activation - wxWindow *m_winLastFocused; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxFrame) -}; - -#endif - // _WX_FRAME_H_ diff --git a/include/wx/mac/carbon/gauge.h b/include/wx/mac/carbon/gauge.h deleted file mode 100644 index 4eb5db3a69..0000000000 --- a/include/wx/mac/carbon/gauge.h +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.h -// Purpose: wxGauge class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GAUGE_H_ -#define _WX_GAUGE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "gauge.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr; - -// Group box -class WXDLLEXPORT wxGauge: public wxGaugeBase -{ - DECLARE_DYNAMIC_CLASS(wxGauge) - public: - inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; } - - inline wxGauge(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxGA_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxGaugeNameStr) - { - Create(parent, id, range, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxGA_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxGaugeNameStr); - - void SetShadowWidth(int w); - void SetBezelFace(int w); - void SetRange(int r); - void SetValue(int pos); - - int GetShadowWidth() const ; - int GetBezelFace() const ; - int GetRange() const ; - int GetValue() const ; - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; - - protected: - int m_rangeMax; - int m_gaugePos; -}; - -#endif - // _WX_GAUGE_H_ diff --git a/include/wx/mac/carbon/gdiobj.h b/include/wx/mac/carbon/gdiobj.h deleted file mode 100644 index 1ad618bf84..0000000000 --- a/include/wx/mac/carbon/gdiobj.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.h -// Purpose: wxGDIObject class: base class for other GDI classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GDIOBJ_H_ -#define _WX_GDIOBJ_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "gdiobj.h" -#endif - -#include "wx/object.h" - -class WXDLLEXPORT wxGDIRefData: public wxObjectRefData { -public: - inline wxGDIRefData() - { - } -}; - -#define M_GDIDATA ((wxGDIRefData *)m_refData) - -class WXDLLEXPORT wxGDIObject: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxGDIObject) - public: - wxGDIObject() : m_visible(FALSE) { } - ~wxGDIObject() { } - - bool IsNull() const { return (m_refData == 0); } - - virtual bool GetVisible() { return m_visible; } - virtual void SetVisible(bool v) { m_visible = v; } - -protected: - bool m_visible; // Can a pointer to this object be safely taken? - // - only if created within FindOrCreate... -}; - -#endif - // _WX_GDIOBJ_H_ diff --git a/include/wx/mac/carbon/glcanvas.h b/include/wx/mac/carbon/glcanvas.h deleted file mode 100644 index 6f044609c3..0000000000 --- a/include/wx/mac/carbon/glcanvas.h +++ /dev/null @@ -1,134 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: glcanvas.h -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -# pragma interface "glcanvas.h" -#endif - -#ifndef _WX_GLCANVAS_H_ -#define _WX_GLCANVAS_H_ - -#include "wx/setup.h" - -#if wxUSE_GLCANVAS - -#include "wx/palette.h" -#include "wx/scrolwin.h" -#include "wx/app.h" - -#ifdef __DARWIN__ -# include -# include -#else -# include -# include -#endif - -//--------------------------------------------------------------------------- -// Constants for attriblist -//--------------------------------------------------------------------------- - -enum -{ - WX_GL_RGBA=1, /* use true color palette */ - WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */ - WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */ - WX_GL_DOUBLEBUFFER, /* use doublebuffer */ - WX_GL_STEREO, /* use stereoscopic display */ - WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */ - WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */ - WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */ - WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */ - WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */ - WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */ - WX_GL_STENCIL_SIZE, /* bits for stencil buffer */ - WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */ - WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */ - WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */ - WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */ -}; - -class WXDLLEXPORT wxGLCanvas; /* forward reference */ - -class WXDLLEXPORT wxGLContext: public wxObject -{ -public: - wxGLContext(AGLPixelFormat fmt, wxGLCanvas *win, - const wxPalette& WXUNUSED(palette), - const wxGLContext *other /* for sharing display lists */ - ); - ~wxGLContext(); - - void SetCurrent(); - void Update(); // must be called after window drag/grows/zoom or clut change - void SetColour(const wxChar *colour); - void SwapBuffers(); - - - inline wxWindow* GetWindow() const { return m_window; } - inline AGLDrawable GetDrawable() const { return m_drawable; } - -public: - AGLContext m_glContext; - AGLDrawable m_drawable; - wxWindow* m_window; -}; - -class WXDLLEXPORT wxGLCanvas: public wxWindow -{ - DECLARE_CLASS(wxGLCanvas) - public: - wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxT("GLCanvas") , int *attribList = 0, const wxPalette& palette = wxNullPalette); - wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL, - wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("GLCanvas"), - int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette ); - - wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxT("GLCanvas"), int *attribList = 0, const wxPalette& palette = wxNullPalette ); - - ~wxGLCanvas(); - - bool Create(wxWindow *parent, const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette); - - void SetCurrent(); - void SetColour(const wxChar *colour); - void SwapBuffers(); - void UpdateContext(); - void SetViewport(); - virtual bool Show(bool show = TRUE) ; - - // Unlike some other platforms, this must get called if you override it. - // It sets the viewport correctly and update the context. - // You shouldn't call glViewport yourself either (use SetViewport if you must reset it.) - void OnSize(wxSizeEvent& event); - - virtual void MacSuperChangedPosition() ; - virtual void MacTopLevelWindowChangedPosition() ; - virtual void MacSuperShown( bool show ) ; - - void MacUpdateView() ; - - inline wxGLContext* GetContext() const { return m_glContext; } - -protected: - wxGLContext* m_glContext; - bool m_macCanvasIsShown ; -DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_GLCANVAS -#endif // _WX_GLCANVAS_H_ diff --git a/include/wx/mac/carbon/gsockmac.h b/include/wx/mac/carbon/gsockmac.h deleted file mode 100644 index 6bb4a2aa71..0000000000 --- a/include/wx/mac/carbon/gsockmac.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockunx.h - * Purpose: GSocket Macintosh header - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#ifndef __GSOCK_UNX_H -#define __GSOCK_UNX_H - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/setup.h" -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/gsocket.h" -#else -#include "gsocket.h" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef GSocket* GSocketPtr ; - -/* Definition of GSocket */ -struct _GSocket -{ - wxMacNotifierTableRef m_mac_events ; - EndpointRef m_endpoint; - GAddress *m_local; - GAddress *m_peer; - GSocketError m_error; - - int m_non_blocking; - int m_server; - int m_stream; - int m_oriented; - unsigned long m_timeout; - - /* Callbacks */ - GSocketEventFlags m_detected; - GSocketCallback m_cbacks[GSOCK_MAX_EVENT]; - char *m_data[GSOCK_MAX_EVENT]; - int m_takesEvents ; -}; - -/* Definition of GAddress */ - -struct _GAddress -{ - UInt32 m_host ; - UInt16 m_port ; - GAddressType m_family; - GSocketError m_error; -}; - -/* Input / Output */ - -GSocketError _GSocket_Input_Timeout(GSocket *socket); -GSocketError _GSocket_Output_Timeout(GSocket *socket); -int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size); -int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size); -int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size); -int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size); - -/* Callbacks */ - -void _GSocket_Enable_Events(GSocket *socket); -void _GSocket_Disable_Events(GSocket *socket); -void _GSocket_Internal_Proc(unsigned long e , void* data ) ; - -/* GAddress */ - -GSocketError _GAddress_translate_from(GAddress *address, - InetAddress *addr ); -GSocketError _GAddress_translate_to(GAddress *address, - InetAddress *addr); - -GSocketError _GAddress_Init_INET(GAddress *address); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ - -#endif /* __GSOCK_UNX_H */ diff --git a/include/wx/mac/carbon/helpxxxx.h b/include/wx/mac/carbon/helpxxxx.h deleted file mode 100644 index a33c0737a5..0000000000 --- a/include/wx/mac/carbon/helpxxxx.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpxxxx.h -// Purpose: Help system: native implementation for your system. Replace -// XXXX with suitable name. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPXXXX_H_ -#define _WX_HELPXXXX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "helpxxxx.h" -#endif - -#include "wx/wx.h" - -#include "wx/helpbase.h" - -class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase -{ - DECLARE_CLASS(wxXXXXHelpController) - - public: - wxXXXXHelpController(); - ~wxXXXXHelpController(); - - // Must call this to set the filename and server name - virtual bool Initialize(const wxString& file); - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = ""); - virtual bool DisplayContents(); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplayBlock(long blockNo); - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - - virtual bool Quit(); - virtual void OnQuit(); - - inline wxString GetHelpFile() const { return m_helpFile; } - -protected: - wxString m_helpFile; -}; - -#endif - // _WX_HELPXXXX_H_ diff --git a/include/wx/mac/carbon/icon.h b/include/wx/mac/carbon/icon.h deleted file mode 100644 index bdc0ff755f..0000000000 --- a/include/wx/mac/carbon/icon.h +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.h -// Purpose: wxIcon class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICON_H_ -#define _WX_ICON_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "icon.h" -#endif - -#include "wx/bitmap.h" - -// Icon -class WXDLLEXPORT wxIcon: public wxBitmap -{ -public: - wxIcon(); - - // Copy constructors - wxIcon(const wxIcon& icon) - : wxBitmap() - { Ref(icon); } - - wxIcon(const char **data); - wxIcon(char **data); - wxIcon(const char bits[], int width , int height ); - wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE, - int desiredWidth = -1, int desiredHeight = -1); - wxIcon(const wxIconLocation& loc) - { - LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON); - } - ~wxIcon(); - - bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ , - int desiredWidth /* = -1 */ , int desiredHeight = -1); - bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE ) - { return LoadFile( name , flags , -1 , -1 ) ; } - - wxIcon& operator=(const wxIcon& icon) - { if (this != &icon) Ref(icon); return *this; } - bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } - bool operator!=(const wxIcon& icon) const { return !(*this == icon); } - - // create from bitmap (which should have a mask unless it's monochrome): - // there shouldn't be any implicit bitmap -> icon conversion (i.e. no - // ctors, assignment operators...), but it's ok to have such function - void CopyFromBitmap(const wxBitmap& bmp); - - DECLARE_DYNAMIC_CLASS(wxIcon) -}; - -/* -class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxICONFileHandler) -public: - inline wxICONFileHandler() - { - m_name = "ICO icon file"; - m_extension = "ico"; - m_type = wxBITMAP_TYPE_ICO; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth = -1, int desiredHeight = -1); -}; -*/ - -class WXDLLEXPORT wxICONResourceHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxICONResourceHandler) -public: - inline wxICONResourceHandler() - { - m_name = wxT("ICON resource"); - m_extension = wxEmptyString; - m_type = wxBITMAP_TYPE_ICON_RESOURCE; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth = -1, int desiredHeight = -1); - -}; - -#endif - // _WX_ICON_H_ diff --git a/include/wx/mac/carbon/imaglist.h b/include/wx/mac/carbon/imaglist.h deleted file mode 100644 index e8fbf6e713..0000000000 --- a/include/wx/mac/carbon/imaglist.h +++ /dev/null @@ -1,147 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaglist.h -// Purpose: wxImageList class. Note: if your GUI doesn't have -// an image list equivalent, you can use the generic class -// in src/generic. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_ -#define _WX_IMAGLIST_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "imaglist.h" -#endif - -#include "wx/bitmap.h" - -/* - * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to - * images for their items by an index into an image list. - * A wxImageList is capable of creating images with optional masks from - * a variety of sources - a single bitmap plus a colour to indicate the mask, - * two bitmaps, or an icon. - * - */ - -// Flags for Draw -#define wxIMAGELIST_DRAW_NORMAL 0x0001 -#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002 -#define wxIMAGELIST_DRAW_SELECTED 0x0004 -#define wxIMAGELIST_DRAW_FOCUSED 0x0008 - -// Flag values for Set/GetImageList -enum { - wxIMAGE_LIST_NORMAL, // Normal icons - wxIMAGE_LIST_SMALL, // Small icons - wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation) -}; - -// Eventually we'll make this a reference-counted wxGDIObject. For -// now, the app must take care of ownership issues. That is, the -// image lists must be explicitly deleted after the control(s) that uses them -// is (are) deleted, or when the app exits. -class WXDLLEXPORT wxImageList: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxImageList) - public: - /* - * Public interface - */ - - wxImageList(); - - // Creates an image list. - // Specify the width and height of the images in the list, - // whether there are masks associated with them (e.g. if creating images - // from icons), and the initial size of the list. - inline wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1) - { - Create(width, height, mask, initialCount); - } - ~wxImageList(); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Returns the number of images in the image list. - int GetImageCount() const; - - bool GetSize(int index, int&width, int &height) const; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Creates an image list - // width, height specify the size of the images in the list (all the same). - // mask specifies whether the images have masks or not. - // initialNumber is the initial number of images to reserve. - bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1); - - // Adds a bitmap, and optionally a mask bitmap. - // Note that wxImageList creates *new* bitmaps, so you may delete - // 'bitmap' and 'mask' after calling Add. - int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); - - // Adds a bitmap, using the specified colour to create the mask bitmap - // Note that wxImageList creates *new* bitmaps, so you may delete - // 'bitmap' after calling Add. - int Add(const wxBitmap& bitmap, const wxColour& maskColour); - - // Adds a bitmap and mask from an icon. - int Add(const wxIcon& icon); - - // Replaces a bitmap, optionally passing a mask bitmap. - // Note that wxImageList creates new bitmaps, so you may delete - // 'bitmap' and 'mask' after calling Replace. - bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); - -/* Not supported by Win95 - // Replacing a bitmap, using the specified colour to create the mask bitmap - // Note that wxImageList creates new bitmaps, so you may delete - // 'bitmap'. - bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour); -*/ - - // Replaces a bitmap and mask from an icon. - // You can delete 'icon' after calling Replace. - bool Replace(int index, const wxIcon& icon); - - // Removes the image at the given index. - bool Remove(int index); - - // Remove all images - bool RemoveAll(); - - // Draws the given image on a dc at the specified position. - // If 'solidBackground' is TRUE, Draw sets the image list background - // colour to the background colour of the wxDC, to speed up - // drawing by eliminating masked drawing where possible. - bool Draw(int index, wxDC& dc, int x, int y, - int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = FALSE); - -/* TODO (optional?) - wxIcon *MakeIcon(int index); -*/ - -/* TODO - // Implementation - //////////////////////////////////////////////////////////////////////////// - - // Returns the native image list handle - inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; } - -protected: - WXHIMAGELIST m_hImageList; -*/ - -}; - -#endif - // _WX_IMAGLIST_H_ diff --git a/include/wx/mac/carbon/joystick.h b/include/wx/mac/carbon/joystick.h deleted file mode 100644 index 6db596e3b3..0000000000 --- a/include/wx/mac/carbon/joystick.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.h -// Purpose: wxJoystick class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_JOYSTICK_H_ -#define _WX_JOYSTICK_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "joystick.h" -#endif - -#include "wx/event.h" - -class WXDLLEXPORT wxJoystick: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxJoystick) - public: - /* - * Public interface - */ - - wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; }; - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - wxPoint GetPosition() const; - int GetZPosition() const; - int GetButtonState() const; - int GetPOVPosition() const; - int GetPOVCTSPosition() const; - int GetRudderPosition() const; - int GetUPosition() const; - int GetVPosition() const; - int GetMovementThreshold() const; - void SetMovementThreshold(int threshold) ; - - // Capabilities - //////////////////////////////////////////////////////////////////////////// - - bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; - int GetManufacturerId() const ; - int GetProductId() const ; - wxString GetProductName() const ; - int GetXMin() const; - int GetYMin() const; - int GetZMin() const; - int GetXMax() const; - int GetYMax() const; - int GetZMax() const; - int GetNumberButtons() const; - int GetNumberAxes() const; - int GetMaxButtons() const; - int GetMaxAxes() const; - int GetPollingMin() const; - int GetPollingMax() const; - int GetRudderMin() const; - int GetRudderMax() const; - int GetUMin() const; - int GetUMax() const; - int GetVMin() const; - int GetVMax() const; - - bool HasRudder() const; - bool HasZ() const; - bool HasU() const; - bool HasV() const; - bool HasPOV() const; - bool HasPOV4Dir() const; - bool HasPOVCTS() const; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // pollingFreq = 0 means that movement events are sent when above the threshold. - // If pollingFreq > 0, events are received every this many milliseconds. - bool SetCapture(wxWindow* win, int pollingFreq = 0); - bool ReleaseCapture(); - -protected: - int m_joystick; -}; - -#endif - // _WX_JOYSTICK_H_ diff --git a/include/wx/mac/carbon/listbox.h b/include/wx/mac/carbon/listbox.h deleted file mode 100644 index 77c0f27209..0000000000 --- a/include/wx/mac/carbon/listbox.h +++ /dev/null @@ -1,181 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h -// Purpose: wxListBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_LISTBOX_H_ -#define _WX_LISTBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "listbox.h" -#endif - -// ---------------------------------------------------------------------------- -// simple types -// ---------------------------------------------------------------------------- -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -#if wxUSE_OWNER_DRAWN - class WXDLLEXPORT wxOwnerDrawn; - - // define the array of list box items - #include "wx/dynarray.h" - - WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray); -#endif // wxUSE_OWNER_DRAWN - -// forward decl for GetSelections() -class wxArrayInt; - -// List box item - -WX_DEFINE_ARRAY( char * , wxListDataArray ) ; - -// ---------------------------------------------------------------------------- -// List box control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListBox : public wxListBoxBase -{ -public: - // ctors and such - wxListBox(); - wxListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - - virtual ~wxListBox(); - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); - - // implement base class pure virtuals - virtual void Clear(); - virtual void Delete(int n); - - virtual int GetCount() const; - virtual wxString GetString(int n) const; - virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; - - virtual bool IsSelected(int n) const; - virtual void SetSelection(int n, bool select = TRUE); - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(int n, void* clientData); - virtual void* DoGetItemClientData(int n) const; - virtual void DoSetItemClientObject(int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(int n) const; - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; - - // wxCheckListBox support -#if wxUSE_OWNER_DRAWN - // plug-in for derived classes - virtual wxOwnerDrawn *CreateItem(size_t n); - - // allows to get the item and use SetXXX functions to set it's appearance - wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; } - - // get the index of the given item - int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); } -#endif // wxUSE_OWNER_DRAWN - - // Windows callbacks - - virtual void SetupColours(); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual bool MacCanFocus() const { return true ; } - void OnChar(wxKeyEvent& event); - - void* m_macList ; - wxArrayString m_stringArray ; - wxListDataArray m_dataArray ; - wxArrayInt m_selectionPreImage ; - void MacSetRedraw( bool doDraw ) ; -protected: - void MacDestroy() ; - void MacDelete( int n ) ; - void MacInsert( int n , const wxString& item) ; - void MacAppend( const wxString& item) ; - void MacSet( int n , const wxString& item ) ; - void MacClear() ; - void MacSetSelection( int n , bool select ) ; - int MacGetSelection() const ; - int MacGetSelections(wxArrayInt& aSelections) const ; - bool MacIsSelected( int n ) const ; - void MacScrollTo( int n ) ; - void OnSize( wxSizeEvent &size ) ; - void MacDoClick() ; - void MacDoDoubleClick() ; - - // do we have multiple selections? - bool HasMultipleSelection() const; - - // free memory (common part of Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() - void FreeData(); - - int m_noItems; - int m_selected; - wxString m_typeIn ; - long m_lastTypeIn ; - - virtual wxSize DoGetBestSize() const; - -#if wxUSE_OWNER_DRAWN - // control items - wxListBoxItemsArray m_aItems; -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxListBox) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_LISTBOX_H_ diff --git a/include/wx/mac/carbon/listctrl.h b/include/wx/mac/carbon/listctrl.h deleted file mode 100644 index 196f97add1..0000000000 --- a/include/wx/mac/carbon/listctrl.h +++ /dev/null @@ -1,451 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listctrl.h -// Purpose: wxListCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTCTRL_H_ -#define _WX_LISTCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "listctrl.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" - -/* - The wxListCtrl can show lists of items in four different modes: - wxLC_LIST: multicolumn list view, with optional small icons (icons could be - optional for some platforms). Columns are computed automatically, - i.e. you don't set columns as in wxLC_REPORT. In other words, - the list wraps, unlike a wxListBox. - wxLC_REPORT: single or multicolumn report view (with optional header) - wxLC_ICON: large icon view, with optional labels - wxLC_SMALL_ICON: small icon view, with optional labels - - You can change the style dynamically, either with SetSingleStyle or - SetWindowStyleFlag. - - Further window styles: - - wxLC_ALIGN_TOP icons align to the top (default) - wxLC_ALIGN_LEFT icons align to the left - wxLC_AUTOARRANGE icons arrange themselves - wxLC_USER_TEXT the app provides label text on demand, except for column headers - wxLC_EDIT_LABELS labels are editable: app will be notified. - wxLC_NO_HEADER no header in report mode - wxLC_NO_SORT_HEADER can't click on header - wxLC_SINGLE_SEL single selection - wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems) - wxLC_SORT_DESCENDING sort descending (ditto) - - Items are referred to by their index (position in the list starting from zero). - - Label text is supplied via insertion/setting functions and is stored by the - control, unless the wxLC_USER_TEXT style has been specified, in which case - the app will be notified when text is required (see sample). - - Images are dealt with by (optionally) associating 3 image lists with the control. - Zero-based indexes into these image lists indicate which image is to be used for - which item. Each image in an image list can contain a mask, and can be made out - of either a bitmap, two bitmaps or an icon. See ImagList.h for more details. - - Notifications are passed via the wxWindows 2.0 event system. - - See the sample wxListCtrl app for API usage. - - */ - -// Mask flags to tell app/GUI what fields of wxListItem are valid -#define wxLIST_MASK_STATE 0x0001 -#define wxLIST_MASK_TEXT 0x0002 -#define wxLIST_MASK_IMAGE 0x0004 -#define wxLIST_MASK_DATA 0x0008 -#define wxLIST_SET_ITEM 0x0010 -#define wxLIST_MASK_WIDTH 0x0020 -#define wxLIST_MASK_FORMAT 0x0040 - -// State flags for indicating the state of an item -#define wxLIST_STATE_DONTCARE 0x0000 -#define wxLIST_STATE_DROPHILITED 0x0001 -#define wxLIST_STATE_FOCUSED 0x0002 -#define wxLIST_STATE_SELECTED 0x0004 -#define wxLIST_STATE_CUT 0x0008 - -// Hit test flags, used in HitTest -#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area. -#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area. -#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item. -#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item. -#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item. -#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item. -#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state. -#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the client area. -#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the client area. - -#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL wxLIST_HITTEST_ONITEMSTATEICON) - -// Flags for GetNextItem -enum { - wxLIST_NEXT_ABOVE, // Searches for an item above the specified item - wxLIST_NEXT_ALL, // Searches for subsequent item by index - wxLIST_NEXT_BELOW, // Searches for an item below the specified item - wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item - wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item -}; - -// Alignment flags for Arrange -enum { - wxLIST_ALIGN_DEFAULT, - wxLIST_ALIGN_LEFT, - wxLIST_ALIGN_TOP, - wxLIST_ALIGN_SNAP_TO_GRID -}; - -// Column format -enum { - wxLIST_FORMAT_LEFT, - wxLIST_FORMAT_RIGHT, - wxLIST_FORMAT_CENTRE, - wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE -}; - -// Autosize values for SetColumnWidth -enum { - wxLIST_AUTOSIZE = -1, - wxLIST_AUTOSIZE_USEHEADER = -2 -}; - -// Flag values for GetItemRect -enum { - wxLIST_RECT_BOUNDS, - wxLIST_RECT_ICON, - wxLIST_RECT_LABEL -}; - -// Flag values for FindItem -enum { - wxLIST_FIND_UP, - wxLIST_FIND_DOWN, - wxLIST_FIND_LEFT, - wxLIST_FIND_RIGHT -}; - -// wxListItem: data representing an item, or report field. -// It also doubles up to represent entire column information -// when inserting or setting a column. -class WXDLLEXPORT wxListItem: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxListItem) -public: - long m_mask; // Indicates what fields are valid - long m_itemId; // The zero-based item position - int m_col; // Zero-based column, if in report mode - long m_state; // The state of the item - long m_stateMask; // Which flags of m_state are valid (uses same flags) - wxString m_text; // The label/header text - int m_image; // The zero-based index into an image list - long m_data; // App-defined data - - // For columns only - int m_format; // left, right, centre - int m_width; // width of column - - wxListItem(); -}; - -// type of compare function for wxListCtrl sort operation -typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData); - -class WXDLLEXPORT wxListCtrl: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxListCtrl) - public: - /* - * Public interface - */ - - wxListCtrl(); - - inline wxListCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listCtrl") - { - Create(parent, id, pos, size, style, validator, name); - } - ~wxListCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl"); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Gets information about this column - bool GetColumn(int col, wxListItem& item) const; - - // Sets information about this column - bool SetColumn(int col, wxListItem& item) ; - - // Gets the column width - int GetColumnWidth(int col) const; - - // Sets the column width - bool SetColumnWidth(int col, int width) ; - - // Gets the number of items that can fit vertically in the - // visible area of the list control (list or report view) - // or the total number of items in the list control (icon - // or small icon view) - int GetCountPerPage() const; - - // Gets the edit control for editing labels. - wxTextCtrl* GetEditControl() const; - - // Gets information about the item - bool GetItem(wxListItem& info) const ; - - // Sets information about the item - bool SetItem(wxListItem& info) ; - - // Sets a string field at a particular column - long SetItem(long index, int col, const wxString& label, int imageId = -1); - - // Gets the item state - int GetItemState(long item, long stateMask) const ; - - // Sets the item state - bool SetItemState(long item, long state, long stateMask) ; - - // Sets the item image - bool SetItemImage(long item, int image, int selImage) ; - - // Gets the item text - wxString GetItemText(long item) const ; - - // Sets the item text - void SetItemText(long item, const wxString& str) ; - - // Gets the item data - long GetItemData(long item) const ; - - // Sets the item data - bool SetItemData(long item, long data) ; - - // Gets the item rectangle - bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ; - - // Gets the item position - bool GetItemPosition(long item, wxPoint& pos) const ; - - // Sets the item position - bool SetItemPosition(long item, const wxPoint& pos) ; - - // Gets the number of items in the list control - int GetItemCount() const; - - // Gets the number of columns in the list control - int GetColumnCount() const; - - // Retrieves the spacing between icons in pixels. - // If small is TRUE, gets the spacing for the small icon - // view, otherwise the large icon view. - int GetItemSpacing(bool isSmall) const; - - // Gets the number of selected items in the list control - int GetSelectedItemCount() const; - - // Gets the text colour of the listview - wxColour GetTextColour() const; - - // Sets the text colour of the listview - void SetTextColour(const wxColour& col); - - // Gets the index of the topmost visible item when in - // list or report view - long GetTopItem() const ; - - // Add or remove a single window style - void SetSingleStyle(long style, bool add = TRUE) ; - - // Set the whole window style - void SetWindowStyleFlag(long style) ; - - // Searches for an item, starting from 'item'. - // item can be -1 to find the first item that matches the - // specified flags. - // Returns the item or -1 if unsuccessful. - long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ; - - // Implementation: converts wxWindows style to MSW style. - // Can be a single style flag or a bit list. - // oldStyle is 'normalised' so that it doesn't contain - // conflicting styles. - long ConvertToMSWStyle(long& oldStyle, long style) const; - - // Gets one of the three image lists - wxImageList *GetImageList(int which) const ; - - // Sets the image list - // N.B. There's a quirk in the Win95 list view implementation. - // If in wxLC_LIST mode, it'll *still* display images by the labels if - // there's a small-icon image list set for the control - even though you - // haven't specified wxLIST_MASK_IMAGE when inserting. - // So you have to set a NULL small-icon image list to be sure that - // the wxLC_LIST mode works without icons. Of course, you may want icons... - void SetImageList(wxImageList *imageList, int which) ; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Arranges the items - bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); - - // Deletes an item - bool DeleteItem(long item); - - // Deletes all items - bool DeleteAllItems() ; - - // Deletes a column - bool DeleteColumn(int col); - - // Deletes all columns - bool DeleteAllColumns(); - - // Clears items, and columns if there are any. - void ClearAll(); - - // Edit the label - wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - - // End label editing, optionally cancelling the edit - bool EndEditLabel(bool cancel); - - // Ensures this item is visible - bool EnsureVisible(long item) ; - - // Find an item whose label matches this string, starting from the item after 'start' - // or the beginning if 'start' is -1. - long FindItem(long start, const wxString& str, bool partial = FALSE); - - // Find an item whose data matches this data, starting from the item after 'start' - // or the beginning if 'start' is -1. - long FindItem(long start, long data); - - // Find an item nearest this position in the specified direction, starting from - // the item after 'start' or the beginning if 'start' is -1. - long FindItem(long start, const wxPoint& pt, int direction); - - // Determines which item (if any) is at the specified point, - // giving details in 'flags' (see wxLIST_HITTEST_... flags above) - long HitTest(const wxPoint& point, int& flags); - - // Inserts an item, returning the index of the new item if successful, - // -1 otherwise. - // TOD: Should also have some further convenience functions - // which don't require setting a wxListItem object - long InsertItem(wxListItem& info); - - // Insert a string item - long InsertItem(long index, const wxString& label); - - // Insert an image item - long InsertItem(long index, int imageIndex); - - // Insert an image/string item - long InsertItem(long index, const wxString& label, int imageIndex); - - // For list view mode (only), inserts a column. - long InsertColumn(long col, wxListItem& info); - - long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT, - int width = -1); - - // Scrolls the list control. If in icon, small icon or report view mode, - // x specifies the number of pixels to scroll. If in list view mode, x - // specifies the number of columns to scroll. - // If in icon, small icon or list view mode, y specifies the number of pixels - // to scroll. If in report view mode, y specifies the number of lines to scroll. - bool ScrollList(int dx, int dy); - - // Sort items. - - // fn is a function which takes 3 long arguments: item1, item2, data. - // item1 is the long data associated with a first item (NOT the index). - // item2 is the long data associated with a second item (NOT the index). - // data is the same value as passed to SortItems. - // The return value is a negative number if the first item should precede the second - // item, a positive number of the second item should precede the first, - // or zero if the two items are equivalent. - - // data is arbitrary data to be passed to the sort function. - bool SortItems(wxListCtrlCompare fn, long data); - -/* Why should we need this function? Leave for now. - * We might need it because item data may have changed, - * but the display needs refreshing (in string callback mode) - // Updates an item. If the list control has the wxLI_AUTO_ARRANGE style, - // the items will be rearranged. - bool Update(long item); -*/ - - void Command(wxCommandEvent& event) { ProcessCommand(event); }; - -protected: - wxTextCtrl* m_textCtrl; // The control used for editing a label - wxImageList * m_imageListNormal; // The image list for normal icons - wxImageList * m_imageListSmall; // The image list for small icons - wxImageList * m_imageListState; // The image list state icons (not implemented yet) - - long m_baseStyle; // Basic Windows style flags, for recreation purposes - wxStringList m_stringPool; // Pool of 3 strings to satisfy Windows callback - // requirements - int m_colCount; // Windows doesn't have GetColumnCount so must - // keep track of inserted/deleted columns - -}; - -class WXDLLEXPORT wxListEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxListEvent) - - public: - wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - - int m_code; - long m_itemIndex; - long m_oldItemIndex; - int m_col; - bool m_cancelled; - wxPoint m_pointDrag; - - wxListItem m_item; -}; - -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - -#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, - -#endif - // _WX_LISTCTRL_H_ diff --git a/include/wx/mac/carbon/macnotfy.h b/include/wx/mac/carbon/macnotfy.h deleted file mode 100644 index ae8a24e6de..0000000000 --- a/include/wx/mac/carbon/macnotfy.h +++ /dev/null @@ -1,33 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: Mac Notifier Support - * Name: macnotfy.h - * Author: Stefan CSomor - * Purpose: Mac Notifier include file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#ifndef MAC_NOTIFYERS -#define MAC_NOTIFYERS - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef void (*wxMacNotificationProcPtr)(unsigned long event , void* data ) ; - -typedef void *wxMacNotifierTableRef ; -void wxMacCreateNotifierTable() ; -void wxMacDestroyNotifierTable() ; -wxMacNotifierTableRef wxMacGetNotifierTable() ; -void wxMacAddEvent( wxMacNotifierTableRef table , wxMacNotificationProcPtr handler , unsigned long event , void* data , short wakeUp ) ; -void wxMacWakeUp() ; -void wxMacProcessNotifierEvents() ; -void wxMacProcessNotifierAndPendingEvents() ; -void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data ) ; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAC_NOTIFYERS */ \ No newline at end of file diff --git a/include/wx/mac/carbon/macsock.h b/include/wx/mac/carbon/macsock.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/wx/mac/carbon/mdi.h b/include/wx/mac/carbon/mdi.h deleted file mode 100644 index 1114ee525d..0000000000 --- a/include/wx/mac/carbon/mdi.h +++ /dev/null @@ -1,180 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.h -// Purpose: MDI (Multiple Document Interface) classes. -// This doesn't have to be implemented just like Windows, -// it could be a tabbed design as in wxGTK. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MDI_H_ -#define _WX_MDI_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "mdi.h" -#endif - -#include "wx/frame.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr; - -class WXDLLEXPORT wxMDIClientWindow; -class WXDLLEXPORT wxMDIChildFrame; - -class WXDLLEXPORT wxMDIParentFrame: public wxFrame -{ - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - -public: - - wxMDIParentFrame(); - inline wxMDIParentFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window - const wxString& name = wxFrameNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - ~wxMDIParentFrame(); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr); - - // Mac OS activate event - virtual void MacActivate(long timestamp, bool activating); - - // wxWindows activate event - void OnActivate(wxActivateEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - - void SetMenuBar(wxMenuBar *menu_bar); - - // Get the active MDI child window (Windows only) - wxMDIChildFrame *GetActiveChild() const ; - - // Get the client window - inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }; - - // Create the client window class (don't Create the window, - // just return a new class) - virtual wxMDIClientWindow *OnCreateClient() ; - - // MDI operations - virtual void Cascade(); - virtual void Tile(); - virtual void ArrangeIcons(); - virtual void ActivateNext(); - virtual void ActivatePrevious(); - -protected: - - // TODO maybe have this member - wxMDIClientWindow *m_clientWindow; - wxMDIChildFrame * m_currentChild; - wxMenu* m_windowMenu; - - // TRUE if MDI Frame is intercepting commands, not child - bool m_parentFrameActive; - -private: - friend class WXDLLEXPORT wxMDIChildFrame; -DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxMDIChildFrame: public wxFrame -{ -DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) -public: - - wxMDIChildFrame(); - inline wxMDIChildFrame(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init() ; - Create(parent, id, title, pos, size, style, name); - } - - ~wxMDIChildFrame(); - - bool Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - // Mac OS activate event - virtual void MacActivate(long timestamp, bool activating); - - // Set menu bar - void SetMenuBar(wxMenuBar *menu_bar); - - // MDI operations - virtual void Maximize(); - virtual void Maximize( bool ){ Maximize() ; } // this one is inherited from wxFrame - virtual void Restore(); - virtual void Activate(); -protected: - - // common part of all ctors - void Init(); -}; - -/* The client window is a child of the parent MDI frame, and itself - * contains the child MDI frames. - * However, you create the MDI children as children of the MDI parent: - * only in the implementation does the client window become the parent - * of the children. Phew! So the children are sort of 'adopted'... - */ - -class WXDLLEXPORT wxMDIClientWindow: public wxWindow -{ - DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) - public: - - wxMDIClientWindow() ; - inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0) - { - CreateClient(parent, style); - } - - ~wxMDIClientWindow(); - - // Note: this is virtual, to allow overridden behaviour. - virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); - - // Gets the size available for subwindows after menu size, toolbar size - // and status bar size have been subtracted. If you want to manage your own - // toolbar(s), don't call SetToolBar. - void DoGetClientSize(int *width, int *height) const; - - // Explicitly call default scroll behaviour - void OnScroll(wxScrollEvent& event); - -protected: - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_MDI_H_ diff --git a/include/wx/mac/carbon/menu.h b/include/wx/mac/carbon/menu.h deleted file mode 100644 index 854a70d107..0000000000 --- a/include/wx/mac/carbon/menu.h +++ /dev/null @@ -1,169 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.h -// Purpose: wxMenu, wxMenuBar classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MENU_H_ -#define _WX_MENU_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "menu.h" -#endif - -class WXDLLEXPORT wxFrame; - -#include "wx/arrstr.h" - -// ---------------------------------------------------------------------------- -// Menu -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenu : public wxMenuBase -{ -public: - // ctors & dtor - wxMenu(const wxString& title, long style = 0) - : wxMenuBase(title, style) { Init(); } - - wxMenu(long style = 0) : wxMenuBase(style) { Init(); } - - virtual ~wxMenu(); - - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - virtual void Attach(wxMenuBarBase *menubar) ; - - virtual void Break(); - - virtual void SetTitle(const wxString& title); - - // MSW-specific - bool ProcessCommand(wxCommandEvent& event); - - // implementation only from now on - // ------------------------------- - - int MacGetIndexFromId( int id ) ; - int MacGetIndexFromItem( wxMenuItem *pItem ) ; - void MacEnableMenu( bool bDoEnable ) ; - // MacOS needs to know about submenus somewhere within this menu - // before it can be displayed , also hide special menu items like preferences - // that are handled by the OS - void MacBeforeDisplay( bool isSubMenu ) ; - // undo all changes from the MacBeforeDisplay call - void MacAfterDisplay( bool isSubMenu ) ; - - // semi-private accessors - // get the window which contains this menu - wxWindow *GetWindow() const; - // get the menu handle - WXHMENU GetHMenu() const { return m_hMenu; } - - short MacGetMenuId() { return m_macMenuId ; } - -private: - // common part of all ctors - void Init(); - - // common part of Append/Insert (behaves as Append is pos == (size_t)-1) - bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1); - - // terminate the current radio group, if any - void EndRadioGroup(); - - // if TRUE, insert a breal before appending the next item - bool m_doBreak; - - // the position of the first item in the current radio group or -1 - int m_startRadioGroup; - - // the menu handle of this menu - WXHMENU m_hMenu; - - short m_macMenuId; - - static short s_macNextMenuId ; - - DECLARE_DYNAMIC_CLASS(wxMenu) -}; - -// ---------------------------------------------------------------------------- -// Menu Bar (a la Windows) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase -{ -public: - // ctors & dtor - // default constructor - wxMenuBar(); - // unused under MSW - wxMenuBar(long style); - // menubar takes ownership of the menus arrays but copies the titles - wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); - virtual ~wxMenuBar(); - - // menubar construction - virtual bool Append( wxMenu *menu, const wxString &title ); - virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); - virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title); - virtual wxMenu *Remove(size_t pos); - - virtual int FindMenuItem(const wxString& menuString, - const wxString& itemString) const; - virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const; - - virtual void EnableTop( size_t pos, bool flag ); - virtual void SetLabelTop( size_t pos, const wxString& label ); - virtual wxString GetLabelTop( size_t pos ) const; - - // implementation from now on - WXHMENU Create(); - int FindMenu(const wxString& title); - void Detach(); - - // returns TRUE if we're attached to a frame - bool IsAttached() const { return m_menuBarFrame != NULL; } - // get the frame we live in - wxFrame *GetFrame() const { return m_menuBarFrame; } - // attach to a frame - void Attach(wxFrame *frame); - - // clear the invoking window for all menus and submenus - void UnsetInvokingWindow() ; - - // set the invoking window for all menus and submenus - void SetInvokingWindow( wxFrame* frame ) ; - - // if the menubar is modified, the display is not updated automatically, - // call this function to update it (m_menuBarFrame should be !NULL) - void Refresh(bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL); - - void MacInstallMenuBar() ; - static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; } - static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; } - static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; } - -protected: - // common part of all ctors - void Init(); - wxWindow *m_invokingWindow; - - wxArrayString m_titles; - -private: - static wxMenuBar* s_macInstalledMenuBar ; - static wxMenuBar* s_macCommonMenuBar ; - - DECLARE_DYNAMIC_CLASS(wxMenuBar) -}; - -#endif // _WX_MENU_H_ diff --git a/include/wx/mac/carbon/menuitem.h b/include/wx/mac/carbon/menuitem.h deleted file mode 100644 index 7e78a57f63..0000000000 --- a/include/wx/mac/carbon/menuitem.h +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.h -// Purpose: wxMenuItem class -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.11.97 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MENUITEM_H -#define _MENUITEM_H - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "menuitem.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/setup.h" - -// ---------------------------------------------------------------------------- -// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour -// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenuItem: public wxMenuItemBase -{ -public: - // ctor & dtor - wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL, - int id = wxID_SEPARATOR, - const wxString& name = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL, - wxMenu *subMenu = (wxMenu *)NULL); - virtual ~wxMenuItem(); - - // override base class virtuals - virtual void SetText(const wxString& strName); - - virtual void Enable(bool bDoEnable = TRUE); - virtual void Check(bool bDoCheck = TRUE); - - virtual void SetBitmap(const wxBitmap& bitmap) ; - virtual const wxBitmap& GetBitmap() const { return m_bitmap; } - - // update the os specific representation - void UpdateItemBitmap() ; - void UpdateItemText() ; - void UpdateItemStatus() ; - - // mark item as belonging to the given radio group - void SetAsRadioGroupStart(); - void SetRadioGroupStart(int start); - void SetRadioGroupEnd(int end); - -private: - void UncheckRadio() ; - - // the positions of the first and last items of the radio group this item - // belongs to or -1: start is the radio group start and is valid for all - // but first radio group items (m_isRadioGroupStart == FALSE), end is valid - // only for the first one - union - { - int start; - int end; - } m_radioGroup; - - // does this item start a radio group? - bool m_isRadioGroupStart; - - wxBitmap m_bitmap; // Bitmap for menuitem, if any - void* m_menu ; // the appropriate menu , may also be a system menu - - DECLARE_DYNAMIC_CLASS(wxMenuItem) -}; - -#endif //_MENUITEM_H diff --git a/include/wx/mac/carbon/metafile.h b/include/wx/mac/carbon/metafile.h deleted file mode 100644 index 2b528efeca..0000000000 --- a/include/wx/mac/carbon/metafile.h +++ /dev/null @@ -1,166 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: metafile.h -// Purpose: wxMetaFile, wxMetaFileDC classes. -// This probably should be restricted to Windows platforms, -// but if there is an equivalent on your platform, great. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_METAFIILE_H_ -#define _WX_METAFIILE_H_ - -#if wxUSE_METAFILE -#include "wx/dc.h" -#include "wx/gdiobj.h" - -#if wxUSE_DATAOBJ -#include "wx/dataobj.h" -#endif - -/* - * Metafile and metafile device context classes - * - */ - -#define wxMetaFile wxMetafile -#define wxMetaFileDC wxMetafileDC - -class WXDLLEXPORT wxMetafile; - -class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxMetafile; -public: - wxMetafileRefData(void); - ~wxMetafileRefData(void); - -public: - WXHMETAFILE m_metafile; -}; - -#define M_METAFILEDATA ((wxMetafileRefData *)m_refData) - -class WXDLLEXPORT wxMetafile: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxMetafile) -public: - // Copy constructor - wxMetafile(const wxMetafile& metafile) - : wxGDIObject() - { Ref(metafile); } - - wxMetafile(const wxString& file = wxEmptyString); - ~wxMetafile(void); - - // After this is called, the metafile cannot be used for anything - // since it is now owned by the clipboard. - virtual bool SetClipboard(int width = 0, int height = 0); - - virtual bool Play(wxDC *dc); - inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); }; - - wxSize GetSize() const; - int GetWidth() const { return GetSize().x; } - int GetHeight() const { return GetSize().y; } - - // Implementation - inline WXHMETAFILE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; } - void SetHMETAFILE(WXHMETAFILE mf) ; - - // Operators - inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; } - inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; } - inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; } - -protected: -}; - -class WXDLLEXPORT wxMetafileDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxMetafileDC) - - public: - // the ctor parameters specify the filename (empty for memory metafiles), - // the metafile picture size and the optional description/comment - wxMetafileDC(const wxString& filename = wxEmptyString, - int width = 0, int height = 0, - const wxString& description = wxEmptyString); - - ~wxMetafileDC(void); - - // Should be called at end of drawing - virtual wxMetafile *Close(void); - virtual void DoGetSize(int *width, int *height) const ; - - // Implementation - inline wxMetafile *GetMetaFile(void) const { return m_metaFile; } - inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } - -protected: - wxMetafile* m_metaFile; -}; - -/* - * Pass filename of existing non-placeable metafile, and bounding box. - * Adds a placeable metafile header, sets the mapping mode to anisotropic, - * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode. - * - */ - -// No origin or extent -#define wxMakeMetaFilePlaceable wxMakeMetafilePlaceable -bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0); - -// Optional origin and extent -bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE); - -// ---------------------------------------------------------------------------- -// wxMetafileDataObject is a specialization of wxDataObject for metafile data -// ---------------------------------------------------------------------------- - -#if wxUSE_DATAOBJ -class WXDLLEXPORT wxMetafileDataObject : public wxDataObjectSimple -{ -public: - // ctors - wxMetafileDataObject() - : wxDataObjectSimple(wxDF_METAFILE) { }; - wxMetafileDataObject(const wxMetafile& metafile) - : wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { } - - // virtual functions which you may override if you want to provide data on - // demand only - otherwise, the trivial default versions will be used - virtual void SetMetafile(const wxMetafile& metafile) - { m_metafile = metafile; } - virtual wxMetafile GetMetafile() const - { return m_metafile; } - - // implement base class pure virtuals - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t len, const void *buf); - - virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const - { return GetDataSize(); } - virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format), - void *buf) const - { return GetDataHere(buf); } - virtual bool SetData(const wxDataFormat& WXUNUSED(format), - size_t len, const void *buf) - { return SetData(len, buf); } -protected: - wxMetafile m_metafile; -}; -#endif - -#endif // wxUSE_METAFILE - - -#endif - // _WX_METAFIILE_H_ diff --git a/include/wx/mac/carbon/mimetype.h b/include/wx/mac/carbon/mimetype.h deleted file mode 100644 index a65acd964c..0000000000 --- a/include/wx/mac/carbon/mimetype.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/mimetype.h -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifndef _MIMETYPE_IMPL_H -#define _MIMETYPE_IMPL_H - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "mimetype.h" -#endif - -#include "wx/defs.h" -#include "wx/mimetype.h" - - -class wxMimeTypesManagerImpl -{ -public : - wxMimeTypesManagerImpl() { } -#ifdef __DARWIN__ - ~wxMimeTypesManagerImpl() { } -#endif - - // load all data into memory - done when it is needed for the first time - void Initialize(int mailcapStyles = wxMAILCAP_STANDARD, - const wxString& extraDir = wxEmptyString); - - // and delete the data here - void ClearData(); - - // implement containing class functions - wxFileType *GetFileTypeFromExtension(const wxString& ext); - wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ; - wxFileType *GetFileTypeFromMimeType(const wxString& mimeType); - - size_t EnumAllFileTypes(wxArrayString& mimetypes); - - // this are NOPs under MacOS - bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE) { return TRUE; } - bool ReadMimeTypes(const wxString& WXUNUSED(filename)) { return TRUE; } - - void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); } - - // create a new filetype association - wxFileType *Associate(const wxFileTypeInfo& ftInfo); - // remove association - bool Unassociate(wxFileType *ft); - - // create a new filetype with the given name and extension - wxFileType *CreateFileType(const wxString& filetype, const wxString& ext); - -private: - wxArrayFileTypeInfo m_fallbacks; -}; - -class wxFileTypeImpl -{ -public: - // initialization functions - // this is used to construct a list of mimetypes which match; - // if built with GetFileTypeFromMimetype index 0 has the exact match and - // index 1 the type / * match - // if built with GetFileTypeFromExtension, index 0 has the mimetype for - // the first extension found, index 1 for the second and so on - - void Init(wxMimeTypesManagerImpl *manager, size_t index) - { m_manager = manager; m_index.Add(index); } - - // initialize us with our file type name - void SetFileType(const wxString& strFileType) - { m_strFileType = strFileType; } - void SetExt(const wxString& ext) - { m_ext = ext; } - - // implement accessor functions - bool GetExtensions(wxArrayString& extensions); - bool GetMimeType(wxString *mimeType) const; - bool GetMimeTypes(wxArrayString& mimeTypes) const; - bool GetIcon(wxIconLocation *iconLoc) const; - bool GetDescription(wxString *desc) const; - bool GetOpenCommand(wxString *openCmd, - const wxFileType::MessageParameters&) const - { return GetCommand(openCmd, "open"); } - bool GetPrintCommand(wxString *printCmd, - const wxFileType::MessageParameters&) const - { return GetCommand(printCmd, "print"); } - - size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands, - const wxFileType::MessageParameters& params) const; - - // remove the record for this file type - // probably a mistake to come here, use wxMimeTypesManager.Unassociate (ft) instead - bool Unassociate(wxFileType *ft) - { - return m_manager->Unassociate(ft); - } - - // set an arbitrary command, ask confirmation if it already exists and - // overwriteprompt is TRUE - bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = TRUE); - bool SetDefaultIcon(const wxString& strIcon = wxEmptyString, int index = 0); - - private: - // helper function - bool GetCommand(wxString *command, const char *verb) const; - - wxMimeTypesManagerImpl *m_manager; - wxArrayInt m_index; // in the wxMimeTypesManagerImpl arrays - wxString m_strFileType, m_ext; -}; - -#endif - //_MIMETYPE_H - -/* vi: set cin tw=80 ts=4 sw=4: */ diff --git a/include/wx/mac/carbon/minifram.h b/include/wx/mac/carbon/minifram.h deleted file mode 100644 index 7f43f953b3..0000000000 --- a/include/wx/mac/carbon/minifram.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: minifram.h -// Purpose: wxMiniFrame class. A small frame for e.g. floating toolbars. -// If there is no equivalent on your platform, just make it a -// normal frame. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MINIFRAM_H_ -#define _WX_MINIFRAM_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "minifram.h" -#endif - -#include "wx/frame.h" - -class WXDLLEXPORT wxMiniFrame: public wxFrame { - - DECLARE_DYNAMIC_CLASS(wxMiniFrame) - -public: - inline wxMiniFrame() {} - inline wxMiniFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, - const wxString& name = wxFrameNameStr) - { - // Use wxFrame constructor in absence of more specific code. - Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT , name); - } - - ~wxMiniFrame() {} -protected: -}; - -#endif - // _WX_MINIFRAM_H_ diff --git a/include/wx/mac/carbon/msgdlg.h b/include/wx/mac/carbon/msgdlg.h deleted file mode 100644 index 1a869f0855..0000000000 --- a/include/wx/mac/carbon/msgdlg.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msgdlg.h -// Purpose: wxMessageDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSGBOXDLG_H_ -#define _WX_MSGBOXDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "msgdlg.h" -#endif - -#include "wx/setup.h" -#include "wx/dialog.h" - -/* - * Message box dialog - */ - -WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr; - -class WXDLLEXPORT wxMessageDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxMessageDialog) - -protected: - wxString m_caption; - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; -public: - wxMessageDialog(wxWindow *parent, - const wxString& message, - const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK|wxCENTRE, - const wxPoint& pos = wxDefaultPosition); - - int ShowModal(); - - // not supported for message dialog, RR - virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} - -}; - -#endif - // _WX_MSGBOXDLG_H_ diff --git a/include/wx/mac/carbon/notebook.h b/include/wx/mac/carbon/notebook.h deleted file mode 100644 index 7f3724805c..0000000000 --- a/include/wx/mac/carbon/notebook.h +++ /dev/null @@ -1,157 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: notebook.h -// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet) -// Author: Stefan Csomor -// Modified by: -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NOTEBOOK_H_ -#define _WX_NOTEBOOK_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "notebook.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// fwd declarations -class WXDLLEXPORT wxImageList; -class WXDLLEXPORT wxWindow; - -// ---------------------------------------------------------------------------- -// wxNotebook -// ---------------------------------------------------------------------------- - -// @@@ this class should really derive from wxTabCtrl, but the interface is not -// exactly the same, so I can't do it right now and instead we reimplement -// part of wxTabCtrl here -class wxNotebook : public wxNotebookBase -{ -public: - // ctors - // ----- - // default for dynamic class - wxNotebook(); - // the same arguments as for wxControl (@@@ any special styles?) - wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("notebook")); - // Create() function - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("notebook")); - // dtor - ~wxNotebook(); - - // accessors - // --------- - // set the currently selected page, return the index of the previously - // selected one (or -1 on error) - // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events - int SetSelection(size_t nPage); - // get the currently selected page - int GetSelection() const { return m_nSelection; } - - // set/get the title of a page - bool SetPageText(size_t nPage, const wxString& strText); - wxString GetPageText(size_t nPage) const; - - // sets/returns item's image index in the current image list - int GetPageImage(size_t nPage) const; - bool SetPageImage(size_t nPage, int nImage); - - // control the appearance of the notebook pages - // set the size (the same for all pages) - virtual void SetPageSize(const wxSize& size); - // set the padding between tabs (in pixels) - virtual void SetPadding(const wxSize& padding); - // sets the size of the tabs (assumes all tabs are the same size) - virtual void SetTabSize(const wxSize& sz); - - // calculate size for wxNotebookSizer - wxSize CalcSizeFromPage(const wxSize& sizePage) const; - wxRect GetPageRect() const ; -/* - // get number of pages in the dialog - int GetPageCount() const; - - // cycle thru the tabs - void AdvanceSelection(bool bForward = TRUE); - - - // currently it's always 1 because wxGTK doesn't support multi-row - // tab controls - int GetRowCount() const; -*/ - // operations - // ---------- - // remove all pages - bool DeleteAllPages(); - // the same as AddPage(), but adds it at the specified position - bool InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect = FALSE, - int imageId = -1); -/* - // get the panel which represents the given page - wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; } -*/ - // callbacks - // --------- - void OnSize(wxSizeEvent& event); - void OnSelChange(wxNotebookEvent& event); - void OnSetFocus(wxFocusEvent& event); - void OnNavigationKey(wxNavigationKeyEvent& event); - void OnMouse(wxMouseEvent &event); - - // implementation - // -------------- - -#if wxUSE_CONSTRAINTS - virtual void SetConstraintSizes(bool recurse = TRUE); - virtual bool DoPhase(int nPhase); - -#endif - - // base class virtuals - // ------------------- - virtual void Command(wxCommandEvent& event); -protected: - virtual wxSize DoGetBestSize() const ; - virtual wxNotebookPage *DoRemovePage(size_t page) ; - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - // common part of all ctors - void Init(); - - // helper functions - void ChangePage(int nOldSel, int nSel); // change pages - void MacSetupTabs(); - - // the icon indices - wxArrayInt m_images; - - int m_nSelection; // the current selection (-1 if none) - - DECLARE_DYNAMIC_CLASS(wxNotebook) - DECLARE_EVENT_TABLE() -}; - - -#endif // _WX_NOTEBOOK_H_ diff --git a/include/wx/mac/carbon/palette.h b/include/wx/mac/carbon/palette.h deleted file mode 100644 index 74f9a4dd30..0000000000 --- a/include/wx/mac/carbon/palette.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.h -// Purpose: wxPalette class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PALETTE_H_ -#define _WX_PALETTE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "palette.h" -#endif - -#include "wx/colour.h" -#include "wx/gdiobj.h" - -class WXDLLEXPORT wxPalette; - -class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData -{ - DECLARE_NO_COPY_CLASS(wxPaletteRefData) - - friend class WXDLLEXPORT wxPalette; -public: - wxPaletteRefData(); - ~wxPaletteRefData(); -protected: - wxColour* m_palette; - wxInt32 m_count ; -}; - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -class WXDLLEXPORT wxPalette: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxPalette) - -public: - wxPalette(); - wxPalette(const wxPalette& palette) - : wxGDIObject() - { Ref(palette); } - - wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - ~wxPalette(); - bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const; - bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; - - virtual bool Ok() const { return (m_refData != NULL) ; } - - inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; } - inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } - inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } - -/* TODO: implementation - inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } - void SetHPALETTE(WXHPALETTE pal); -*/ -}; - -#endif - // _WX_PALETTE_H_ diff --git a/include/wx/mac/carbon/pen.h b/include/wx/mac/carbon/pen.h deleted file mode 100644 index 50afa0d9c4..0000000000 --- a/include/wx/mac/carbon/pen.h +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/pen.h -// Purpose: wxPen class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PEN_H_ -#define _WX_PEN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pen.h" -#endif - -#include "wx/gdiobj.h" -#include "wx/colour.h" -#include "wx/bitmap.h" - -class WXDLLEXPORT wxPen; - -class WXDLLEXPORT wxPenRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxPen; -public: - wxPenRefData(); - wxPenRefData(const wxPenRefData& data); - ~wxPenRefData(); - - wxPenRefData& operator=(const wxPenRefData& data); - -protected: - int m_width; - int m_style; - int m_join ; - int m_cap ; - wxBitmap m_stipple ; - int m_nbDash ; - wxDash * m_dash ; - wxColour m_colour; -/* TODO: implementation - WXHPEN m_hPen; -*/ -}; - -#define M_PENDATA ((wxPenRefData *)m_refData) - -// Pen -class WXDLLEXPORT wxPen: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxPen) -public: - wxPen(); - wxPen(const wxColour& col, int width = 1, int style = wxSOLID); - wxPen(const wxBitmap& stipple, int width); - wxPen(const wxPen& pen) - : wxGDIObject() - { Ref(pen); } - ~wxPen(); - - inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } - inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; } - inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; } - - virtual bool Ok() const { return (m_refData != NULL) ; } - - // Override in order to recreate the pen - void SetColour(const wxColour& col) ; - void SetColour(unsigned char r, unsigned char g, unsigned char b) ; - - void SetWidth(int width) ; - void SetStyle(int style) ; - void SetStipple(const wxBitmap& stipple) ; - void SetDashes(int nb_dashes, const wxDash *dash) ; - void SetJoin(int join) ; - void SetCap(int cap) ; - - inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); }; - inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); }; - inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); }; - inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); }; - inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); }; - inline int GetDashes(wxDash **ptr) const { - *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0); - } - - inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); }; - -// Implementation - - // Useful helper: create the brush resource - bool RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_PEN_H_ diff --git a/include/wx/mac/carbon/pnghand.h b/include/wx/mac/carbon/pnghand.h deleted file mode 100644 index 19271c4705..0000000000 --- a/include/wx/mac/carbon/pnghand.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pnghand.h -// Purpose: PNG bitmap handler -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pnghand.h" -#endif - -#ifndef _WX_PNGHAND_H_ -#define _WX_PNGHAND_H_ - -class WXDLLEXPORT wxPNGFileHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxPNGFileHandler) -public: - inline wxPNGFileHandler(void) - { - m_name = wxT("PNG bitmap file"); - m_extension = wxT("bmp"); - m_type = wxBITMAP_TYPE_PNG; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); - virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); -}; - -#endif - // _WX_PNGHAND_H_ - diff --git a/include/wx/mac/carbon/pngread.h b/include/wx/mac/carbon/pngread.h deleted file mode 100644 index d1a8b96a5a..0000000000 --- a/include/wx/mac/carbon/pngread.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * File: pngread.h - * Purpose: PNG file reader - * Author: Alejandro Aguilar Sierra/Julian Smart - * Created: 1995 - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * - */ - -#ifndef _WX_PNGREAD__ -#define _WX_PNGREAD__ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pngread.h" -#endif - -#ifndef byte -typedef unsigned char byte; -#endif - -#define WXIMA_COLORS DIB_PAL_COLORS - -typedef byte * ImagePointerType; - -typedef struct -{ - byte red; - byte green; - byte blue; -} rgb_color_struct; - - -#define COLORTYPE_PALETTE 1 -#define COLORTYPE_COLOR 2 -#define COLORTYPE_ALPHA 4 - -class wxPNGReader -{ -protected: - int filetype; - char filename[255]; - ImagePointerType RawImage; // Image data - - int Width, Height; // Dimensions - int Depth; // (bits x pixel) - int ColorType; // Bit 1 = Palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - long EfeWidth; // Efective Width - - void *lpbi; - int bgindex; - wxPalette* m_palette; - bool imageOK; -friend class wxPNGReaderIter; -public: - wxPNGReader(void); - wxPNGReader (char* ImageFileName); // Read an image file - virtual ~wxPNGReader (); - - void Create(int width, int height, int deep, int colortype=-1); - - bool ReadFile( char* ImageFileName=0 ); - bool SaveFile( char* ImageFileName=0 ); - bool SaveXPM(char *filename, char *name = 0); - int GetWidth( void ) const { return Width; }; - int GetHeight( void ) const { return Height; }; - int GetDepth( void ) const { return Depth; }; - int GetColorType( void ) const { return ColorType; }; - - int GetIndex(int x, int y); - bool GetRGB(int x, int y, byte* r, byte* g, byte* b); - - bool SetIndex(int x, int y, int index); - bool SetRGB(int x, int y, byte r, byte g, byte b); - - // ColorMap settings - bool SetPalette(wxPalette* colourmap); - bool SetPalette(int n, rgb_color_struct *rgb_struct); - bool SetPalette(int n, byte *r, byte *g=0, byte *b=0); - wxPalette* GetPalette() const { return m_palette; } - - void NullData(); - inline int GetBGIndex(void) { return bgindex; } - - inline bool Inside(int x, int y) - { return (0<=y && yRawImage; - Itx = Ity = 0; - Stepx = Stepy = 0; -} - -inline -wxPNGReaderIter::operator wxPNGReader* () -{ - return ima; -} - -inline -bool wxPNGReaderIter::ItOK () -{ - if (ima) - return ima->Inside(Itx, Ity); - else - return FALSE; -} - - -inline void wxPNGReaderIter::reset() -{ - IterImage = ima->RawImage; - Itx = Ity = 0; -} - -inline void wxPNGReaderIter::upset() -{ - Itx = 0; - Ity = ima->Height-1; - IterImage = ima->RawImage + ima->EfeWidth*(ima->Height-1); -} - -inline bool wxPNGReaderIter::NextRow() -{ - if (++Ity >= ima->Height) return 0; - IterImage += ima->EfeWidth; - return 1; -} - -inline bool wxPNGReaderIter::PrevRow() -{ - if (--Ity < 0) return 0; - IterImage -= ima->EfeWidth; - return 1; -} - -////////////////////////// AD - for interlace /////////////////////////////// -inline void wxPNGReaderIter::SetY(int y) -{ - if ((y < 0) || (y > ima->Height)) return; - Ity = y; - IterImage = ima->RawImage + ima->EfeWidth*y; -} - -///////////////////////////////////////////////////////////////////////////// - -inline void wxPNGReaderIter::SetRow(byte *buf, int n) -{ -// Here should be bcopy or memcpy - //_fmemcpy(IterImage, (void far *)buf, n); - if (n<0) - n = ima->GetWidth(); - - for (int i=0; iEfeWidth) - return 1; - else - if (++Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::PrevByte() -{ - if (--Itx >= 0) - return 1; - else - if (--Ity >= 0) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::NextStep() -{ - Itx += Stepx; - if (Itx < ima->EfeWidth) - return 1; - else { - Ity += Stepy; - if (Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -inline bool wxPNGReaderIter::PrevStep() -{ - Itx -= Stepx; - if (Itx >= 0) - return 1; - else { - Ity -= Stepy; - if (Ity >= 0 && Ity < ima->Height) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -#endif - diff --git a/include/wx/mac/carbon/printdlg.h b/include/wx/mac/carbon/printdlg.h deleted file mode 100644 index 6bb45dad2f..0000000000 --- a/include/wx/mac/carbon/printdlg.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.h -// Purpose: wxPrintDialog, wxPageSetupDialog classes. -// Use generic, PostScript version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTDLG_H_ -#define _WX_PRINTDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "printdlg.h" -#endif - -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * wxPrinterDialog - * The common dialog for printing. - */ - -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxPrintDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxPrintDialog) - - public: - wxPrintDialog(); - wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL); - wxPrintDialog(wxWindow *parent, wxPrintData* data ); - ~wxPrintDialog(); - - bool Create(wxWindow *parent, wxPrintDialogData* data = NULL); - virtual int ShowModal(); - - wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } - wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); } - virtual wxDC *GetPrintDC(); - - private: - wxPrintDialogData m_printDialogData; - wxDC* m_printerDC; - bool m_destroyDC; - wxWindow* m_dialogParent; -}; - -class WXDLLEXPORT wxPageSetupDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxPageSetupDialog) - - public: - wxPageSetupDialog(); - wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL); - ~wxPageSetupDialog(); - - bool Create(wxWindow *parent, wxPageSetupData *data = NULL); - virtual int ShowModal(); - - inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; } - private: - wxPageSetupData m_pageSetupData; - wxWindow* m_dialogParent; -}; - -#endif - // _WX_PRINTDLG_H_ diff --git a/include/wx/mac/carbon/printmac.h b/include/wx/mac/carbon/printmac.h deleted file mode 100644 index c5eb431026..0000000000 --- a/include/wx/mac/carbon/printmac.h +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printwin.h -// Purpose: wxWindowsPrinter, wxWindowsPrintPreview classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTWIN_H_ -#define _WX_PRINTWIN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "printwin.h" -#endif - -#include "wx/prntbase.h" - -/* - * Represents the printer: manages printing a wxPrintout object - */ - -class WXDLLEXPORT wxMacPrinter: public wxPrinterBase -{ - DECLARE_DYNAMIC_CLASS(wxMacPrinter) - - public: - wxMacPrinter(wxPrintDialogData *data = NULL); - virtual ~wxMacPrinter(); - - virtual bool Print(wxWindow *parent, - wxPrintout *printout, - bool prompt = TRUE); - virtual wxDC* PrintDialog(wxWindow *parent); - virtual bool Setup(wxWindow *parent); - -}; - -/* - * wxPrintPreview - * Programmer creates an object of this class to preview a wxPrintout. - */ - -class WXDLLEXPORT wxMacPrintPreview: public wxPrintPreviewBase -{ - DECLARE_CLASS(wxMacPrintPreview) - - public: - wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting = NULL, - wxPrintDialogData *data = NULL); - wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - virtual ~wxMacPrintPreview(); - - virtual bool Print(bool interactive); - virtual void DetermineScaling(); -}; - -#endif - // _WX_PRINTWIN_H_ diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h deleted file mode 100644 index 2f0c5cb7e0..0000000000 --- a/include/wx/mac/carbon/private.h +++ /dev/null @@ -1,238 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: private.h -// Purpose: Private declarations: as this header is only included by -// wxWindows itself, it may contain identifiers which don't start -// with "wx". -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_H_ -#define _WX_PRIVATE_H_ - -#include "wx/defs.h" -#include "wx/app.h" - -#ifdef __DARWIN__ -# include -#else -# include -# include -# include -# include -# include -# include -# include -#endif - -#if UNIVERSAL_INTERFACES_VERSION < 0x0340 - #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/" -#endif - -#if wxUSE_GUI - -#include "wx/window.h" - -class wxMacPortStateHelper -{ - DECLARE_NO_COPY_CLASS(wxMacPortStateHelper) - -public: - wxMacPortStateHelper( GrafPtr newport) ; - wxMacPortStateHelper() ; - ~wxMacPortStateHelper() ; - - void Setup( GrafPtr newport ) ; - void Clear() ; - bool IsCleared() { return m_clip == NULL ; } - GrafPtr GetCurrentPort() { return m_currentPort ; } - -private: - GrafPtr m_currentPort ; - GrafPtr m_oldPort ; - RgnHandle m_clip ; - ThemeDrawingState m_drawingState ; - short m_textFont ; - short m_textSize ; - short m_textStyle ; - short m_textMode ; -} ; - -class WXDLLEXPORT wxMacPortSetter -{ - DECLARE_NO_COPY_CLASS(wxMacPortSetter) - -public: - wxMacPortSetter( const wxDC* dc ) ; - ~wxMacPortSetter() ; -private: - wxMacPortStateHelper m_ph ; - const wxDC* m_dc ; -} ; - -class WXDLLEXPORT wxMacWindowClipper -{ - DECLARE_NO_COPY_CLASS(wxMacWindowClipper) - -public: - wxMacWindowClipper( const wxWindow* win ) ; - ~wxMacWindowClipper() ; -private: - RgnHandle m_formerClip ; - RgnHandle m_newClip ; -} ; - -class wxMacDrawingHelper -{ - DECLARE_NO_COPY_CLASS(wxMacDrawingHelper) - -public: - wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ; - ~wxMacDrawingHelper() ; - bool Ok() { return m_ok ; } - void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; } - void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; } - void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; } - const Point& GetOrigin() { return m_origin ; } -private: - Point m_origin ; - GrafPtr m_formerPort ; - GrafPtr m_currentPort ; - PenState m_savedPenState ; - bool m_ok ; -} ; - -// app.h -bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec) ; - -#endif // wxUSE_GUI - -// filefn.h -WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ; -WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ; -WXDLLEXPORT void wxMacFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; -# ifndef __DARWIN__ -// Mac file names are POSIX (Unix style) under Darwin, so these are not needed -WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ; -WXDLLEXPORT void wxUnixFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; -WXDLLEXPORT wxString wxMac2UnixFilename( const wxChar *s) ; -WXDLLEXPORT wxString wxUnix2MacFilename( const wxChar *s); -# endif - -// utils.h -WXDLLEXPORT wxString wxMacFindFolder(short vRefNum, - OSType folderType, - Boolean createFolder); - -#if wxUSE_GUI - -GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ; -void wxMacDestroyGWorld( GWorldPtr gw ) ; -PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ; -CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ; -void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ; -CTabHandle wxMacCreateColorTable( int numColors ) ; -void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType = 0 ) ; - -#define MAC_WXCOLORREF(a) (*((RGBColor*)&(a))) -#define MAC_WXHBITMAP(a) (GWorldPtr(a)) -#define MAC_WXHMETAFILE(a) (PicHandle(a)) -#define MAC_WXHICON(a) (CIconHandle(a)) -#define MAC_WXHCURSOR(a) (CursHandle(a)) -#define MAC_WXHRGN(a) (RgnHandle(a)) -#define MAC_WXHWND(a) (WindowPtr(a)) -#define MAC_WXRECPTR(a) ((Rect*)a) -#define MAC_WXPOINTPTR(a) ((Point*)a) -#define MAC_WXHMENU(a) ((MenuHandle)a) - -#endif // wxUSE_GUI - -//--------------------------------------------------------------------------- -// wxMac string conversions -//--------------------------------------------------------------------------- - -void wxMacSetupConverters() ; -void wxMacCleanupConverters() ; - -void wxMacStringToPascal( const wxString&from , StringPtr to ) ; -wxString wxMacMakeStringFromPascal( ConstStringPtr from ) ; - -void wxMacConvertNewlines13To10( char * data ) ; -void wxMacConvertNewlines10To13( char * data ) ; -void wxMacConvertNewlines13To10( wxString *data ) ; -void wxMacConvertNewlines10To13( wxString *data ) ; - -#if wxUSE_UNICODE -void wxMacConvertNewlines13To10( wxChar * data ) ; -void wxMacConvertNewlines10To13( wxChar * data ) ; -#endif - -#if TARGET_CARBON - -class wxMacCFStringHolder -{ -public: - wxMacCFStringHolder() - { - m_cfs = NULL ; - m_release = false ; - } - - wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) - { - m_cfs = NULL ; - m_release = false ; - Assign( str , encoding ) ; - } - - wxMacCFStringHolder(CFStringRef ref , bool release = true ) - { - m_cfs = ref ; - m_release = release ; - } - - ~wxMacCFStringHolder() - { - Release() ; - } - - CFStringRef Detach() - { - CFStringRef retval = m_cfs ; - m_release = false ; - m_cfs = NULL ; - return retval ; - } - - void Release() - { - if ( m_release && m_cfs) - CFRelease( m_cfs ) ; - m_cfs = NULL ; - } - - void Assign( const wxString &str , wxFontEncoding encoding ) ; - - operator CFStringRef () { return m_cfs; } - wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; - -private: - - CFStringRef m_cfs; - bool m_release ; -} ; - -#endif - - - -wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) ; -wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) ; - - -#endif - // _WX_PRIVATE_H_ diff --git a/include/wx/mac/carbon/private/hid.h b/include/wx/mac/carbon/private/hid.h deleted file mode 100644 index 2947ee3575..0000000000 --- a/include/wx/mac/carbon/private/hid.h +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include - -//Utility wrapper around CFArray -class wxCFArray -{ -public: - wxCFArray(CFTypeRef pData) : pArray((CFArrayRef) pData) {} - CFTypeRef operator [] (const int& nIndex) {return CFArrayGetValueAtIndex(pArray, nIndex); } - int Count() {return CFArrayGetCount(pArray);} -private: - CFArrayRef pArray; -}; - -// -// A wrapper around OS X HID Manager procedures. -// The tutorial "Working With HID Class Device Interfaces" Is -// Quite good, as is the sample program associated with it -// (Depite the author's protests!). -class wxHIDDevice -{ -public: - wxHIDDevice() : m_ppDevice(NULL), m_ppQueue(NULL), m_pCookies(NULL) {} - //kHIDPage_GenericDesktop - //kHIDUsage_GD_Joystick,kHIDUsage_GD_Mouse,kHIDUsage_GD_Keyboard - bool Create (const int& nClass = -1, const int& nType = -1); - - inline void AddCookie(CFTypeRef Data, const int& i); - inline void AddCookieInQueue(CFTypeRef Data, const int& i); - inline void InitCookies(const size_t& dwSize, bool bQueue = false); - - //Must be implemented by derived classes - //builds the cookie array - - //first call InitCookies to initialize the cookie - //array, then AddCookie to add a cookie at a certain point in an array - virtual void BuildCookies(wxCFArray& Array) = 0; - - //checks to see whether the cookie at index nIndex is active (element value != 0) - bool IsActive(const int& nIndex); - - //closes the device and cleans the queue and cookies - virtual ~wxHIDDevice(); -private: - IOHIDDeviceInterface** m_ppDevice; //this, essentially - IOHIDQueueInterface** m_ppQueue; //queue (if we want one) - IOHIDElementCookie* m_pCookies; //cookies - - const char* m_szName; //(product) name - mach_port_t m_pPort; -}; - -class wxHIDKeyboard : public wxHIDDevice -{ -public: - bool Create(); - virtual void BuildCookies(wxCFArray& Array); -}; \ No newline at end of file diff --git a/include/wx/mac/carbon/private/print.h b/include/wx/mac/carbon/private/print.h deleted file mode 100644 index d406494902..0000000000 --- a/include/wx/mac/carbon/private/print.h +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: print.h -// Purpose: private implementation for printing on MacOS -// Author: Stefan Csomor -// Modified by: -// Created: 03/02/99 -// RCS-ID: $Id: -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_PRIVATE_PRINT_H_ -#define _WX_MAC_PRIVATE_PRINT_H_ - -#include "wx/cmndata.h" -#include "wx/mac/private.h" - -#if TARGET_CARBON && !defined(__DARWIN__) -# include -#endif - -#ifndef __DARWIN__ -# include "Printing.h" -#endif - -#if TARGET_CARBON -#if !PM_USE_SESSION_APIS -#error "only Carbon Printing Session API is supported" -#endif -#endif - -class wxNativePrintData -{ -public : - wxNativePrintData() {} - virtual ~wxNativePrintData() {} - - virtual void TransferFrom( wxPrintData * ) = 0 ; - virtual void TransferTo( wxPrintData * ) = 0 ; - - virtual void TransferFrom( wxPageSetupDialogData * ) = 0 ; - virtual void TransferTo( wxPageSetupDialogData * ) = 0 ; - - virtual void TransferFrom( wxPrintDialogData * ) = 0 ; - virtual void TransferTo( wxPrintDialogData * ) = 0 ; - - virtual void CopyFrom( wxNativePrintData * ) = 0; - - virtual int ShowPrintDialog() = 0 ; - virtual int ShowPageSetupDialog() = 0 ; - - static wxNativePrintData* Create() ; -} ; - -#if TARGET_CARBON - -class wxMacCarbonPrintData : public wxNativePrintData -{ -public : - wxMacCarbonPrintData() ; - ~wxMacCarbonPrintData() ; - - virtual void TransferFrom( wxPrintData * ) ; - virtual void TransferTo( wxPrintData * ) ; - - virtual void TransferFrom( wxPageSetupDialogData * ) ; - virtual void TransferTo( wxPageSetupDialogData * ) ; - - virtual void TransferFrom( wxPrintDialogData * ) ; - virtual void TransferTo( wxPrintDialogData * ) ; - - virtual void CopyFrom( wxNativePrintData * ) ; - virtual int ShowPrintDialog() ; - virtual int ShowPageSetupDialog() ; -private : - virtual void ValidateOrCreate() ; -public : - PMPrintSession m_macPrintSession ; - PMPageFormat m_macPageFormat ; - PMPrintSettings m_macPrintSettings ; -} ; - -#else - -class wxMacClassicPrintData : public wxNativePrintData -{ -public : - wxMacClassicPrintData() ; - ~wxMacClassicPrintData() ; - virtual void TransferFrom( wxPrintData * ) ; - virtual void TransferTo( wxPrintData * ) ; - virtual void TransferFrom( wxPageSetupDialogData * ) ; - virtual void TransferTo( wxPageSetupDialogData * ) ; - virtual void TransferFrom( wxPrintDialogData * ) ; - virtual void TransferTo( wxPrintDialogData * ) ; - virtual void CopyFrom( wxNativePrintData * ) ; - virtual int ShowPrintDialog() ; - virtual int ShowPageSetupDialog() ; -private : - virtual void ValidateOrCreate() ; -public : - THPrint m_macPrintSettings ; -} ; - -#endif - -#endif diff --git a/include/wx/mac/carbon/radiobox.h b/include/wx/mac/carbon/radiobox.h deleted file mode 100644 index c9642e2deb..0000000000 --- a/include/wx/mac/carbon/radiobox.h +++ /dev/null @@ -1,108 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h -// Purpose: wxRadioBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBOX_H_ -#define _WX_RADIOBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "radiobox.h" -#endif - -// List box item -class WXDLLEXPORT wxBitmap ; - -class WXDLLEXPORT wxRadioButton ; - -class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxRadioBox) -public: -// Constructors & destructor - wxRadioBox(); - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) - { - Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); - } - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr) - { - Create(parent, id, title, pos, size, choices, - majorDim, style, val, name); - } - ~wxRadioBox(); - bool Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr); - -// Specific functions (in wxWindows2 reference) - virtual void SetSelection(int item); - virtual int GetSelection() const; - - inline virtual int GetCount() const { return m_noItems; } ; - - virtual wxString GetString(int item) const; - virtual void SetString(int item, const wxString& label) ; - - virtual void Enable(int item, bool enable); - virtual void Show(int item, bool show) ; - - virtual int GetColumnCount() const ; - virtual int GetRowCount() const ; - - - virtual bool Enable(bool enable = TRUE); - virtual wxString GetLabel() const; - virtual void SetLabel(const wxString& label) ; - virtual bool Show(bool show = TRUE); - -// Other external functions - void Command(wxCommandEvent& event); - void SetFocus(); - -// Other variable access functions - inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } - inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } - - void OnRadioButton( wxCommandEvent& event ) ; -protected: - wxRadioButton *m_radioButtonCycle; - - int m_majorDim ; - int m_noItems; - int m_noRowsOrCols; - -// Internal functions - virtual wxSize DoGetBestSize() const ; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_RADIOBOX_H_ diff --git a/include/wx/mac/carbon/radiobut.h b/include/wx/mac/carbon/radiobut.h deleted file mode 100644 index 22fe9c1bda..0000000000 --- a/include/wx/mac/carbon/radiobut.h +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.h -// Purpose: wxRadioButton class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBUT_H_ -#define _WX_RADIOBUT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "radiobut.h" -#endif - -class WXDLLEXPORT wxRadioButton: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxRadioButton) - protected: -public: - inline wxRadioButton() {} - inline wxRadioButton(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxRadioButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxRadioButtonNameStr); - - virtual void SetValue(bool val); - virtual bool GetValue() const ; - - // implementation - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ); - void Command(wxCommandEvent& event); - wxRadioButton *AddInCycle(wxRadioButton *cycle); - inline wxRadioButton *NextInCycle() {return m_cycle;} - - protected: - - wxRadioButton *m_cycle; -}; - -// Not implemented -#if 0 -class WXDLLEXPORT wxBitmap ; - -WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr; - -class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton -{ - DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton) - protected: - wxBitmap *theButtonBitmap; - public: - inline wxBitmapRadioButton() { theButtonBitmap = NULL; } - inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr); - - virtual void SetLabel(const wxBitmap *label); - virtual void SetValue(bool val) ; - virtual bool GetValue() const ; -}; -#endif - -#endif - // _WX_RADIOBUT_H_ diff --git a/include/wx/mac/carbon/region.h b/include/wx/mac/carbon/region.h deleted file mode 100644 index ab04dd8975..0000000000 --- a/include/wx/mac/carbon/region.h +++ /dev/null @@ -1,177 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: region.h -// Purpose: wxRegion class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_REGION_H_ -#define _WX_REGION_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "region.h" -#endif - -#include "wx/list.h" -#include "wx/gdiobj.h" -#include "wx/gdicmn.h" - -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxPoint; - -enum wxRegionContain { - wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2 -}; - -// So far, for internal use only -enum wxRegionOp { -wxRGN_AND, // Creates the intersection of the two combined regions. -wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1. -wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2. -wxRGN_OR, // Creates the union of two combined regions. -wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas. -}; - -class WXDLLEXPORT wxRegion : public wxGDIObject { -DECLARE_DYNAMIC_CLASS(wxRegion); - friend class WXDLLEXPORT wxRegionIterator; -public: - wxRegion(long x, long y, long w, long h); - wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRegion(const wxRect& rect); - wxRegion( WXHRGN hRegion ); - wxRegion(); - wxRegion( const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0) - { - Union(bmp, transColour, tolerance); - } - - ~wxRegion(); - - //# Copying - wxRegion(const wxRegion& r) - : wxGDIObject() - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - - //# Modify region - // Clear current region - void Clear(); - - // Union rectangle or region with this. - bool Union(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_OR); } - bool Union(const wxRect& rect) - { return Combine(rect, wxRGN_OR); } - bool Union(const wxRegion& region) - { return Combine(region, wxRGN_OR); } - - // Intersect rectangle or region with this. - bool Intersect(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_AND); } - bool Intersect(const wxRect& rect) - { return Combine(rect, wxRGN_AND); } - bool Intersect(const wxRegion& region) - { return Combine(region, wxRGN_AND); } - - // Subtract rectangle or region from this: - // Combines the parts of 'this' that are not part of the second region. - bool Subtract(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_DIFF); } - bool Subtract(const wxRect& rect) - { return Combine(rect, wxRGN_DIFF); } - bool Subtract(const wxRegion& region) - { return Combine(region, wxRGN_DIFF); } - - // XOR: the union of two combined regions except for any overlapping areas. - bool Xor(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_XOR); } - bool Xor(const wxRect& rect) - { return Combine(rect, wxRGN_XOR); } - bool Xor(const wxRegion& region) - { return Combine(region, wxRGN_XOR); } - - //# Information on region - // Outer bounds of region - void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const; - wxRect GetBox() const ; - - // Is region empty? - bool Empty() const; - inline bool IsEmpty() const { return Empty(); } - - //# Tests - // Does the region contain the point (x,y)? - wxRegionContain Contains(long x, long y) const; - // Does the region contain the point pt? - wxRegionContain Contains(const wxPoint& pt) const; - // Does the region contain the rectangle (x, y, w, h)? - wxRegionContain Contains(long x, long y, long w, long h) const; - // Does the region contain the rectangle rect? - wxRegionContain Contains(const wxRect& rect) const; - - // Convert the region to a B&W bitmap with the white pixels being inside - // the region. - wxBitmap ConvertToBitmap() const; - - // Use the non-transparent pixels of a wxBitmap for the region to combine - // with this region. If the bitmap has a mask then it will be used, - // otherwise the colour to be treated as transparent may be specified, - // along with an optional tolerance value. - bool Union(const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0); - - // Internal - bool Combine(long x, long y, long width, long height, wxRegionOp op); - bool Combine(const wxRegion& region, wxRegionOp op); - bool Combine(const wxRect& rect, wxRegionOp op); - const WXHRGN GetWXHRGN() const ; -}; - -class WXDLLEXPORT wxRegionIterator : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxRegionIterator) - -public: - wxRegionIterator(); - wxRegionIterator(const wxRegion& region); - wxRegionIterator(const wxRegionIterator& iterator); - ~wxRegionIterator(); - - wxRegionIterator& operator=(const wxRegionIterator& iterator); - - void Reset() { m_current = 0; } - void Reset(const wxRegion& region); - - operator bool () const { return m_current < m_numRects; } - bool HaveRects() const { return m_current < m_numRects; } - - wxRegionIterator& operator++(); - wxRegionIterator operator++(int); - - long GetX() const; - long GetY() const; - long GetW() const; - long GetWidth() const { return GetW(); } - long GetH() const; - long GetHeight() const { return GetH(); } - wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); } -private: - void SetRects(long numRects, wxRect *rects); - - long m_current; - long m_numRects; - wxRegion m_region; - wxRect* m_rects; -}; - -#endif - // _WX_REGION_H_ diff --git a/include/wx/mac/carbon/scrolbar.h b/include/wx/mac/carbon/scrolbar.h deleted file mode 100644 index 633b615ced..0000000000 --- a/include/wx/mac/carbon/scrolbar.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrollbar.h -// Purpose: wxScrollBar class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCROLBAR_H_ -#define _WX_SCROLBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "scrolbar.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr; - -// Scrollbar item -class WXDLLEXPORT wxScrollBar: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxScrollBar) - -public: - inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; } - ~wxScrollBar(); - - inline wxScrollBar(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSB_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxScrollBarNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSB_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxScrollBarNameStr); - - int GetThumbPosition() const ; - inline int GetThumbSize() const { return m_viewSize; } - inline int GetPageSize() const { return m_pageSize; } - inline int GetRange() const { return m_objectSize; } - - bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; } - - virtual void SetThumbPosition(int viewStart); - virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh = TRUE); - - void Command(wxCommandEvent& event); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - int m_pageSize; - int m_viewSize; - int m_objectSize; - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_SCROLBAR_H_ diff --git a/include/wx/mac/carbon/setup.h b/include/wx/mac/carbon/setup.h deleted file mode 100644 index b67d2f2c52..0000000000 --- a/include/wx/mac/carbon/setup.h +++ /dev/null @@ -1,938 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: setup.h -// Purpose: Configuration for the library -// Author: Stefan Csomor -// Modified by: Stefan Csomor -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -#define wxUSE_LIBMSPACK 0 -#define wxUSE_SOUND 1 -// ---------------------------------------------------------------------------- -// global settings -// ---------------------------------------------------------------------------- - -// define this to 0 when building wxBase library - this can also be done from -// makefile/project file overriding the value here -#ifndef wxUSE_GUI - #define wxUSE_GUI 1 -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// compatibility settings -// ---------------------------------------------------------------------------- - -// This setting determines the compatibility with 2.0 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_2 0 - -// This setting determines the compatibility with 2.2 API: set it to 0 to -// flag all cases of using deprecated functions. -// -// Default is 1 but please try building your code with 0 as the default will -// change to 0 in the next version and the deprecated functions will disappear -// in the version after it completely. -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 1 - -// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap, -// but this is very dangerous because you can mistakenly pass an icon instead -// of a bitmap to a function taking "const wxBitmap&" - which will *not* work -// because an icon is not a valid bitmap -// -// Starting from 2.1.12, you have the choice under this backwards compatible -// behaviour (your code will still compile, but probably won't behave as -// expected!) and not deriving wxIcon class from wxBitmap, but providing a -// conversion ctor wxBitmap(const wxIcon&) instead. -// -// Recommended setting: 0 -#define wxICON_IS_BITMAP 0 - -// Define as 1 for font size to be backward compatible to 1.63 and earlier. -// 1.64 and later define point sizes to be compatible with Windows. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxFONT_SIZE_COMPATIBILITY 0 - -// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before. -// If migrating between versions, your dialogs may seem to shrink. -// -// Default is 1 -// -// Recommended setting: 0 (the new calculations are more correct!) -#define wxDIALOG_UNIT_COMPATIBILITY 1 - -// ---------------------------------------------------------------------------- -// debugging settings -// ---------------------------------------------------------------------------- - -// Generic comment about debugging settings: they are very useful if you don't -// use any other memory leak detection tools such as Purify/BoundsChecker, but -// are probably redundant otherwise. Also, Visual C++ CRT has the same features -// as wxWindows memory debugging subsystem built in since version 5.0 and you -// may prefer to use it instead of built in memory debugging code because it is -// faster and more fool proof. -// -// Using VC++ CRT memory debugging is enabled by default in debug mode -// (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) -// and if __NO_VC_CRTDBG__ is not defined. - -// If 1, enables wxDebugContext, for writing error messages to file, etc. If -// __WXDEBUG__ is not defined, will still use normal memory operators. It's -// recommended to set this to 1, since you may well need to output an error log -// in a production version (or non-debugging beta). -// -// Default is 1. -// -// Recommended setting: 1 but see comment above -#ifndef __MWERKS__ -#define wxUSE_DEBUG_CONTEXT 0 -#else -#define wxUSE_DEBUG_CONTEXT 1 -#endif - -// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF* -// __WXDEBUG__ is also defined. -// -// WARNING: this code may not work with all architectures, especially if -// alignment is an issue. This switch is currently ignored for mingw / cygwin -// -// Default is 1 -// -// Recommended setting: 1 but see comment in the beginning of this section -#define wxUSE_MEMORY_TRACING 1 - -// In debug mode, cause new and delete to be redefined globally. -// If this causes problems (e.g. link errors which is a common problem -// especially if you use another library which also redefines the global new -// and delete), set this to 0. -// This switch is currently ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If -// this causes problems (e.g. link errors), set this to 0. You may need to set -// this to 0 if using templates (at least for VC++). This switch is currently -// ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// wxHandleFatalExceptions() may be used to catch the program faults at run -// time and, instead of terminating the program with a usual GPF message box, -// call the user-defined wxApp::OnFatalException() function. If you set -// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work. -// -// This setting is for Win32 only and can only be enabled if your compiler -// supports Win32 structured exception handling (currently only VC++ does) -// -// Default is 1 -// -// Recommended setting: 1 if your compiler supports it. -#ifdef _MSC_VER - #define wxUSE_ON_FATAL_EXCEPTION 1 -#else - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be -// defined as wchar_t, wxString will use Unicode internally. If you set this -// to 1, you must use wxT() macro for all literal strings in the program. -// -// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x -// doesn't support it and the programs compiled in Unicode mode will not run -// under 9x). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000) -#if TARGET_CARBON && ( !defined(__MWERKS__) || !defined(__MACH__) ) -#define wxUSE_UNICODE 1 -#else -#define wxUSE_UNICODE 0 -#endif -// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without -// compiling the program in Unicode mode. More precisely, it will be possible -// to construct wxString from a wide (Unicode) string and convert any wxString -// to Unicode. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_WCHAR_T 1 - -// ---------------------------------------------------------------------------- -// global features -// ---------------------------------------------------------------------------- - -// Compile library in exception-safe mode? If set to 1, the library will try to -// behave correctly in presence of exceptions (even though it still will not -// use the exceptions itself) and notify the user code about any unhandled -// exceptions. If set to 0, propagation of the exceptions through the library -// code will lead to undefined behaviour -- but the code itself will be -// slightly smaller and faster. -// -// Default is 1 -// -// Recommended setting: depends on whether you intend to use C++ exceptions -// in your own code (1 if you do, 0 if you don't) -#define wxUSE_EXCEPTIONS 1 - -// Support for message/error logging. This includes wxLogXXX() functions and -// wxLog and derived classes. Don't set this to 0 unless you really know what -// you are doing. -// -// Default is 1 -// -// Recommended setting: 1 (always) -#define wxUSE_LOG 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOG_DIALOG 1 - -// Support for command line parsing using wxCmdLineParser class. -// -// Default is 1 -// -// Recommended setting: 1 (can be set to 0 if you don't use the cmd line) -#define wxUSE_CMDLINE_PARSER 1 - -// Support for multithreaded applications: if 1, compile in thread classes -// (thread.h) and make the library a bit more thread safe. Although thread -// support is quite stable by now, you may still consider recompiling the -// library without it if you have no use for it - this will result in a -// somewhat smaller and faster operation. -// -// This is ignored under Win16, threads are only supported under Win32. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled (1), compiles wxWindows streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifndef __MWERKS__ -#define wxUSE_STD_IOSTREAM 0 -#else -#define wxUSE_STD_IOSTREAM 1 -#endif - -// Use serialization (requires utils/serialize) -#define wxUSE_SERIAL 0 - -// ---------------------------------------------------------------------------- -// non GUI features selection -// ---------------------------------------------------------------------------- - -// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit -// integer which is implemented in terms of native 64 bit integers if any or -// uses emulation otherwise. -// -// This class is required by wxDateTime and so you should enable it if you want -// to use wxDateTime. For most modern platforms, it will use the native 64 bit -// integers in which case (almost) all of its functions are inline and it -// almost does not take any space, so there should be no reason to switch it -// off. -// -// Recommended setting: 1 -#define wxUSE_LONGLONG 1 - -// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level -// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. -// -// Default is 1 -// -// Recommended setting: 1 (wxFile is highly recommended as it is required by -// i18n code, wxFileConfig and others) -#define wxUSE_FILE 1 -#define wxUSE_FFILE 1 - -// use wxTextBuffer class: required by wxTextFile -#define wxUSE_TEXTBUFFER 1 - -// use wxTextFile class: requires wxFile and wxTextBuffer, required by -// wxFileConfig -#define wxUSE_TEXTFILE 1 - -// i18n support: _() macro, wxLocale class. Requires wxTextFile. -#define wxUSE_INTL 1 - -// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which -// allow to manipulate dates, times and time intervals. wxDateTime replaces the -// old wxTime and wxDate classes which are still provided for backwards -// compatibility (and implemented in terms of wxDateTime). -// -// Note that this class is relatively new and is still officially in alpha -// stage because some features are not yet (fully) implemented. It is already -// quite useful though and should only be disabled if you are aiming at -// absolutely minimal version of the library. -// -// Requires: wxUSE_LONGLONG -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_DATETIME 1 - -// Set wxUSE_TIMER to 1 to compile wxTimer class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_TIMER 1 - -// Use wxStopWatch clas. -// -// Default is 1 -// -// Recommended setting: 1 (needed by wxSocket) -#define wxUSE_STOPWATCH 1 - -// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes -// which allow the application to store its settings in the persistent -// storage. Setting this to 1 will also enable on-demand creation of the -// global config object in wxApp. -// -// See also wxUSE_CONFIG_NATIVE below. -// -// Recommended setting: 1 -#define wxUSE_CONFIG 1 - -// If wxUSE_CONFIG is 1, you may choose to use either the native config -// classes under Windows (using .INI files under Win16 and the registry under -// Win32) or the portable text file format used by the config classes under -// Unix. -// -// Default is 1 to use native classes. Note that you may still use -// wxFileConfig even if you set this to 1 - just the config object created by -// default for the applications needs will be a wxRegConfig or wxIniConfig and -// not wxFileConfig. -// -// Recommended setting: 1 -#define wxUSE_CONFIG_NATIVE 1 - -// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows -// to connect/disconnect from the network and be notified whenever the dial-up -// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DIALUP_MANAGER 1 - -// Compile in classes for run-time DLL loading and function calling. -// Required by wxUSE_DIALUP_MANAGER. -// -// This setting is for Win32 only -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DYNLIB_CLASS 1 - -// experimental extension, use with caution. -#define wxUSE_DYNAMIC_LOADER 0 - -// Set to 1 to use socket classes -#define wxUSE_SOCKETS 1 - -// Set to 1 to enable virtual file systems (required by wxHTML) -#define wxUSE_FILESYSTEM 1 - -// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ZIP 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG and wxUSE_GZSTREAM. -#define wxUSE_ZLIB 1 - -// Set to 1 to compile wxGzipInput/OutputStream classes. Requires wxUSE_ZLIB. -#define wxUSE_GZSTREAM 1 - -// If enabled, the code written by Apple will be used to write, in a portable -// way, float on the disk. See extended.c for the license which is different -// from wxWindows one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#define wxUSE_JOYSTICK 1 - -// wxFontMapper class -#define wxUSE_FONTMAP 1 - -// wxMimeTypesManager class -#define wxUSE_MIMETYPE 1 - -// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP -// or wxURL you need to set this to 1. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_PROTOCOL 1 - -// The settings for the individual URL schemes -#define wxUSE_PROTOCOL_FILE 1 -#define wxUSE_PROTOCOL_FTP 1 -#define wxUSE_PROTOCOL_HTTP 1 - -// Define this to use wxURL class. -#define wxUSE_URL 1 - -// Support for regular expression matching via wxRegEx class: enable this to -// use POSIX regular expressions in your code. You need to compile regex -// library from src/regex to use it under Windows. -// -// Default is 0 -// -// Recommended setting: 1 if your compiler supports it, if it doesn't please -// contribute us a makefile for src/regex for it -#define wxUSE_REGEX 0 - -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 1 - -// wxWave class -#define wxUSE_WAVE 1 - -// XML parsing classes. Note that their API will change in the future, so -// using wxXmlDocument and wxXmlNode in your app is not recommended. -// -// Default is 1 -// -// Recommended setting: 1 (needed by XRC) -#define wxUSE_XML 1 - -// ---------------------------------------------------------------------------- -// Individual GUI controls -// ---------------------------------------------------------------------------- - -// You must set wxUSE_CONTROLS to 1 if you are using any controls at all -// (without it, wxControl class is not compiled) -// -// Default is 1 -// -// Recommended setting: 1 (don't change except for very special programs) -#define wxUSE_CONTROLS 1 - -// wxPopupWindow class is a top level transient window. It is currently used -// to implement wxTipWindow but doesn't work yet under Mac. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_POPUPWIN 0 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_TIPWINDOW 0 - -// Each of the settings below corresponds to one wxWindows control. They are -// all switched on by default but may be disabled if you are sure that your -// program (including any standard dialogs it can show!) doesn't need them and -// if you desperately want to save some space. If you use any of these you must -// set wxUSE_CONTROLS as well. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_BUTTON 1 // wxButton -#define wxUSE_BMPBUTTON 1 // wxBitmapButton -#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl -#define wxUSE_CHECKBOX 1 // wxCheckBox -#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_LISTBOX 1 // wxListBox -#define wxUSE_LISTCTRL 1 // wxListCtrl -#define wxUSE_RADIOBOX 1 // wxRadioBox -#define wxUSE_RADIOBTN 1 // wxRadioButton -#define wxUSE_SCROLLBAR 1 // wxScrollBar -#define wxUSE_SLIDER 1 // wxSlider -#define wxUSE_SPINBTN 1 // wxSpinButton -#define wxUSE_SPINCTRL 1 // wxSpinCtrl -#define wxUSE_STATBOX 1 // wxStaticBox -#define wxUSE_STATLINE 1 // wxStaticLine -#define wxUSE_STATTEXT 1 // wxStaticText -#define wxUSE_STATBMP 1 // wxStaticBitmap -#define wxUSE_TEXTCTRL 1 // wxTextCtrl -#define wxUSE_TOGGLEBTN 1 // requires wxButton -#define wxUSE_TREECTRL 1 // wxTreeCtrl - -// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR -// below either wxStatusBar95 or a generic wxStatusBar will be used. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_STATUSBAR 1 - -// Two status bar implementations are available under Win32: the generic one -// or the wrapper around native control. For native look and feel the native -// version should be used. -// -// Default is 1. -// -// Recommended setting: 1 (there is no advantage in using the generic one) -#define wxUSE_NATIVE_STATUSBAR 1 - -// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar -// classes at all. Otherwise, use the native toolbar class unless -// wxUSE_TOOLBAR_NATIVE is 0. -// -// Default is 1 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 1 - -// this setting is obsolete, value is ignored -#define wxUSE_BUTTONBAR 1 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used ot logically organise the data presented to the user instead of -// putting everything in one huge dialog. It replaces wxTabControl and related -// classes of wxWin 1.6x. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_NOTEBOOK 1 - -// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_LISTBOOK 1 - -// wxTabDialog is a generic version of wxNotebook but it is incompatible with -// the new class. It shouldn't be used in new code. -// -// Default is 0. -// -// Recommended setting: 0 (use wxNotebook) -#define wxUSE_TAB_DIALOG 0 - -// wxGrid class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 0 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Use wxCaret: a class implementing a "cursor" in a text control (called caret -// under Windows). -// -// Default is 1. -// -// Recommended setting: 1 (can be safely set to 0, not used by the library) -#define wxUSE_CARET 1 - -// Use wxDisplay class: it allows enumerating all displays on a system and -// working with them. -// -// Default is 0 because it isn't yet implemented on all platforms -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 0 - -// Miscellaneous geometry code: needed for Canvas library -#define wxUSE_GEOMETRY 1 - -// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and -// wxListCtrl. -// -// Default is 1. -// -// Recommended setting: 1 (set it to 0 if you don't use any of the controls -// enumerated above, then this class is mostly useless too) -#define wxUSE_IMAGLIST 1 - -// Use wxMenu, wxMenuBar, wxMenuItem. -// -// Default is 1. -// -// Recommended setting: 1 (can't be disabled under MSW) -#define wxUSE_MENUS 1 - -// Use wxSashWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SASH 1 - -// Use wxSplitterWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SPLITTER 1 - -// Use wxToolTip and wxWindow::Set/GetToolTip() methods. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLTIPS 1 - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 0 - -// ---------------------------------------------------------------------------- -// common dialogs -// ---------------------------------------------------------------------------- - -// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. -// file selector, printer dialog). Switching this off also switches off the -// printing architecture and interactive wxPrinterDC. -// -// Default is 1 -// -// Recommended setting: 1 (unless it really doesn't work) -#define wxUSE_COMMON_DIALOGS 1 - -// wxBusyInfo displays window with message when app is busy. Works in same way -// as wxBusyCursor -#define wxUSE_BUSYINFO 1 - -// Use single/multiple choice dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_CHOICEDLG 1 - -// Use colour picker dialog -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_COLOURDLG 1 - -// wxDirDlg class for getting a directory name from user -#define wxUSE_DIRDLG 1 - -// TODO: setting to choose the generic or native one - -// Use file open/save dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in many places in the library itself) -#define wxUSE_FILEDLG 1 - -// Use find/replace dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely set to 0) -#define wxUSE_FINDREPLDLG 1 - -// Use font picker dialog -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_FONTDLG 1 - -// Use wxMessageDialog and wxMessageBox. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_MSGDLG 1 - -// progress dialog class for lengthy operations -#define wxUSE_PROGRESSDLG 1 - -// support for startup tips (wxShowTip &c) -#define wxUSE_STARTUP_TIPS 1 - -// text entry dialog and wxGetTextFromUser function -#define wxUSE_TEXTDLG 1 - -// number entry dialog -#define wxUSE_NUMBERDLG 1 - -// splash screen class -#define wxUSE_SPLASH 1 - -// wizards -#define wxUSE_WIZARDDLG 1 - -// ---------------------------------------------------------------------------- -// Metafiles support -// ---------------------------------------------------------------------------- - -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. -// -// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. -// -// Recommended setting: default or 0 for everything for portable programs. -#define wxUSE_METAFILE 1 -#define wxUSE_ENH_METAFILE 1 -#define wxUSE_WIN_METAFILES_ALWAYS 0 - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -#define wxUSE_MDI_ARCHITECTURE 1 - -// Set to 0 to disable print/preview architecture code -#define wxUSE_PRINTING_ARCHITECTURE 1 - -// wxHTML sublibrary allows to display HTML in wxWindow programs and much, -// much more. -// -// Default is 1. -// -// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a -// smaller library. -#define wxUSE_HTML 1 - -// OpenGL canvas -#define wxUSE_GLCANVAS 0 - -// ---------------------------------------------------------------------------- -// Data transfer -// ---------------------------------------------------------------------------- - -// Use wxClipboard class for clipboard copy/paste. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CLIPBOARD 1 - -// Use wxDataObject and related classes. Needed for clipboard and OLE drag and -// drop -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DATAOBJ 1 - -// Use wxDropTarget and wxDropSource classes for drag and drop (this is -// different from "built in" drag and drop in wxTreeCtrl which is always -// available). Requires wxUSE_DATAOBJ. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DRAG_AND_DROP 1 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running (it is only available under Win32) -// -// Default is 1 -// -// Recommended setting: 1 (the class is tiny, disabling it won't save much -// space) -#define wxUSE_SNGLINST_CHECKER 1 - -#define wxUSE_DRAGIMAGE 1 - -#define wxUSE_IPC 0 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility -#define wxUSE_WXHTML_HELP 1 - // 0 for no MS HTML Help -#define wxUSE_RESOURCES 1 - // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CONSTRAINTS 1 - // 0 for no window layout constraint system - -#define wxUSE_SPLINES 1 - // 0 for no splines - -#define wxUSE_MOUSEWHEEL 1 - // Include mouse wheel support - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 0 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 0 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 0 - -// For backward compatibility reasons, this parameter now only controls the -// default scrolling method used by cursors. This default behavior can be -// overriden by setting the second param of wxDB::wxDbGetConnection() or -// wxDb() constructor to indicate whether the connection (and any wxDbTable()s -// that use the connection) should support forward only scrolling of cursors, -// or both forward and backward support for backward scrolling cursors is -// dependent on the data source as well as the ODBC driver being used. -#define wxODBC_FWD_ONLY_CURSORS 1 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatability with the -// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, -// as future development will be done only on the non-deprecated -// functions/classes/member variables/etc. -#define wxODBC_BACKWARD_COMPATABILITY 0 - -// ---------------------------------------------------------------------------- -// other compiler (mis)features -// ---------------------------------------------------------------------------- - -// Set this to 0 if your compiler can't cope with omission of prototype -// parameters. -// -// Default is 1. -// -// Recommended setting: 1 (should never need to set this to 0) -#define REMOVE_UNUSED_ARG 1 - -// VC++ 4.2 and above allows and but you can't mix -// them. Set to 1 for , 0 for -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifndef __MWERKS__ -#define wxUSE_IOSTREAMH 0 -#else -#define wxUSE_IOSTREAMH 1 -#endif - -// ---------------------------------------------------------------------------- -// image format support -// ---------------------------------------------------------------------------- - -// wxImage supports many different image formats which can be configured at -// compile-time. BMP is always supported, others are optional and can be safely -// disabled if you don't plan to use images in such format sometimes saving -// substantial amount of code in the final library. -// -// Some formats require an extra library which is included in wxWin sources -// which is mentioned if it is the case. - -// Set to 1 for wxImage support (recommended). -#define wxUSE_IMAGE 1 - -// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. -#define wxUSE_LIBPNG 1 - -// Set to 1 for JPEG format support (requires libjpeg) -#define wxUSE_LIBJPEG 1 - -// Set to 1 for TIFF format support (requires libtiff) -#define wxUSE_LIBTIFF 1 - -// Set to 1 for GIF format support -#define wxUSE_GIF 1 - -// Set to 1 for PNM format support -#define wxUSE_PNM 1 - -// Set to 1 for PCX format support -#define wxUSE_PCX 1 - -// Set to 1 for IFF format support -#define wxUSE_IFF 0 - -// Set to 1 for XPM format support -#define wxUSE_XPM 1 - -// Set to 1 for MS Icons and Cursors format support -#define wxUSE_ICO_CUR 1 - -// Set to 1 to compile in wxPalette class -#define wxUSE_PALETTE 1 - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -#endif - // _WX_SETUP_H_ diff --git a/include/wx/mac/carbon/setup0.h b/include/wx/mac/carbon/setup0.h deleted file mode 100644 index c0b2f7642e..0000000000 --- a/include/wx/mac/carbon/setup0.h +++ /dev/null @@ -1,933 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: setup.h -// Purpose: Configuration for the library -// Author: Stefan Csomor -// Modified by: Stefan Csomor -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -// ---------------------------------------------------------------------------- -// global settings -// ---------------------------------------------------------------------------- - -// define this to 0 when building wxBase library - this can also be done from -// makefile/project file overriding the value here -#ifndef wxUSE_GUI - #define wxUSE_GUI 1 -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// compatibility settings -// ---------------------------------------------------------------------------- - -// This setting determines the compatibility with 2.0 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_2 0 - -// This setting determines the compatibility with 2.2 API: set it to 0 to -// flag all cases of using deprecated functions. -// -// Default is 1 but please try building your code with 0 as the default will -// change to 0 in the next version and the deprecated functions will disappear -// in the version after it completely. -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 1 - -// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap, -// but this is very dangerous because you can mistakenly pass an icon instead -// of a bitmap to a function taking "const wxBitmap&" - which will *not* work -// because an icon is not a valid bitmap -// -// Starting from 2.1.12, you have the choice under this backwards compatible -// behaviour (your code will still compile, but probably won't behave as -// expected!) and not deriving wxIcon class from wxBitmap, but providing a -// conversion ctor wxBitmap(const wxIcon&) instead. -// -// Recommended setting: 0 -#define wxICON_IS_BITMAP 0 - -// Define as 1 for font size to be backward compatible to 1.63 and earlier. -// 1.64 and later define point sizes to be compatible with Windows. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxFONT_SIZE_COMPATIBILITY 0 - -// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before. -// If migrating between versions, your dialogs may seem to shrink. -// -// Default is 1 -// -// Recommended setting: 0 (the new calculations are more correct!) -#define wxDIALOG_UNIT_COMPATIBILITY 1 - -// ---------------------------------------------------------------------------- -// debugging settings -// ---------------------------------------------------------------------------- - -// Generic comment about debugging settings: they are very useful if you don't -// use any other memory leak detection tools such as Purify/BoundsChecker, but -// are probably redundant otherwise. Also, Visual C++ CRT has the same features -// as wxWindows memory debugging subsystem built in since version 5.0 and you -// may prefer to use it instead of built in memory debugging code because it is -// faster and more fool proof. -// -// Using VC++ CRT memory debugging is enabled by default in debug mode -// (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) -// and if __NO_VC_CRTDBG__ is not defined. - -// If 1, enables wxDebugContext, for writing error messages to file, etc. If -// __WXDEBUG__ is not defined, will still use normal memory operators. It's -// recommended to set this to 1, since you may well need to output an error log -// in a production version (or non-debugging beta). -// -// Default is 1. -// -// Recommended setting: 1 but see comment above -#ifndef __MWERKS__ -#define wxUSE_DEBUG_CONTEXT 0 -#else -#define wxUSE_DEBUG_CONTEXT 1 -#endif - -// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF* -// __WXDEBUG__ is also defined. -// -// WARNING: this code may not work with all architectures, especially if -// alignment is an issue. This switch is currently ignored for mingw / cygwin -// -// Default is 1 -// -// Recommended setting: 1 but see comment in the beginning of this section -#define wxUSE_MEMORY_TRACING 1 - -// In debug mode, cause new and delete to be redefined globally. -// If this causes problems (e.g. link errors which is a common problem -// especially if you use another library which also redefines the global new -// and delete), set this to 0. -// This switch is currently ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If -// this causes problems (e.g. link errors), set this to 0. You may need to set -// this to 0 if using templates (at least for VC++). This switch is currently -// ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// wxHandleFatalExceptions() may be used to catch the program faults at run -// time and, instead of terminating the program with a usual GPF message box, -// call the user-defined wxApp::OnFatalException() function. If you set -// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work. -// -// This setting is for Win32 only and can only be enabled if your compiler -// supports Win32 structured exception handling (currently only VC++ does) -// -// Default is 1 -// -// Recommended setting: 1 if your compiler supports it. -#ifdef _MSC_VER - #define wxUSE_ON_FATAL_EXCEPTION 1 -#else - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be -// defined as wchar_t, wxString will use Unicode internally. If you set this -// to 1, you must use wxT() macro for all literal strings in the program. -// -// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x -// doesn't support it and the programs compiled in Unicode mode will not run -// under 9x). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000) -#define wxUSE_UNICODE 0 - -// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without -// compiling the program in Unicode mode. More precisely, it will be possible -// to construct wxString from a wide (Unicode) string and convert any wxString -// to Unicode. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_WCHAR_T 1 - -// ---------------------------------------------------------------------------- -// global features -// ---------------------------------------------------------------------------- - -// Compile library in exception-safe mode? If set to 1, the library will try to -// behave correctly in presence of exceptions (even though it still will not -// use the exceptions itself) and notify the user code about any unhandled -// exceptions. If set to 0, propagation of the exceptions through the library -// code will lead to undefined behaviour -- but the code itself will be -// slightly smaller and faster. -// -// Default is 1 -// -// Recommended setting: depends on whether you intend to use C++ exceptions -// in your own code (1 if you do, 0 if you don't) -#define wxUSE_EXCEPTIONS 1 - -// Support for message/error logging. This includes wxLogXXX() functions and -// wxLog and derived classes. Don't set this to 0 unless you really know what -// you are doing. -// -// Default is 1 -// -// Recommended setting: 1 (always) -#define wxUSE_LOG 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOG_DIALOG 1 - -// Support for command line parsing using wxCmdLineParser class. -// -// Default is 1 -// -// Recommended setting: 1 (can be set to 0 if you don't use the cmd line) -#define wxUSE_CMDLINE_PARSER 1 - -// Support for multithreaded applications: if 1, compile in thread classes -// (thread.h) and make the library a bit more thread safe. Although thread -// support is quite stable by now, you may still consider recompiling the -// library without it if you have no use for it - this will result in a -// somewhat smaller and faster operation. -// -// This is ignored under Win16, threads are only supported under Win32. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled (1), compiles wxWindows streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifndef __MWERKS__ -#define wxUSE_STD_IOSTREAM 0 -#else -#define wxUSE_STD_IOSTREAM 1 -#endif - -// Use serialization (requires utils/serialize) -#define wxUSE_SERIAL 0 - -// ---------------------------------------------------------------------------- -// non GUI features selection -// ---------------------------------------------------------------------------- - -// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit -// integer which is implemented in terms of native 64 bit integers if any or -// uses emulation otherwise. -// -// This class is required by wxDateTime and so you should enable it if you want -// to use wxDateTime. For most modern platforms, it will use the native 64 bit -// integers in which case (almost) all of its functions are inline and it -// almost does not take any space, so there should be no reason to switch it -// off. -// -// Recommended setting: 1 -#define wxUSE_LONGLONG 1 - -// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level -// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. -// -// Default is 1 -// -// Recommended setting: 1 (wxFile is highly recommended as it is required by -// i18n code, wxFileConfig and others) -#define wxUSE_FILE 1 -#define wxUSE_FFILE 1 - -// use wxTextBuffer class: required by wxTextFile -#define wxUSE_TEXTBUFFER 1 - -// use wxTextFile class: requires wxFile and wxTextBuffer, required by -// wxFileConfig -#define wxUSE_TEXTFILE 1 - -// i18n support: _() macro, wxLocale class. Requires wxTextFile. -#define wxUSE_INTL 1 - -// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which -// allow to manipulate dates, times and time intervals. wxDateTime replaces the -// old wxTime and wxDate classes which are still provided for backwards -// compatibility (and implemented in terms of wxDateTime). -// -// Note that this class is relatively new and is still officially in alpha -// stage because some features are not yet (fully) implemented. It is already -// quite useful though and should only be disabled if you are aiming at -// absolutely minimal version of the library. -// -// Requires: wxUSE_LONGLONG -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_DATETIME 1 - -// Set wxUSE_TIMER to 1 to compile wxTimer class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_TIMER 1 - -// Use wxStopWatch clas. -// -// Default is 1 -// -// Recommended setting: 1 (needed by wxSocket) -#define wxUSE_STOPWATCH 1 - -// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes -// which allow the application to store its settings in the persistent -// storage. Setting this to 1 will also enable on-demand creation of the -// global config object in wxApp. -// -// See also wxUSE_CONFIG_NATIVE below. -// -// Recommended setting: 1 -#define wxUSE_CONFIG 1 - -// If wxUSE_CONFIG is 1, you may choose to use either the native config -// classes under Windows (using .INI files under Win16 and the registry under -// Win32) or the portable text file format used by the config classes under -// Unix. -// -// Default is 1 to use native classes. Note that you may still use -// wxFileConfig even if you set this to 1 - just the config object created by -// default for the applications needs will be a wxRegConfig or wxIniConfig and -// not wxFileConfig. -// -// Recommended setting: 1 -#define wxUSE_CONFIG_NATIVE 1 - -// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows -// to connect/disconnect from the network and be notified whenever the dial-up -// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DIALUP_MANAGER 1 - -// Compile in classes for run-time DLL loading and function calling. -// Required by wxUSE_DIALUP_MANAGER. -// -// This setting is for Win32 only -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DYNLIB_CLASS 1 - -// experimental extension, use with caution. -#define wxUSE_DYNAMIC_LOADER 0 - -// Set to 1 to use socket classes -#define wxUSE_SOCKETS 1 - -// Set to 1 to enable virtual file systems (required by wxHTML) -#define wxUSE_FILESYSTEM 1 - -// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ZIP 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG and wxUSE_GZSTREAM. -#define wxUSE_ZLIB 1 - -// Set to 1 to compile wxGzipInput/OutputStream classes. Requires wxUSE_ZLIB. -#define wxUSE_GZSTREAM 1 - -// If enabled, the code written by Apple will be used to write, in a portable -// way, float on the disk. See extended.c for the license which is different -// from wxWindows one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#define wxUSE_JOYSTICK 1 - -// wxFontMapper class -#define wxUSE_FONTMAP 1 - -// wxMimeTypesManager class -#define wxUSE_MIMETYPE 1 - -// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP -// or wxURL you need to set this to 1. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_PROTOCOL 1 - -// The settings for the individual URL schemes -#define wxUSE_PROTOCOL_FILE 1 -#define wxUSE_PROTOCOL_FTP 1 -#define wxUSE_PROTOCOL_HTTP 1 - -// Define this to use wxURL class. -#define wxUSE_URL 1 - -// Support for regular expression matching via wxRegEx class: enable this to -// use POSIX regular expressions in your code. You need to compile regex -// library from src/regex to use it under Windows. -// -// Default is 0 -// -// Recommended setting: 1 if your compiler supports it, if it doesn't please -// contribute us a makefile for src/regex for it -#define wxUSE_REGEX 1 - -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 1 - -// wxSound class -#define wxUSE_SOUND 1 - -// XML parsing classes. Note that their API will change in the future, so -// using wxXmlDocument and wxXmlNode in your app is not recommended. -// -// Default is 1 -// -// Recommended setting: 1 (needed by XRC) -#define wxUSE_XML 1 - -// ---------------------------------------------------------------------------- -// Individual GUI controls -// ---------------------------------------------------------------------------- - -// You must set wxUSE_CONTROLS to 1 if you are using any controls at all -// (without it, wxControl class is not compiled) -// -// Default is 1 -// -// Recommended setting: 1 (don't change except for very special programs) -#define wxUSE_CONTROLS 1 - -// wxPopupWindow class is a top level transient window. It is currently used -// to implement wxTipWindow but doesn't work yet under Mac. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_POPUPWIN 0 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_TIPWINDOW 0 - -// Each of the settings below corresponds to one wxWindows control. They are -// all switched on by default but may be disabled if you are sure that your -// program (including any standard dialogs it can show!) doesn't need them and -// if you desperately want to save some space. If you use any of these you must -// set wxUSE_CONTROLS as well. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_BUTTON 1 // wxButton -#define wxUSE_BMPBUTTON 1 // wxBitmapButton -#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl -#define wxUSE_CHECKBOX 1 // wxCheckBox -#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_LISTBOX 1 // wxListBox -#define wxUSE_LISTCTRL 1 // wxListCtrl -#define wxUSE_RADIOBOX 1 // wxRadioBox -#define wxUSE_RADIOBTN 1 // wxRadioButton -#define wxUSE_SCROLLBAR 1 // wxScrollBar -#define wxUSE_SLIDER 1 // wxSlider -#define wxUSE_SPINBTN 1 // wxSpinButton -#define wxUSE_SPINCTRL 1 // wxSpinCtrl -#define wxUSE_STATBOX 1 // wxStaticBox -#define wxUSE_STATLINE 1 // wxStaticLine -#define wxUSE_STATTEXT 1 // wxStaticText -#define wxUSE_STATBMP 1 // wxStaticBitmap -#define wxUSE_TEXTCTRL 1 // wxTextCtrl -#define wxUSE_TOGGLEBTN 0 // requires wxButton -#define wxUSE_TREECTRL 1 // wxTreeCtrl - -// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR -// below either wxStatusBar95 or a generic wxStatusBar will be used. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_STATUSBAR 1 - -// Two status bar implementations are available under Win32: the generic one -// or the wrapper around native control. For native look and feel the native -// version should be used. -// -// Default is 1. -// -// Recommended setting: 1 (there is no advantage in using the generic one) -#define wxUSE_NATIVE_STATUSBAR 1 - -// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar -// classes at all. Otherwise, use the native toolbar class unless -// wxUSE_TOOLBAR_NATIVE is 0. -// -// Default is 1 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 1 - -// this setting is obsolete, value is ignored -#define wxUSE_BUTTONBAR 1 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used ot logically organise the data presented to the user instead of -// putting everything in one huge dialog. It replaces wxTabControl and related -// classes of wxWin 1.6x. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_NOTEBOOK 1 - -// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_LISTBOOK 1 - -// wxTabDialog is a generic version of wxNotebook but it is incompatible with -// the new class. It shouldn't be used in new code. -// -// Default is 0. -// -// Recommended setting: 0 (use wxNotebook) -#define wxUSE_TAB_DIALOG 0 - -// wxGrid class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 0 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Use wxCaret: a class implementing a "cursor" in a text control (called caret -// under Windows). -// -// Default is 1. -// -// Recommended setting: 1 (can be safely set to 0, not used by the library) -#define wxUSE_CARET 1 - -// Use wxDisplay class: it allows enumerating all displays on a system and -// working with them. -// -// Default is 0 because it isn't yet implemented on all platforms -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 0 - -// Miscellaneous geometry code: needed for Canvas library -#define wxUSE_GEOMETRY 1 - -// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and -// wxListCtrl. -// -// Default is 1. -// -// Recommended setting: 1 (set it to 0 if you don't use any of the controls -// enumerated above, then this class is mostly useless too) -#define wxUSE_IMAGLIST 1 - -// Use wxMenu, wxMenuBar, wxMenuItem. -// -// Default is 1. -// -// Recommended setting: 1 (can't be disabled under MSW) -#define wxUSE_MENUS 1 - -// Use wxSashWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SASH 1 - -// Use wxSplitterWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SPLITTER 1 - -// Use wxToolTip and wxWindow::Set/GetToolTip() methods. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLTIPS 1 - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 0 - -// ---------------------------------------------------------------------------- -// common dialogs -// ---------------------------------------------------------------------------- - -// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. -// file selector, printer dialog). Switching this off also switches off the -// printing architecture and interactive wxPrinterDC. -// -// Default is 1 -// -// Recommended setting: 1 (unless it really doesn't work) -#define wxUSE_COMMON_DIALOGS 1 - -// wxBusyInfo displays window with message when app is busy. Works in same way -// as wxBusyCursor -#define wxUSE_BUSYINFO 1 - -// Use single/multiple choice dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_CHOICEDLG 1 - -// Use colour picker dialog -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_COLOURDLG 1 - -// wxDirDlg class for getting a directory name from user -#define wxUSE_DIRDLG 1 - -// TODO: setting to choose the generic or native one - -// Use file open/save dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in many places in the library itself) -#define wxUSE_FILEDLG 1 - -// Use find/replace dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely set to 0) -#define wxUSE_FINDREPLDLG 1 - -// Use font picker dialog -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_FONTDLG 1 - -// Use wxMessageDialog and wxMessageBox. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_MSGDLG 1 - -// progress dialog class for lengthy operations -#define wxUSE_PROGRESSDLG 1 - -// support for startup tips (wxShowTip &c) -#define wxUSE_STARTUP_TIPS 1 - -// text entry dialog and wxGetTextFromUser function -#define wxUSE_TEXTDLG 1 - -// number entry dialog -#define wxUSE_NUMBERDLG 1 - -// splash screen class -#define wxUSE_SPLASH 1 - -// wizards -#define wxUSE_WIZARDDLG 1 - -// ---------------------------------------------------------------------------- -// Metafiles support -// ---------------------------------------------------------------------------- - -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. -// -// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. -// -// Recommended setting: default or 0 for everything for portable programs. -#define wxUSE_METAFILE 1 -#define wxUSE_ENH_METAFILE 1 -#define wxUSE_WIN_METAFILES_ALWAYS 0 - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -#define wxUSE_MDI_ARCHITECTURE 1 - -// Set to 0 to disable print/preview architecture code -#define wxUSE_PRINTING_ARCHITECTURE 1 - -// wxHTML sublibrary allows to display HTML in wxWindow programs and much, -// much more. -// -// Default is 1. -// -// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a -// smaller library. -#define wxUSE_HTML 1 - -// OpenGL canvas -#define wxUSE_GLCANVAS 0 - -// ---------------------------------------------------------------------------- -// Data transfer -// ---------------------------------------------------------------------------- - -// Use wxClipboard class for clipboard copy/paste. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CLIPBOARD 1 - -// Use wxDataObject and related classes. Needed for clipboard and OLE drag and -// drop -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DATAOBJ 1 - -// Use wxDropTarget and wxDropSource classes for drag and drop (this is -// different from "built in" drag and drop in wxTreeCtrl which is always -// available). Requires wxUSE_DATAOBJ. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DRAG_AND_DROP 1 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running (it is only available under Win32) -// -// Default is 1 -// -// Recommended setting: 1 (the class is tiny, disabling it won't save much -// space) -#define wxUSE_SNGLINST_CHECKER 1 - -#define wxUSE_DRAGIMAGE 1 - -#define wxUSE_IPC 0 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility -#define wxUSE_WXHTML_HELP 1 - // 0 for no MS HTML Help -#define wxUSE_RESOURCES 1 - // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CONSTRAINTS 1 - // 0 for no window layout constraint system - -#define wxUSE_SPLINES 1 - // 0 for no splines - -#define wxUSE_MOUSEWHEEL 1 - // Include mouse wheel support - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 0 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 0 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 0 - -// For backward compatibility reasons, this parameter now only controls the -// default scrolling method used by cursors. This default behavior can be -// overriden by setting the second param of wxDB::wxDbGetConnection() or -// wxDb() constructor to indicate whether the connection (and any wxDbTable()s -// that use the connection) should support forward only scrolling of cursors, -// or both forward and backward support for backward scrolling cursors is -// dependent on the data source as well as the ODBC driver being used. -#define wxODBC_FWD_ONLY_CURSORS 1 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatability with the -// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, -// as future development will be done only on the non-deprecated -// functions/classes/member variables/etc. -#define wxODBC_BACKWARD_COMPATABILITY 0 - -// ---------------------------------------------------------------------------- -// other compiler (mis)features -// ---------------------------------------------------------------------------- - -// Set this to 0 if your compiler can't cope with omission of prototype -// parameters. -// -// Default is 1. -// -// Recommended setting: 1 (should never need to set this to 0) -#define REMOVE_UNUSED_ARG 1 - -// VC++ 4.2 and above allows and but you can't mix -// them. Set to 1 for , 0 for -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifndef __MWERKS__ -#define wxUSE_IOSTREAMH 0 -#else -#define wxUSE_IOSTREAMH 1 -#endif - -// ---------------------------------------------------------------------------- -// image format support -// ---------------------------------------------------------------------------- - -// wxImage supports many different image formats which can be configured at -// compile-time. BMP is always supported, others are optional and can be safely -// disabled if you don't plan to use images in such format sometimes saving -// substantial amount of code in the final library. -// -// Some formats require an extra library which is included in wxWin sources -// which is mentioned if it is the case. - -// Set to 1 for wxImage support (recommended). -#define wxUSE_IMAGE 1 - -// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. -#define wxUSE_LIBPNG 1 - -// Set to 1 for JPEG format support (requires libjpeg) -#define wxUSE_LIBJPEG 1 - -// Set to 1 for TIFF format support (requires libtiff) -#define wxUSE_LIBTIFF 1 - -// Set to 1 for GIF format support -#define wxUSE_GIF 1 - -// Set to 1 for PNM format support -#define wxUSE_PNM 1 - -// Set to 1 for PCX format support -#define wxUSE_PCX 1 - -// Set to 1 for IFF format support -#define wxUSE_IFF 0 - -// Set to 1 for XPM format support -#define wxUSE_XPM 1 - -// Set to 1 for MS Icons and Cursors format support -#define wxUSE_ICO_CUR 1 - -// Set to 1 to compile in wxPalette class -#define wxUSE_PALETTE 1 - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -#endif - // _WX_SETUP_H_ diff --git a/include/wx/mac/carbon/slider.h b/include/wx/mac/carbon/slider.h deleted file mode 100644 index 9599a60c10..0000000000 --- a/include/wx/mac/carbon/slider.h +++ /dev/null @@ -1,110 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.h -// Purpose: wxSlider class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SLIDER_H_ -#define _WX_SLIDER_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "slider.h" -#endif - -#include "wx/control.h" -#include "wx/slider.h" -#include "wx/stattext.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr; - -// Slider -class WXDLLEXPORT wxSlider: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxSlider) - -public: - wxSlider(); - - inline wxSlider(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSliderNameStr) - { - Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); - } - - ~wxSlider(); - - bool Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSliderNameStr); - - virtual int GetValue() const ; - virtual void SetValue(int); - - void SetRange(int minValue, int maxValue); - - inline int GetMin() const { return m_rangeMin; } - inline int GetMax() const { return m_rangeMax; } - - void SetMin(int minValue) { SetRange(minValue, m_rangeMax); } - void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); } - - // For trackbars only - void SetTickFreq(int n, int pos); - inline int GetTickFreq() const { return m_tickFreq; } - void SetPageSize(int pageSize); - int GetPageSize() const ; - void ClearSel() ; - void ClearTicks() ; - void SetLineSize(int lineSize); - int GetLineSize() const ; - int GetSelEnd() const ; - int GetSelStart() const ; - void SetSelection(int minPos, int maxPos); - void SetThumbLength(int len) ; - int GetThumbLength() const ; - void SetTick(int tickPos) ; - - - // set min/max size of the slider - virtual void SetSizeHints( int minW, int minH, - int maxW = -1, int maxH = -1, - int incW = -1, int incH = -1 ); - - protected: - virtual wxSize DoGetBestSize() const; - virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags); - virtual void DoMoveWindow(int x, int y, int w, int h); - - void Command(wxCommandEvent& event); - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual void MacUpdateDimensions() ; - - wxStaticText* m_macMinimumStatic ; - wxStaticText* m_macMaximumStatic ; - wxStaticText* m_macValueStatic ; - - int m_rangeMin; - int m_rangeMax; - int m_pageSize; - int m_lineSize; - int m_tickFreq; -private : -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_SLIDER_H_ diff --git a/include/wx/mac/carbon/sound.h b/include/wx/mac/carbon/sound.h deleted file mode 100644 index 18a84d101b..0000000000 --- a/include/wx/mac/carbon/sound.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sound.h -// Purpose: wxSound class (loads and plays short Windows .wav files). -// Optional on non-Windows platforms. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOUND_H_ -#define _WX_SOUND_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "sound.h" -#endif - -#if wxUSE_SOUND - -#include "wx/object.h" - -class WXDLLEXPORT wxSound : public wxSoundBase -{ -public: - wxSound(); - wxSound(const wxString& fileName, bool isResource = FALSE); - wxSound(int size, const wxByte* data); - ~wxSound(); - -public: - bool Create(const wxString& fileName, bool isResource = FALSE); - bool IsOk() const { return !m_sndname.IsEmpty(); } - -protected: - // prevent collision with some BSD definitions of macro Free() - bool FreeData(); - - bool DoPlay(unsigned flags) const; - -private: - void* m_sndChan; - - wxString m_sndname; - void* m_hSnd; - int m_waveLength; - bool m_isResource; -}; - -#endif -#endif - // _WX_SOUND_H_ diff --git a/include/wx/mac/carbon/spinbutt.h b/include/wx/mac/carbon/spinbutt.h deleted file mode 100644 index 3b33a8d5ad..0000000000 --- a/include/wx/mac/carbon/spinbutt.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.h -// Purpose: wxSpinButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPINBUTT_H_ -#define _WX_SPINBUTT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "spinbutt.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" - -/* - The wxSpinButton is like a small scrollbar than is often placed next - to a text control. - - wxSP_HORIZONTAL: horizontal spin button - wxSP_VERTICAL: vertical spin button (the default) - wxSP_ARROW_KEYS: arrow keys increment/decrement value - wxSP_WRAP: value wraps at either end - */ - -class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase -{ -public: - // construction - wxSpinButton(); - - wxSpinButton(wxWindow *parent, - wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxT("wxSpinButton")) - { - Create(parent, id, pos, size, style, name); - } - - virtual ~wxSpinButton(); - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxT("wxSpinButton")); - - - // accessors - virtual int GetMin() const; - virtual int GetMax() const; - virtual int GetValue() const; - virtual void SetValue(int val); - virtual void SetRange(int minVal, int maxVal); - - // implementation - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - void MacHandleValueChanged( int inc ) ; - virtual wxSize DoGetBestSize() const; - int m_value ; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinButton) -}; - -#endif - // _WX_SPINBUTT_H_ diff --git a/include/wx/mac/carbon/spinctrl.h b/include/wx/mac/carbon/spinctrl.h deleted file mode 100755 index 9ffd5d1ee2..0000000000 --- a/include/wx/mac/carbon/spinctrl.h +++ /dev/null @@ -1,188 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/spinctlg.h -// Purpose: generic wxSpinCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.10.99 -// RCS-ID: $Id$ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_SPINCTRL_H_ -#define _WX_MAC_SPINCTRL_H_ - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if -// wxSpinButton is available, this is what we do - but if it isn't, we still -// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but -// the different interface. This allows to write programs using wxSpinCtrl -// without tons of #ifdefs. -// ---------------------------------------------------------------------------- - -#if wxUSE_SPINBTN - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "spinctlg.h" -#endif - -class WXDLLEXPORT wxSpinButton; -class WXDLLEXPORT wxTextCtrl; - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSpinCtrl : public wxControl -{ -public: - wxSpinCtrl() { Init(); } - - wxSpinCtrl(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - Init(); - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); - - // wxTextCtrl-like method - void SetSelection(long from, long to); - - virtual ~wxSpinCtrl(); - - // operations - void SetValue(int val); - void SetValue(const wxString& text); - void SetRange(int min, int max); - - // accessors - int GetValue() const; - int GetMin() const; - int GetMax() const; - - // implementation from now on - - // forward these functions to all subcontrols - virtual bool Enable(bool enable = TRUE); - virtual bool Show(bool show = TRUE); - - // get the subcontrols - wxTextCtrl *GetText() const { return m_text; } - wxSpinButton *GetSpinButton() const { return m_btn; } - - // set the value of the text (only) - void SetTextValue(int val); - - // put the numeric value of the string in the text ctrl into val and return - // TRUE or return FALSE if the text ctrl doesn't contain a number or if the - // number is out of range - bool GetTextValue(int *val) const; - -protected: - // override the base class virtuals involved into geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - - // common part of all ctors - void Init(); - -private: - // the subcontrols - wxTextCtrl *m_text; - wxSpinButton *m_btn; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinCtrl) -}; - -#else // !wxUSE_SPINBTN - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is just a text control -// ---------------------------------------------------------------------------- - -#include "wx/textctrl.h" - -class WXDLLEXPORT wxSpinCtrl : public wxTextCtrl -{ -public: - wxSpinCtrl() { Init(); } - - wxSpinCtrl(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - SetRange(min, max); - - bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style, - wxDefaultValidator, name); - SetValue(initial); - - return ok; - } - - // accessors - int GetValue(int WXUNUSED(dummy) = 1) const - { - int n; - if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%d"), &n) != 1) ) - n = INT_MIN; - - return n; - } - - int GetMin() const { return m_min; } - int GetMax() const { return m_max; } - - // operations - void SetValue(const wxString& value) { wxTextCtrl::SetValue(value); } - void SetValue(int val) { wxString s; s << val; wxTextCtrl::SetValue(s); } - void SetRange(int min, int max) { m_min = min; m_max = max; } - -protected: - // initialize m_min/max with the default values - void Init() { SetRange(0, 100); } - - int m_min; - int m_max; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinCtrl) -}; - -#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN - -#endif // _WX_MAC_SPINCTRL_H_ - diff --git a/include/wx/mac/carbon/statbmp.h b/include/wx/mac/carbon/statbmp.h deleted file mode 100644 index 8a16726c57..0000000000 --- a/include/wx/mac/carbon/statbmp.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.h -// Purpose: wxStaticBitmap class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBMP_H_ -#define _WX_STATBMP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbmp.h" -#endif - -#include "wx/icon.h" - -class WXDLLEXPORT wxStaticBitmap: public wxStaticBitmapBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticBitmap) - public: - inline wxStaticBitmap() { } - - inline wxStaticBitmap(wxWindow *parent, wxWindowID id, - const wxBitmap& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxBitmap& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr); - - virtual void SetBitmap(const wxBitmap& bitmap); - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - void OnPaint( wxPaintEvent &event ) ; - - wxBitmap GetBitmap() const { return m_bitmap; } - wxIcon GetIcon() const - { - // icons and bitmaps are really the same thing in wxMac - return (const wxIcon &)m_bitmap; - } - void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; } - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return FALSE; } - virtual wxSize DoGetBestSize() const ; - - protected: - wxBitmap m_bitmap; - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBMP_H_ diff --git a/include/wx/mac/carbon/statbox.h b/include/wx/mac/carbon/statbox.h deleted file mode 100644 index 9f73a539ed..0000000000 --- a/include/wx/mac/carbon/statbox.h +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.h -// Purpose: wxStaticBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBOX_H_ -#define _WX_STATBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbox.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr; - -// Group box -class WXDLLEXPORT wxStaticBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxStaticBox) - - public: - inline wxStaticBox() {} - inline wxStaticBox(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBoxNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBoxNameStr); - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - - -protected: - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBOX_H_ diff --git a/include/wx/mac/carbon/statline.h b/include/wx/mac/carbon/statline.h deleted file mode 100644 index 911e9f535c..0000000000 --- a/include/wx/mac/carbon/statline.h +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/statline.h -// Purpose: a generic wxStaticLine class used for mac before adaptation -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_STATLINE_H_ -#define _WX_GENERIC_STATLINE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "statline.h" -#endif - -class wxStaticBox; - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticLine : public wxStaticLineBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticLine) - -public: - // constructors and pseudo-constructors - wxStaticLine() : m_statbox(NULL) { } - - wxStaticLine( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ) - : m_statbox(NULL) - { - Create(parent, id, pos, size, style, name); - } - - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ); - - // it's necessary to override this wxWindow function because we - // will want to return the main widget for m_statbox - // - WXWidget GetMainWidget() const; - -protected: - // we implement the static line using a static box - wxStaticBox *m_statbox; -}; - -#endif // _WX_GENERIC_STATLINE_H_ - diff --git a/include/wx/mac/carbon/stattext.h b/include/wx/mac/carbon/stattext.h deleted file mode 100644 index 17ecf98ad0..0000000000 --- a/include/wx/mac/carbon/stattext.h +++ /dev/null @@ -1,62 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.h -// Purpose: wxStaticText class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATTEXT_H_ -#define _WX_STATTEXT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "stattext.h" -#endif - -class WXDLLEXPORT wxStaticText: public wxStaticTextBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticText) - public: - inline wxStaticText() : m_label() { } - - inline wxStaticText(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticTextNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticTextNameStr); - - // accessors - void SetLabel( const wxString &str ) ; - bool SetFont( const wxFont &font ); - - // operations - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - // events - void DrawParagraph(wxDC &dc, wxString paragraph, int &y); - void OnPaint( wxPaintEvent &event ) ; - void OnDraw( wxDC &dc ) ; - virtual wxSize DoGetBestSize() const ; - virtual bool AcceptsFocus() const { return FALSE; } - private : - wxString m_label ; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATTEXT_H_ diff --git a/include/wx/mac/carbon/statusbr.h b/include/wx/mac/carbon/statusbr.h deleted file mode 100644 index 959c4e618d..0000000000 --- a/include/wx/mac/carbon/statusbr.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: statusbr.h -// Purpose: native implementation of wxStatusBar. Optional; can use generic -// version instead. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBAR_H_ -#define _WX_STATBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbrma.h" -#endif - -class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric -{ - DECLARE_DYNAMIC_CLASS(wxStatusBarMac); - - wxStatusBarMac(); - wxStatusBarMac(wxWindow *parent, wxWindowID id, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Create(parent, id, style, name); - } - - ~wxStatusBarMac(); - - bool Create(wxWindow *parent, wxWindowID id, - long style , - const wxString& name = wxPanelNameStr) ; - - virtual void DrawFieldText(wxDC& dc, int i); - virtual void DrawField(wxDC& dc, int i); - virtual void SetStatusText(const wxString& text, int number = 0) ; - //////////////////////////////////////////////////////////////////////// - // Implementation - - virtual void MacSuperEnabled( bool enable ) ; - - void OnPaint(wxPaintEvent& event); -protected: - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBAR_H_ diff --git a/include/wx/mac/carbon/tabctrl.h b/include/wx/mac/carbon/tabctrl.h deleted file mode 100644 index 7a6e14300a..0000000000 --- a/include/wx/mac/carbon/tabctrl.h +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.h -// Purpose: wxTabCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TABCTRL_H_ -#define _WX_TABCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "tabctrl.h" -#endif - -class wxImageList; - -/* - * Flags returned by HitTest - */ - -#define wxTAB_HITTEST_NOWHERE 1 -#define wxTAB_HITTEST_ONICON 2 -#define wxTAB_HITTEST_ONLABEL 4 -#define wxTAB_HITTEST_ONITEM 6 - -class WXDLLEXPORT wxTabCtrl: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxTabCtrl) - public: - /* - * Public interface - */ - - wxTabCtrl(); - - inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxT("tabCtrl")) - { - Create(parent, id, pos, size, style, name); - } - ~wxTabCtrl(); - -// Accessors - - // Get the selection - int GetSelection() const; - - // Get the tab with the current keyboard focus - int GetCurFocus() const; - - // Get the associated image list - wxImageList* GetImageList() const; - - // Get the number of items - int GetItemCount() const; - - // Get the rect corresponding to the tab - bool GetItemRect(int item, wxRect& rect) const; - - // Get the number of rows - int GetRowCount() const; - - // Get the item text - wxString GetItemText(int item) const ; - - // Get the item image - int GetItemImage(int item) const; - - // Get the item data - void* GetItemData(int item) const; - - // Set the selection - int SetSelection(int item); - - // Set the image list - void SetImageList(wxImageList* imageList); - - // Set the text for an item - bool SetItemText(int item, const wxString& text); - - // Set the image for an item - bool SetItemImage(int item, int image); - - // Set the data for an item - bool SetItemData(int item, void* data); - - // Set the size for a fixed-width tab control - void SetItemSize(const wxSize& size); - - // Set the padding between tabs - void SetPadding(const wxSize& padding); - -// Operations - - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxT("tabCtrl")); - - // Delete all items - bool DeleteAllItems(); - - // Delete an item - bool DeleteItem(int item); - - // Hit test - int HitTest(const wxPoint& pt, long& flags); - - // Insert an item - bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL); - - void Command(wxCommandEvent& event); - -protected: - wxImageList* m_imageList; - -DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxTabEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxTabEvent) - - public: - wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0); -}; - -typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&); - -#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \ - id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL }, -#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \ - id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL }, - -#endif - // _WX_TABCTRL_H_ diff --git a/include/wx/mac/carbon/taskbarosx.h b/include/wx/mac/carbon/taskbarosx.h deleted file mode 100644 index 9c921c063d..0000000000 --- a/include/wx/mac/carbon/taskbarosx.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: wx/mac/taskbarosx.h -// Purpose: Defines wxTaskBarIcon class for OSX -// Author: Ryan Norton -// Modified by: -// Created: 04/04/2003 -// RCS-ID: $Id$ -// Copyright: (c) Ryan Norton, 2003 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -#ifndef _TASKBAR_H_ -#define _TASKBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "taskbarosx.h" -#endif - -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxMenu; - -class WXDLLEXPORT wxTaskBarIcon : public wxTaskBarIconBase -{ -public: - //type of taskbar item to create (currently only DOCK is implemented) - enum wxTaskBarIconType - { - DOCK, - STATUSITEM, - MENUEXTRA - }; - - wxTaskBarIcon(const wxTaskBarIconType& nType = DOCK); - virtual ~wxTaskBarIcon(); - - // Operations: - bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); - bool RemoveIcon(); - bool PopupMenu(wxMenu *menu); - -protected: - wxTaskBarIconType m_nType; - - DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) -}; - -#endif - // _TASKBAR_H_ diff --git a/include/wx/mac/carbon/textctrl.h b/include/wx/mac/carbon/textctrl.h deleted file mode 100644 index df3a964339..0000000000 --- a/include/wx/mac/carbon/textctrl.h +++ /dev/null @@ -1,184 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.h -// Purpose: wxTextCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTCTRL_H_ -#define _WX_TEXTCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "textctrl.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr; - -// Single-line text item -class WXDLLEXPORT wxTextCtrl: public wxTextCtrlBase -{ - DECLARE_DYNAMIC_CLASS(wxTextCtrl) - -public: - // creation - // -------- - wxTextCtrl() { Init(); } - ~wxTextCtrl(); - wxTextCtrl(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTextCtrlNameStr) - { - Init(); - - Create(parent, id, value, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTextCtrlNameStr); - - // accessors - // --------- - virtual wxString GetValue() const ; - virtual void SetValue(const wxString& value); - - virtual int GetLineLength(long lineNo) const; - virtual wxString GetLineText(long lineNo) const; - virtual int GetNumberOfLines() const; - - virtual bool IsModified() const; - virtual bool IsEditable() const; - - // If the return values from and to are the same, there is no selection. - virtual void GetSelection(long* from, long* to) const; - - // operations - // ---------- - - // editing - - virtual void Clear(); - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - - // load the controls contents from the file - virtual bool LoadFile(const wxString& file); - - // sets/clears the dirty flag - virtual void MarkDirty(); - virtual void DiscardEdits(); - - // set the max number of characters which may be entered in a single line - // text control - virtual void SetMaxLength(unsigned long len) ; - - // text control under some platforms supports the text styles: these - // methods allow to apply the given text style to the given selection or to - // set/get the style which will be used for all appended text - virtual bool SetStyle(long start, long end, const wxTextAttr& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - - // writing text inserts it at the current position, appending always - // inserts it at the end - virtual void WriteText(const wxString& text); - virtual void AppendText(const wxString& text); - - // translate between the position (which is just an index in the text ctrl - // considering all its contents as a single strings) and (x, y) coordinates - // which represent column and line. - virtual long XYToPosition(long x, long y) const; - virtual bool PositionToXY(long pos, long *x, long *y) const; - - virtual void ShowPosition(long pos); - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - - virtual bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - - // Undo/redo - virtual void Undo(); - virtual void Redo(); - - virtual bool CanUndo() const; - virtual bool CanRedo() const; - - // Insertion point - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const; - virtual long GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - - // Implementation from now on - // -------------------------- - - // Implementation - // -------------- - virtual void Command(wxCommandEvent& event); - - virtual bool AcceptsFocus() const; - - // callbacks - void OnDropFiles(wxDropFilesEvent& event); - void OnChar(wxKeyEvent& event); // Process 'enter' if required - - void OnCut(wxCommandEvent& event); - void OnCopy(wxCommandEvent& event); - void OnPaste(wxCommandEvent& event); - void OnUndo(wxCommandEvent& event); - void OnRedo(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - - virtual bool MacCanFocus() const { return true ; } - virtual bool MacSetupCursor( const wxPoint& pt ) ; - - virtual void MacSuperShown( bool show ) ; - virtual bool Show(bool show = TRUE) ; - -protected: - // common part of all ctors - void Init(); - - virtual wxSize DoGetBestSize() const; - - bool m_editable ; - - // flag is set to true when the user edits the controls contents - bool m_dirty; - - // one of the following objects is used for representation, the other one is NULL - void* m_macTE ; - void* m_macTXN ; - void* m_macTXNvars ; - bool m_macUsesTXN ; - unsigned long m_maxLength ; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_TEXTCTRL_H_ diff --git a/include/wx/mac/carbon/tglbtn.h b/include/wx/mac/carbon/tglbtn.h deleted file mode 100644 index 5ab29aa84c..0000000000 --- a/include/wx/mac/carbon/tglbtn.h +++ /dev/null @@ -1,59 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/tglbtn.h -// Purpose: Declaration of the wxToggleButton class, which implements a -// toggle button under wxMac. -// Author: Stefan Csomor -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id$ -// Copyright: (c) 2004 Stefan Csomor -// License: wxWindows License -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOGGLEBUTTON_H_ -#define _WX_TOGGLEBUTTON_H_ - -WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr; - -// Checkbox item (single checkbox) -class WXDLLEXPORT wxToggleButton : public wxControl -{ -public: - wxToggleButton() {} - wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - - virtual void SetValue(bool value); - virtual bool GetValue() const ; - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - - virtual void Command(wxCommandEvent& event); - -protected: - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton) -}; - -#endif // _WX_TOGGLEBUTTON_H_ - diff --git a/include/wx/mac/carbon/timer.h b/include/wx/mac/carbon/timer.h deleted file mode 100644 index 1d01ea91a4..0000000000 --- a/include/wx/mac/carbon/timer.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.h -// Purpose: wxTimer class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIMER_H_ -#define _WX_TIMER_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "timer.h" -#endif - -#include "wx/object.h" -#include "wx/mac/macnotfy.h" - -class wxTimer ; - -struct MacTimerInfo ; - -class WXDLLEXPORT wxTimer: public wxTimerBase -{ -public: - wxTimer() { Init(); } - wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id) { Init(); } - ~wxTimer(); - - virtual bool Start(int milliseconds = -1, - bool one_shot = FALSE); // Start timer - virtual void Stop(); // Stop timer - - virtual bool IsRunning() const ; - - MacTimerInfo* m_info; -protected : - void Init(); -private: - - DECLARE_ABSTRACT_CLASS(wxTimer) -}; - -#endif - // _WX_TIMER_H_ diff --git a/include/wx/mac/carbon/toolbar.h b/include/wx/mac/carbon/toolbar.h deleted file mode 100644 index 1849125750..0000000000 --- a/include/wx/mac/carbon/toolbar.h +++ /dev/null @@ -1,96 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.h -// Purpose: wxToolBar class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOOLBAR_H_ -#define _WX_TOOLBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "toolbar.h" -#endif - -#if wxUSE_TOOLBAR - -#include "wx/tbarbase.h" -#include "wx/dynarray.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; - -class WXDLLEXPORT wxToolBar: public wxToolBarBase -{ - DECLARE_DYNAMIC_CLASS(wxToolBar) - public: - /* - * Public interface - */ - - wxToolBar() { Init(); } - - - inline wxToolBar(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER|wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr) - { - Init(); - Create(parent, id, pos, size, style, name); - } - ~wxToolBar(); - - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER|wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr); - - // override/implement base class virtuals - virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; - - virtual bool Realize(); - - virtual void SetToolBitmapSize(const wxSize& size); - virtual wxSize GetToolSize() const; - - virtual void SetRows(int nRows); - - // Add all the buttons - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual wxString MacGetToolTipString( wxPoint &where ) ; - void OnPaint(wxPaintEvent& event) ; - void OnMouse(wxMouseEvent& event) ; - virtual void MacSuperChangedPosition() ; -protected: - // common part of all ctors - void Init(); - - // implement base class pure virtuals - virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); - virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); - - virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); - virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); - virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); - - virtual wxToolBarToolBase *CreateTool(int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp); - virtual wxToolBarToolBase *CreateTool(wxControl *control); - - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_TOOLBAR - -#endif - // _WX_TOOLBAR_H_ diff --git a/include/wx/mac/carbon/tooltip.h b/include/wx/mac/carbon/tooltip.h deleted file mode 100644 index 7bf4ecf440..0000000000 --- a/include/wx/mac/carbon/tooltip.h +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/tooltip.h -// Purpose: wxToolTip class - tooltip control -// Author: Stefan Csomor -// Modified by: -// Created: 31.01.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin, Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - - -class wxToolTip : public wxObject -{ -public: - // ctor & dtor - wxToolTip(const wxString &tip); - virtual ~wxToolTip(); - - // accessors - // tip text - void SetTip(const wxString& tip); - const wxString& GetTip() const { return m_text; } - - // the window we're associated with - void SetWindow(wxWindow *win); - wxWindow *GetWindow() const { return m_window; } - - // controlling tooltip behaviour: globally change tooltip parameters - // enable or disable the tooltips globally - static void Enable(bool flag); - // set the delay after which the tooltip appears - static void SetDelay(long milliseconds); - static void NotifyWindowDelete( WXHWND win ) ; - - // implementation only from now on - // ------------------------------- - - // should be called in response to mouse events - static void RelayEvent(wxWindow *win , wxMouseEvent &event); - static void RemoveToolTips(); - -private: - wxString m_text; // tooltip text - wxWindow *m_window; // window we're associated with - DECLARE_ABSTRACT_CLASS(wxToolTip) -}; - diff --git a/include/wx/mac/carbon/toplevel.h b/include/wx/mac/carbon/toplevel.h deleted file mode 100644 index ffb0bcd288..0000000000 --- a/include/wx/mac/carbon/toplevel.h +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/toplevel.h -// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW -// Author: Stefan Csomor -// Modified by: -// Created: 20.09.01 -// RCS-ID: $Id$ -// Copyright: (c) 2001 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TOPLEVEL_H_ -#define _WX_MSW_TOPLEVEL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "toplevel.h" -#endif - -#if wxUSE_SYSTEM_OPTIONS - #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition") -#endif - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase -{ -public: - // constructors and such - wxTopLevelWindowMac() { Init(); } - - wxTopLevelWindowMac(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init(); - - (void)Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - virtual ~wxTopLevelWindowMac(); - - // implement base class pure virtuals - virtual void Maximize(bool maximize = TRUE); - virtual bool IsMaximized() const; - virtual void Iconize(bool iconize = TRUE); - virtual bool IsIconized() const; - virtual void SetIcon(const wxIcon& icon); - virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } - virtual void Restore(); - - virtual bool SetShape(const wxRegion& region); - - virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) - { return FALSE; } - virtual bool IsFullScreen() const { return FALSE; } - - // implementation from now on - // -------------------------- - - static void MacDelayedDeactivation(long timestamp); - virtual void MacCreateRealWindow( const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) ; - static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } - virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; - virtual void ClearBackground() ; - virtual WXWidget MacGetContainerForEmbedding() ; - WXWindow MacGetWindowRef() { return m_macWindow ; } - virtual void MacActivate( long timestamp , bool inIsActivating ) ; - virtual void MacUpdate( long timestamp ) ; -#if !TARGET_CARBON - virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; - virtual void MacKeyDown( WXEVENTREF ev ) ; -#endif - virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; - virtual void Raise(); - virtual void Lower(); - virtual void SetTitle( const wxString& title); - virtual bool Show( bool show = TRUE ); - virtual void DoMoveWindow(int x, int y, int width, int height); - void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; - short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; } - static bool MacEnableCompositing( bool useCompositing ); - bool MacUsesCompositing() { return m_macUsesCompositing; } - -#if TARGET_CARBON - WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } -#endif -protected: - // common part of all ctors - void Init(); - - // is the frame currently iconized? - bool m_iconized; - - // should the frame be maximized when it will be shown? set by Maximize() - // when it is called while the frame is hidden - bool m_maximizeOnShow; - bool m_macUsesCompositing ; - - short m_macWindowBackgroundTheme ; - WXWindow m_macWindow ; - WXWidget m_macRootControl ; - wxWindowMac* m_macFocus ; - WXHRGN m_macNoEraseUpdateRgn ; - bool m_macNeedsErasing ; - - static WXWindow s_macWindowInUpdate ; - static wxTopLevelWindowMac *s_macDeactivateWindow; - static bool s_macWindowCompositing ; -private : -#if TARGET_CARBON - WXEVENTHANDLERREF m_macEventHandler ; -#endif -}; - -// list of all frames and modeless dialogs -extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; - -// associate mac windows with wx counterparts - -wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ; -void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ; -void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ; - - -#endif // _WX_MSW_TOPLEVEL_H_ - diff --git a/include/wx/mac/carbon/treectrl.h b/include/wx/mac/carbon/treectrl.h deleted file mode 100644 index 306a0105a5..0000000000 --- a/include/wx/mac/carbon/treectrl.h +++ /dev/null @@ -1,295 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.h -// Purpose: wxTreeCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TREECTRL_H_ -#define _WX_TREECTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "treectrl.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" - -#define wxTREE_MASK_HANDLE 0x0001 -#define wxTREE_MASK_STATE 0x0002 -#define wxTREE_MASK_TEXT 0x0004 -#define wxTREE_MASK_IMAGE 0x0008 -#define wxTREE_MASK_SELECTED_IMAGE 0x0010 -#define wxTREE_MASK_CHILDREN 0x0020 -#define wxTREE_MASK_DATA 0x0040 - -#define wxTREE_STATE_BOLD 0x0001 -#define wxTREE_STATE_DROPHILITED 0x0002 -#define wxTREE_STATE_EXPANDED 0x0004 -#define wxTREE_STATE_EXPANDEDONCE 0x0008 -#define wxTREE_STATE_FOCUSED 0x0010 -#define wxTREE_STATE_SELECTED 0x0020 -#define wxTREE_STATE_CUT 0x0040 - -#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area. -#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area. -#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item. -#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item. -#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item. -#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item. -#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item. -#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item. -#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state. -#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area. -#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area. - -#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL | wxTREE_HITTEST_ONITEMSTATEICON) - -// Flags for GetNextItem -enum { - wxTREE_NEXT_CARET, // Retrieves the currently selected item. - wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL. - wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation. - wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item. - wxTREE_NEXT_NEXT, // Retrieves the next sibling item. - wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item. - wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item. - wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item. - wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item. - wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part. -}; - -// Flags for ExpandItem -enum { - wxTREE_EXPAND_EXPAND, - wxTREE_EXPAND_COLLAPSE, - wxTREE_EXPAND_COLLAPSE_RESET, - wxTREE_EXPAND_TOGGLE -}; - -// Flags for InsertItem -enum { - wxTREE_INSERT_LAST = -1, - wxTREE_INSERT_FIRST = -2, - wxTREE_INSERT_SORT = -3 -}; - -class WXDLLEXPORT wxTreeItem: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxTreeItem) -public: - long m_mask; - long m_itemId; - long m_state; - long m_stateMask; - wxString m_text; - int m_image; - int m_selectedImage; - int m_children; - long m_data; - - wxTreeItem(); - -// Accessors - inline long GetMask() const { return m_mask; } - inline long GetItemId() const { return m_itemId; } - inline long GetState() const { return m_state; } - inline long GetStateMask() const { return m_stateMask; } - inline wxString GetText() const { return m_text; } - inline int GetImage() const { return m_image; } - inline int GetSelectedImage() const { return m_selectedImage; } - inline int GetChildren() const { return m_children; } - inline long GetData() const { return m_data; } - - inline void SetMask(long mask) { m_mask = mask; } - inline void SetItemId(long id) { m_itemId = m_itemId = id; } - inline void SetState(long state) { m_state = state; } - inline void SetStateMask(long stateMask) { m_stateMask = stateMask; } - inline void GetText(const wxString& text) { m_text = text; } - inline void SetImage(int image) { m_image = image; } - inline void GetSelectedImage(int selImage) { m_selectedImage = selImage; } - inline void SetChildren(int children) { m_children = children; } - inline void SetData(long data) { m_data = data; } -}; - -class WXDLLEXPORT wxTreeCtrl: public wxControl -{ -public: - /* - * Public interface - */ - - // creation - // -------- - wxTreeCtrl(); - - inline wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl") - { - Create(parent, id, pos, size, style, validator, name); - } - ~wxTreeCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl"); - - // accessors - // --------- - // - int GetCount() const; - - // indent - int GetIndent() const; - void SetIndent(int indent); - // image list - wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const; - void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL); - - // navigation inside the tree - long GetNextItem(long item, int code) const; - bool ItemHasChildren(long item) const; - long GetChild(long item) const; - long GetItemParent(long item) const; - long GetFirstVisibleItem() const; - long GetNextVisibleItem(long item) const; - long GetSelection() const; - long GetRootItem() const; - - // generic function for (g|s)etting item attributes - bool GetItem(wxTreeItem& info) const; - bool SetItem(wxTreeItem& info); - // item state - int GetItemState(long item, long stateMask) const; - bool SetItemState(long item, long state, long stateMask); - // item image - bool SetItemImage(long item, int image, int selImage); - // item text - wxString GetItemText(long item) const; - void SetItemText(long item, const wxString& str); - // custom data associated with the item - long GetItemData(long item) const; - bool SetItemData(long item, long data); - // convenience function - bool IsItemExpanded(long item) - { - return (GetItemState(item, wxTREE_STATE_EXPANDED) & - wxTREE_STATE_EXPANDED) != 0; - } - - // bounding rect - bool GetItemRect(long item, wxRect& rect, bool textOnly = FALSE) const; - // - wxTextCtrl* GetEditControl() const; - - // operations - // ---------- - // adding/deleting items - bool DeleteItem(long item); - long InsertItem(long parent, wxTreeItem& info, - long insertAfter = wxTREE_INSERT_LAST); - // If image > -1 and selImage == -1, the same image is used for - // both selected and unselected items. - long InsertItem(long parent, const wxString& label, - int image = -1, int selImage = -1, - long insertAfter = wxTREE_INSERT_LAST); - - // changing item state - bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); } - bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); } - bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); } - // common interface for {Expand|Collapse|Toggle}Item - bool ExpandItem(long item, int action); - - // - bool SelectItem(long item); - bool ScrollTo(long item); - bool DeleteAllItems(); - - // Edit the label (tree must have the focus) - wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - - // End label editing, optionally cancelling the edit - bool EndEditLabel(bool cancel); - - long HitTest(const wxPoint& point, int& flags); - // wxImageList *CreateDragImage(long item); - bool SortChildren(long item); - bool EnsureVisible(long item); - - void Command(wxCommandEvent& event) { ProcessCommand(event); }; - -protected: - wxTextCtrl* m_textCtrl; - wxImageList* m_imageListNormal; - wxImageList* m_imageListState; - - DECLARE_DYNAMIC_CLASS(wxTreeCtrl) -}; - -/* - wxEVT_COMMAND_TREE_BEGIN_DRAG, - wxEVT_COMMAND_TREE_BEGIN_RDRAG, - wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, - wxEVT_COMMAND_TREE_END_LABEL_EDIT, - wxEVT_COMMAND_TREE_DELETE_ITEM, - wxEVT_COMMAND_TREE_GET_INFO, - wxEVT_COMMAND_TREE_SET_INFO, - wxEVT_COMMAND_TREE_ITEM_EXPANDED, - wxEVT_COMMAND_TREE_ITEM_EXPANDING, - wxEVT_COMMAND_TREE_ITEM_COLLAPSED, - wxEVT_COMMAND_TREE_ITEM_COLLAPSING, - wxEVT_COMMAND_TREE_SEL_CHANGED, - wxEVT_COMMAND_TREE_SEL_CHANGING, - wxEVT_COMMAND_TREE_KEY_DOWN -*/ - -class WXDLLEXPORT wxTreeEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxTreeEvent) - - public: - wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - - int m_code; - wxTreeItem m_item; - long m_oldItem; - wxPoint m_pointDrag; - - inline long GetOldItem() const { return m_oldItem; } - inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; } - inline wxPoint GetPoint() const { return m_pointDrag; } - inline int GetCode() const { return m_code; } -}; - -typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); - -#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -#endif - // _WX_TREECTRL_H_ diff --git a/include/wx/mac/carbon/uma.h b/include/wx/mac/carbon/uma.h deleted file mode 100644 index c862427f62..0000000000 --- a/include/wx/mac/carbon/uma.h +++ /dev/null @@ -1,131 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uma.h -// Purpose: Universal MacOS API -// Author: Stefan Csomor -// Modified by: -// Created: 03/02/99 -// RCS-ID: $Id: -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef H_UMA -#define H_UMA - -#include "wx/mac/private.h" - -void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded) ; -void UMACleanupToolbox() ; -long UMAGetSystemVersion() ; -bool UMAHasAppearance() ; -long UMAGetAppearanceVersion() ; -bool UMAHasWindowManager() ; -long UMAGetWindowManagerAttr() ; -bool UMAHasAquaLayout() ; - -bool UMASystemIsInitialized() ; -void UMASetSystemIsInitialized(bool val); - -// process manager - -long UMAGetProcessMode() ; -bool UMAGetProcessModeDoesActivateOnFGSwitch() ; - -#if wxUSE_GUI - -// menu manager - -MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding) ; -void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding) ; -UInt32 UMAMenuEvent( EventRecord *inEvent ) ; -void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item , bool enable ) ; - -void UMAAppendSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , SInt16 submenuid ) ; -void UMAInsertSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , SInt16 submenuid ) ; -void UMAAppendMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , wxAcceleratorEntry *entry = NULL ) ; -void UMAInsertMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry = NULL ) ; -void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry ) ; - -void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding ) ; - -// quickdraw - -void UMAShowWatchCursor() ; -void UMAShowArrowCursor() ; - -#if !TARGET_CARBON -OSStatus UMAPrOpen() ; -OSStatus UMAPrClose() ; -#endif - -// window manager - -GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ; -void UMADisposeWindow( WindowRef inWindowRef ) ; -void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding) ; - -void UMADrawGrowIcon( WindowRef inWindowRef ) ; -void UMAShowHide( WindowRef inWindowRef , Boolean show) ; - -// appearance manager - -void UMADrawControl( ControlHandle inControl ) ; - -void UMAEnableControl( ControlHandle inControl ) ; -void UMADisableControl( ControlHandle inControl ) ; -void UMAActivateControl( ControlHandle inControl ) ; -void UMADeactivateControl( ControlHandle inControl ) ; -// ControlPartCode hiliteState) ; -void UMAShowControl (ControlHandle theControl) ; -void UMAHideControl (ControlHandle theControl); -void UMAActivateControl (ControlHandle inControl); -void UMADeactivateControl (ControlHandle inControl); -void UMASetControlTitle( ControlHandle inControl , const wxString& title , wxFontEncoding encoding) ; - -void UMAMoveControl( ControlHandle inControl , short x , short y ) ; -void UMASizeControl( ControlHandle inControl , short x , short y ) ; -// control hierarchy - -// keyboard focus -OSErr UMASetKeyboardFocus (WindowPtr inWindow, - ControlHandle inControl, - ControlFocusPart inPart) ; - -// events - -void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; -OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; - -// handling control data -bool UMAIsWindowFloating( WindowRef inWindow ) ; -bool UMAIsWindowModal( WindowRef inWindow ) ; - -void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; - -OSStatus UMAGetHelpMenu( - MenuRef * outHelpMenu, - MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */ - -// Appearance Drawing - -OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; - -// Clipboard support - -OSStatus UMAPutScrap( Size size , OSType type , void *data ) ; - -// accessor helpers - -#if !TARGET_CARBON -#define ClearCurrentScrap() ZeroScrap() ; -#define GetApplicationScript() smSystemScript -#else - -// calls not in carbon - -#endif -#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) - -#endif // wxUSE_GUI - -#endif diff --git a/include/wx/mac/carbon/window.h b/include/wx/mac/carbon/window.h deleted file mode 100644 index 807e261863..0000000000 --- a/include/wx/mac/carbon/window.h +++ /dev/null @@ -1,269 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: window.h -// Purpose: wxWindowMac class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_ -#define _WX_WINDOW_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "window.h" -#endif - -#include "wx/brush.h" - -// --------------------------------------------------------------------------- -// forward declarations -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxButton; -class WXDLLEXPORT wxScrollBar; -class WXDLLEXPORT wxTopLevelWindowMac; - -// --------------------------------------------------------------------------- -// constants -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowMac: public wxWindowBase -{ - DECLARE_DYNAMIC_CLASS(wxWindowMac) - - friend class wxDC; - friend class wxPaintDC; - -public: - - wxWindowMac() - : m_macBackgroundBrush() - , m_macVisibleRegion() - , m_x(0), m_y(0), m_width(0), m_height(0) - , m_hScrollBar(NULL), m_vScrollBar(NULL) - , m_label(wxEmptyString) - { Init(); } - - wxWindowMac(wxWindowMac *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Init(); - Create(parent, id, pos, size, style, name); - } - - virtual ~wxWindowMac(); - - bool Create(wxWindowMac *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr); - - - // implement base class pure virtuals - virtual void SetTitle( const wxString& title); - virtual wxString GetTitle() const; - - virtual void Raise(); - virtual void Lower(); - - virtual bool Show( bool show = TRUE ); - virtual bool Enable( bool enable = TRUE ); - - virtual void SetFocus(); - - virtual void WarpPointer(int x, int y); - - virtual void Refresh( bool eraseBackground = TRUE, - const wxRect *rect = (const wxRect *) NULL ); - - virtual bool SetCursor( const wxCursor &cursor ); - virtual bool SetFont(const wxFont& font) - { return wxWindowBase::SetFont(font); } - virtual int GetCharHeight() const; - virtual int GetCharWidth() const; - virtual void GetTextExtent(const wxString& string, - int *x, int *y, - int *descent = (int *) NULL, - int *externalLeading = (int *) NULL, - const wxFont *theFont = (const wxFont *) NULL) - const; - - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); - - virtual void SetScrollbar( int orient, int pos, int thumbVisible, - int range, bool refresh = TRUE ); - virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ); - virtual int GetScrollPos( int orient ) const; - virtual int GetScrollThumb( int orient ) const; - virtual int GetScrollRange( int orient ) const; - virtual void ScrollWindow( int dx, int dy, - const wxRect* rect = (wxRect *) NULL ); - -#if wxUSE_DRAG_AND_DROP - virtual void SetDropTarget( wxDropTarget *dropTarget ); -#endif // wxUSE_DRAG_AND_DROP - - // Accept files for dragging - virtual void DragAcceptFiles(bool accept); - - // Native resource loading (implemented in src/msw/nativdlg.cpp) - // FIXME: should they really be all virtual? - wxWindowMac* GetWindowChild1(wxWindowID id); - wxWindowMac* GetWindowChild(wxWindowID id); - - // implementation from now on - // -------------------------- - - void MacClientToRootWindow( int *x , int *y ) const ; - void MacRootWindowToClient( int *x , int *y ) const ; - void MacWindowToRootWindow( int *x , int *y ) const ; - void MacRootWindowToWindow( int *x , int *y ) const ; - - virtual wxString MacGetToolTipString( wxPoint &where ) ; - - // simple accessors - // ---------------- - -// WXHWND GetHWND() const { return m_hWnd; } -// void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; } - virtual WXWidget GetHandle() const { return (WXWidget) NULL ; } - - bool GetTransparentBackground() const { return m_backgroundTransparent; } - void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; } - - // event handlers - // -------------- - void OnSetFocus(wxFocusEvent& event) ; - void OnNcPaint(wxNcPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); - void OnMouseEvent( wxMouseEvent &event ) ; - - void MacOnScroll(wxScrollEvent&event ) ; - - bool AcceptsFocus() const ; - -public: - void OnInternalIdle(); - - // For implementation purposes - sometimes decorations make the client area - // smaller - virtual wxPoint GetClientAreaOrigin() const; - - wxWindowMac *FindItem(long id) const; - wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const; - - // Make a Windows extended style from the given wxWindows window style - static WXDWORD MakeExtendedStyle(long style, - bool eliminateBorders = TRUE); - // Determine whether 3D effects are wanted - WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const; - - // MSW only: TRUE if this control is part of the main control - virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; }; - - // Setup background and foreground colours correctly - virtual void SetupColours(); - -public: - static bool MacGetWindowFromPoint( const wxPoint &point , wxWindowMac** outWin ) ; - virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ; - virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ; - virtual bool MacCanFocus() const { return true ; } - - virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ; - // this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren - virtual void RemoveChild( wxWindowBase *child ); - virtual void MacPaintBorders( int left , int top ) ; - WXWindow MacGetRootWindow() const ; - wxTopLevelWindowMac* MacGetTopLevelWindow() const ; - - virtual WXWidget MacGetContainerForEmbedding() ; - - virtual long MacGetLeftBorderSize() const ; - virtual long MacGetRightBorderSize() const ; - virtual long MacGetTopBorderSize() const ; - virtual long MacGetBottomBorderSize() const ; - - static long MacRemoveBordersFromStyle( long style ) ; - virtual void MacSuperChangedPosition() ; - // the absolute coordinates of this item within the toplevel window may have changed - virtual void MacUpdateDimensions() {} - // the absolute coortinates of this window's root have changed - virtual void MacTopLevelWindowChangedPosition() ; - virtual void MacSuperShown( bool show ) ; - virtual void MacSuperEnabled( bool enable ) ; - bool MacIsReallyShown() const ; - virtual void Update() ; - // for compatibility - void MacUpdateImmediately() { Update() ; } - virtual bool MacSetupCursor( const wxPoint& pt ) ; - -// virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ; -// virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ; -// virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ; - const wxBrush& MacGetBackgroundBrush() ; - const wxRegion& MacGetVisibleRegion( bool respectChildrenAndSiblings = true ) ; - bool MacIsWindowScrollbar( const wxScrollBar* sb ) - { return (m_hScrollBar == sb || m_vScrollBar == sb) ; } - static wxWindowMac* s_lastMouseWindow ; -private: -protected: - wxBrush m_macBackgroundBrush ; - wxRegion m_macVisibleRegion ; - int m_x ; - int m_y ; - int m_width ; - int m_height ; - - wxScrollBar* m_hScrollBar ; - wxScrollBar* m_vScrollBar ; - wxString m_label ; - - void MacCreateScrollBars( long style ) ; - void MacRepositionScrollBars() ; - - bool m_backgroundTransparent ; - - // implement the base class pure virtuals - virtual void DoClientToScreen( int *x, int *y ) const; - virtual void DoScreenToClient( int *x, int *y ) const; - virtual void DoGetPosition( int *x, int *y ) const; - virtual void DoGetSize( int *width, int *height ) const; - virtual void DoGetClientSize( int *width, int *height ) const; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - virtual void DoSetClientSize(int width, int height); - - virtual void DoCaptureMouse(); - virtual void DoReleaseMouse(); - - // move the window to the specified location and resize it: this is called - // from both DoSetSize() and DoSetClientSize() and would usually just call - // ::MoveWindow() except for composite controls which will want to arrange - // themselves inside the given rectangle - virtual void DoMoveWindow(int x, int y, int width, int height); - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif // wxUSE_TOOLTIPS - -private: - // common part of all ctors - void Init(); - - DECLARE_NO_COPY_CLASS(wxWindowMac) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_WINDOW_H_ diff --git a/include/wx/mac/classic/accel.h b/include/wx/mac/classic/accel.h deleted file mode 100644 index 25acc73bea..0000000000 --- a/include/wx/mac/classic/accel.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: accel.h -// Purpose: wxAcceleratorTable class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCEL_H_ -#define _WX_ACCEL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "accel.h" -#endif - -#include "wx/string.h" -#include "wx/event.h" - -class WXDLLEXPORT wxAcceleratorTable: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) -public: - wxAcceleratorTable(); - wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array - - // Copy constructors - wxAcceleratorTable(const wxAcceleratorTable& accel) - : wxObject() - { Ref(accel); } - wxAcceleratorTable(const wxAcceleratorTable* accel) - { if (accel) Ref(*accel); } - - ~wxAcceleratorTable(); - - wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) - { if (*this == accel) return (*this); Ref(accel); return *this; } - bool operator == (const wxAcceleratorTable& accel) - { return m_refData == accel.m_refData; } - bool operator != (const wxAcceleratorTable& accel) - { return m_refData != accel.m_refData; } - - bool Ok() const; - - int GetCommand( wxKeyEvent &event ); -}; - -// WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable; - -#endif - // _WX_ACCEL_H_ diff --git a/include/wx/mac/classic/aga.h b/include/wx/mac/classic/aga.h deleted file mode 100644 index 5868b3f8ee..0000000000 --- a/include/wx/mac/classic/aga.h +++ /dev/null @@ -1,13 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: aga.h -// Purpose: Gray Controls implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// NOT NEEDED ANYMORE \ No newline at end of file diff --git a/include/wx/mac/classic/app.h b/include/wx/mac/classic/app.h deleted file mode 100644 index efc50cbea2..0000000000 --- a/include/wx/mac/classic/app.h +++ /dev/null @@ -1,207 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.h -// Purpose: wxApp class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_APP_H_ -#define _WX_APP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "app.h" -#endif - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/gdicmn.h" -#include "wx/event.h" - -class WXDLLEXPORT wxFrame; -class WXDLLEXPORT wxWindowMac; -class WXDLLEXPORT wxApp ; -class WXDLLEXPORT wxKeyEvent; -class WXDLLEXPORT wxLog; - -#define wxPRINT_WINDOWS 1 -#define wxPRINT_POSTSCRIPT 2 - -WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; - -// Force an exit from main loop -void WXDLLEXPORT wxExit(); - -// Yield to other apps/messages -bool WXDLLEXPORT wxYield(); - -// Represents the application. Derive OnInit and declare -// a new App object to start application -class WXDLLEXPORT wxApp: public wxAppBase -{ - DECLARE_DYNAMIC_CLASS(wxApp) - - wxApp(); - virtual ~wxApp() {} - - virtual int MainLoop(); - virtual void ExitMainLoop(); - virtual bool Pending() ; - virtual bool Dispatch() ; - - virtual void Exit(); - - virtual bool Yield(bool onlyIfNeeded = FALSE); - virtual void WakeUpIdle(); - - virtual void SetPrintMode(int mode) { m_printMode = mode; } - virtual int GetPrintMode() const { return m_printMode; } - -#if wxUSE_GUI - // setting up all MacOS Specific Event-Handlers etc - virtual bool OnInitGui(); -#endif // wxUSE_GUI - // implementation only - void OnIdle(wxIdleEvent& event); - void OnEndSession(wxCloseEvent& event); - void OnQueryEndSession(wxCloseEvent& event); - - // Windows only, but for compatibility... - inline void SetAuto3D(bool flag) { m_auto3D = flag; } - inline bool GetAuto3D() const { return m_auto3D; } - -protected: - bool m_showOnInit; - int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT - bool m_auto3D ; // Always use 3D controls, except - // where overriden -public: - - static bool sm_isEmbedded; - // Implementation - virtual bool Initialize(int& argc, wxChar **argv); - virtual void CleanUp(); - - bool IsExiting() { return !m_keepGoing ; } -#if TARGET_CARBON - // the installed application event handler - WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } - WXEVENTHANDLERREF MacGetCurrentEventHandlerCallRef() { return m_macCurrentEventHandlerCallRef ; } - void MacSetCurrentEvent( WXEVENTREF event , WXEVENTHANDLERCALLREF handler ) - { m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; } -#endif - -public: - static long sm_lastMessageTime; - static wxWindow* s_captureWindow ; - static int s_lastMouseDown ; // 0 = none , 1 = left , 2 = right - static WXHRGN s_macCursorRgn ; - static long s_lastModifiers ; - - int m_nCmdShow; - -private: - bool m_keepGoing ; - - // mac specifics -#if TARGET_CARBON - WXEVENTHANDLERREF m_macEventHandler ; - WXEVENTHANDLERCALLREF m_macCurrentEventHandlerCallRef ; -#endif - WXEVENTREF m_macCurrentEvent ; - -public: - static bool s_macSupportPCMenuShortcuts ; - static long s_macAboutMenuItemId ; - static long s_macPreferencesMenuItemId ; - static long s_macExitMenuItemId ; - static wxString s_macHelpMenuTitleName ; - - static bool s_macHasAppearance ; - static long s_macAppearanceVersion ; - static bool s_macHasNavigation ; - static bool s_macNavigationVersion ; - static bool s_macHasWindowManager ; - static long s_macWindowManagerVersion ; - static bool s_macHasMenuManager ; - static long s_macMenuManagerVersion ; - static bool s_macHasDialogManager ; - static long s_macDialogManagerVersion ; - - WXHRGN m_macCursorRgn ; - WXHRGN m_macSleepRgn ; - WXHRGN m_macHelpRgn ; - - virtual void MacSuspend( bool convertClipboard ) ; - virtual void MacResume( bool convertClipboard ) ; - virtual void MacConvertPrivateToPublicScrap() ; - virtual void MacConvertPublicToPrivateScrap() ; - - void MacDoOneEvent() ; - WXEVENTREF MacGetCurrentEvent() { return m_macCurrentEvent ; } - void MacHandleOneEvent( WXEVENTREF ev ) ; - - // For embedded use. By default does nothing. - virtual void MacHandleUnhandledEvent( WXEVENTREF ev ); - -#if !TARGET_CARBON - virtual void MacHandleMenuSelect( int menuid , int menuitem ) ; - virtual void MacHandleMouseUpEvent( WXEVENTREF ev ) ; - virtual void MacHandleOSEvent( WXEVENTREF ev ) ; - virtual void MacHandleDiskEvent( WXEVENTREF ev ) ; - virtual void MacHandleActivateEvent( WXEVENTREF ev ) ; - virtual void MacHandleUpdateEvent( WXEVENTREF ev ) ; - virtual void MacHandleMouseDownEvent( WXEVENTREF ev ) ; - - void MacHandleModifierEvents( WXEVENTREF ev ) ; - - virtual void MacHandleKeyDownEvent( WXEVENTREF ev ) ; - virtual void MacHandleKeyUpEvent( WXEVENTREF ev ) ; - virtual void MacHandleHighLevelEvent( WXEVENTREF ev ) ; - -#else - virtual void MacHandleMouseMovedEvent( wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; -#endif - - void MacHandleMenuCommand( wxUint32 command ) ; - bool MacSendKeyDownEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ; - bool MacSendKeyUpEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ; - - virtual short MacHandleAEODoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEPDoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - virtual short MacHandleAERApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ; - - // in response of an open-document apple event - virtual void MacOpenFile(const wxString &fileName) ; - // in response of a print-document apple event - virtual void MacPrintFile(const wxString &fileName) ; - // in response of a open-application apple event - virtual void MacNewFile() ; - // in response of a reopen-application apple event - virtual void MacReopenApp() ; - - DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxStAppResource -{ -public: - wxStAppResource() ; - ~wxStAppResource() ; - - // opaque pointer for CFragInitBlock - static void OpenSharedLibraryResource(const void *) ; - static void CloseSharedLibraryResource() ; - -private: - short m_currentRefNum ; -} ; - -#endif - // _WX_APP_H_ - diff --git a/include/wx/mac/classic/apptbase.h b/include/wx/mac/classic/apptbase.h deleted file mode 100644 index 84c68cd0ee..0000000000 --- a/include/wx/mac/classic/apptbase.h +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/apptbase.h -// Purpose: declaration of wxAppTraits for Mac systems -// Author: Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 23.06.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_APPTBASE_H_ -#define _WX_MAC_APPTBASE_H_ - -// ---------------------------------------------------------------------------- -// wxAppTraits: the Mac version adds extra hooks needed by Mac code -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAppTraits : public wxAppTraitsBase -{ -public: - // wxExecute() support methods - // --------------------------- - - // TODO - - // wxThread helpers - // ---------------- - - - // TODO - - // other miscellaneous helpers - // --------------------------- - -}; - -#endif // _WX_MAC_APPTBASE_H_ - diff --git a/include/wx/mac/classic/apptrait.h b/include/wx/mac/classic/apptrait.h deleted file mode 100644 index 88b424ab1a..0000000000 --- a/include/wx/mac/classic/apptrait.h +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/apptrait.h -// Purpose: standard implementations of wxAppTraits for MacOS -// Author: Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 23.06.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_APPTRAIT_H_ -#define _WX_MAC_APPTRAIT_H_ - -// ---------------------------------------------------------------------------- -// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxConsoleAppTraits : public wxConsoleAppTraitsBase -{ -public: - // other miscellaneous helpers - // --------------------------- - - virtual wxToolkitInfo& GetToolkitInfo(); -}; - -#if wxUSE_GUI - -class WXDLLEXPORT wxGUIAppTraits : public wxGUIAppTraitsBase -{ -public: - // other miscellaneous helpers - // --------------------------- - - virtual wxToolkitInfo& GetToolkitInfo(); -}; - -#endif // wxUSE_GUI - -#endif // _WX_MAC_APPTRAIT_H_ - diff --git a/include/wx/mac/classic/bitmap.h b/include/wx/mac/classic/bitmap.h deleted file mode 100644 index a8e2439362..0000000000 --- a/include/wx/mac/classic/bitmap.h +++ /dev/null @@ -1,225 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.h -// Purpose: wxBitmap class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BITMAP_H_ -#define _WX_BITMAP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "bitmap.h" -#endif - -#include "wx/palette.h" - -// Bitmap -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxBitmapHandler; -class WXDLLEXPORT wxControl; -class WXDLLEXPORT wxCursor; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxImage; -class WXDLLEXPORT wxPixelDataBase; - -// A mask is a bitmap used for drawing bitmaps -// it can be a monochrome bitmap or a multi-bit bitmap which transfers to alpha channels -// transparently. -class WXDLLEXPORT wxMask: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxMask) - DECLARE_NO_COPY_CLASS(wxMask) - -public: - wxMask(); - - // Construct a mask from a bitmap and a colour indicating - // the transparent area - wxMask(const wxBitmap& bitmap, const wxColour& colour); - - // Construct a mask from a bitmap and a palette index indicating - // the transparent area - wxMask(const wxBitmap& bitmap, int paletteIndex); - - // Construct a mask from a mono bitmap (copies the bitmap). - wxMask(const wxBitmap& bitmap); - - ~wxMask(); - - bool Create(const wxBitmap& bitmap, const wxColour& colour); - bool Create(const wxBitmap& bitmap, int paletteIndex); - bool Create(const wxBitmap& bitmap); - - // Implementation - bool PointMasked(int x, int y); - inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; } - inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; } - int GetDepth() const { return m_depth ; } - void SetDepth( int depth ) { m_depth = depth ; } -protected: - WXHBITMAP m_maskBitmap; - int m_depth ; -}; - -enum { kMacBitmapTypeUnknownType , kMacBitmapTypeGrafWorld, kMacBitmapTypePict , kMacBitmapTypeIcon } ; - -class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData -{ - DECLARE_NO_COPY_CLASS(wxBitmapRefData) - - friend class WXDLLEXPORT wxBitmap; - friend class WXDLLEXPORT wxIcon; - friend class WXDLLEXPORT wxCursor; -public: - wxBitmapRefData(); - ~wxBitmapRefData(); - -public: - int m_width; - int m_height; - int m_depth; - bool m_ok; - int m_numColors; -#if wxUSE_PALETTE - wxPalette m_bitmapPalette; -#endif // wxUSE_PALETTE - int m_quality; - - int m_bitmapType ; - WXHMETAFILE m_hPict ; - WXHBITMAP m_hBitmap; - WXHICON m_hIcon ; - wxMask * m_bitmapMask; // Optional mask - bool m_hasAlpha; -}; - -#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) - -class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmapHandler) -public: - wxBitmapHandler() : m_name(), m_extension(), m_type(0) { } - virtual ~wxBitmapHandler(); - - virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1); - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); - virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); - - void SetName(const wxString& name) { m_name = name; } - void SetExtension(const wxString& ext) { m_extension = ext; } - void SetType(long type) { m_type = type; } - wxString GetName() const { return m_name; } - wxString GetExtension() const { return m_extension; } - long GetType() const { return m_type; } - -protected: - wxString m_name; - wxString m_extension; - long m_type; -}; - -#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) - -class WXDLLEXPORT wxBitmap: public wxBitmapBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmap) - - friend class WXDLLEXPORT wxBitmapHandler; - -public: - wxBitmap(); // Platform-specific - - // Copy constructors - wxBitmap(const wxBitmap& bitmap) - : wxBitmapBase() - { Ref(bitmap); } - - // Initialize with raw data. - wxBitmap(const char bits[], int width, int height, int depth = 1); - - // Initialize with XPM data - bool CreateFromXpm(const char **bits); - wxBitmap(const char **bits); - wxBitmap(char **bits); - - // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE); - - // Constructor for generalised creation from data - wxBitmap(void *data, wxBitmapType type, int width, int height, int depth = 1); - - // If depth is omitted, will create a bitmap compatible with the display - wxBitmap(int width, int height, int depth = -1); - - // Convert from wxImage: - wxBitmap(const wxImage& image, int depth = -1); - - ~wxBitmap(); - - wxImage ConvertToImage() const; - - // get the given part of bitmap - wxBitmap GetSubBitmap( const wxRect& rect ) const; - - virtual bool Create(int width, int height, int depth = -1); - virtual bool Create(void *data, wxBitmapType type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); - virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; - - // copies the contents and mask of the given (colour) icon to the bitmap - virtual bool CopyFromIcon(const wxIcon& icon); - - bool Ok() const; - int GetWidth() const; - int GetHeight() const; - int GetDepth() const; - int GetQuality() const; - void SetWidth(int w); - void SetHeight(int h); - void SetDepth(int d); - void SetQuality(int q); - void SetOk(bool isOk); - -#if wxUSE_PALETTE - wxPalette* GetPalette() const; - void SetPalette(const wxPalette& palette); -#endif // wxUSE_PALETTE - - wxMask *GetMask() const; - void SetMask(wxMask *mask) ; - - int GetBitmapType() const; - - inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } - inline bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; } - inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } - - static void InitStandardHandlers(); - - // raw bitmap access support functions, for internal use only - void *GetRawData(wxPixelDataBase& data, int bpp); - void UngetRawData(wxPixelDataBase& data); - - void UseAlpha(); - -public: - WXHBITMAP GetHBITMAP() const; - inline WXHICON GetHICON() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hIcon : 0); } - WXHMETAFILE GetPict(bool *created = NULL ) const; - - void SetHBITMAP(WXHBITMAP bmp); - void SetHICON(WXHICON ico); - void SetPict( WXHMETAFILE pict ) ; - - bool FreeResource(bool force = FALSE); -}; -#endif - // _WX_BITMAP_H_ diff --git a/include/wx/mac/classic/bmpbuttn.h b/include/wx/mac/classic/bmpbuttn.h deleted file mode 100644 index 28a91ed93f..0000000000 --- a/include/wx/mac/classic/bmpbuttn.h +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.h -// Purpose: wxBitmapButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BMPBUTTN_H_ -#define _WX_BMPBUTTN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "bmpbuttn.h" -#endif - -#include "wx/button.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; - -#define wxDEFAULT_BUTTON_MARGIN 4 - -class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase -{ - DECLARE_DYNAMIC_CLASS(wxBitmapButton) - -public: - wxBitmapButton() - { - SetMargins(wxDEFAULT_BUTTON_MARGIN, wxDEFAULT_BUTTON_MARGIN); - } - - wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Create(parent, id, bitmap, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual void SetBitmapLabel(const wxBitmap& bitmap); - -/* - // TODO: Implementation - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel ); - virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel ); - virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ); -*/ - -protected: - virtual wxSize DoGetBestSize() const; -}; - -#endif - // _WX_BMPBUTTN_H_ diff --git a/include/wx/mac/classic/brush.h b/include/wx/mac/classic/brush.h deleted file mode 100644 index 12e60e06d1..0000000000 --- a/include/wx/mac/classic/brush.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: brush.h -// Purpose: wxBrush class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BRUSH_H_ -#define _WX_BRUSH_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "brush.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/gdiobj.h" -#include "wx/bitmap.h" - -class WXDLLEXPORT wxBrush; - -typedef enum -{ - kwxMacBrushColour , - kwxMacBrushTheme , - kwxMacBrushThemeBackground -} wxMacBrushKind ; - -// Brush -class WXDLLEXPORT wxBrush: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxBrush) - -public: - wxBrush(); - wxBrush(short macThemeBrush ) ; - wxBrush(const wxColour& col, int style = wxSOLID); - wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) - : wxGDIObject() - { Ref(brush); } - ~wxBrush(); - - virtual void SetColour(const wxColour& col) ; - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; - virtual void SetStyle(int style) ; - virtual void SetStipple(const wxBitmap& stipple) ; - virtual void SetMacTheme(short macThemeBrush) ; - virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; - - wxBrush& operator = (const wxBrush& brush) - { if (*this == brush) return (*this); Ref(brush); return *this; } - bool operator == (const wxBrush& brush) - { return m_refData == brush.m_refData; } - bool operator != (const wxBrush& brush) - { return m_refData != brush.m_refData; } - - wxMacBrushKind MacGetBrushKind() const ; - - unsigned long GetMacThemeBackground(WXRECTPTR extent) const ; - short GetMacTheme() const ; - wxColour& GetColour() const ; - int GetStyle() const ; - wxBitmap *GetStipple() const ; - - virtual bool Ok() const { return (m_refData != NULL) ; } - -// Implementation - - // Useful helper: create the brush resource - bool RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_BRUSH_H_ diff --git a/include/wx/mac/classic/button.h b/include/wx/mac/classic/button.h deleted file mode 100644 index 23e9044f00..0000000000 --- a/include/wx/mac/classic/button.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: button.h -// Purpose: wxButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUTTON_H_ -#define _WX_BUTTON_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "button.h" -#endif - -#include "wx/control.h" -#include "wx/gdicmn.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; - -// Pushbutton -class WXDLLEXPORT wxButton: public wxButtonBase -{ - DECLARE_DYNAMIC_CLASS(wxButton) - public: - inline wxButton() {} - inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - static wxSize GetDefaultSize(); - - virtual void SetDefault(); - virtual void Command(wxCommandEvent& event); -protected: - virtual wxSize DoGetBestSize() const ; -}; - -#endif - // _WX_BUTTON_H_ diff --git a/include/wx/mac/classic/checkbox.h b/include/wx/mac/classic/checkbox.h deleted file mode 100644 index a426cb734b..0000000000 --- a/include/wx/mac/classic/checkbox.h +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.h -// Purpose: wxCheckBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKBOX_H_ -#define _WX_CHECKBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "checkbox.h" -#endif - -// Checkbox item (single checkbox) -class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase -{ -public: - wxCheckBox() { } - wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - virtual void SetValue(bool); - virtual bool GetValue() const; - - void DoSet3StateValue(wxCheckBoxState val); - virtual wxCheckBoxState DoGet3StateValue() const; - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ); - virtual void Command(wxCommandEvent& event); - - DECLARE_DYNAMIC_CLASS(wxCheckBox) -}; - -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox -{ -public: - int checkWidth; - int checkHeight; - - wxBitmapCheckBox() - : checkWidth(-1), checkHeight(-1) - { } - - wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - virtual void SetValue(bool); - virtual bool GetValue() const; - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - virtual void SetLabel(const wxBitmap *bitmap); - virtual void SetLabel( const wxString & WXUNUSED(name) ) {} - - DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox) -}; -#endif - // _WX_CHECKBOX_H_ diff --git a/include/wx/mac/classic/checklst.h b/include/wx/mac/classic/checklst.h deleted file mode 100644 index 35f3bd885d..0000000000 --- a/include/wx/mac/classic/checklst.h +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: checklst.h -// Purpose: wxCheckListBox class - a listbox with checkable items -// Note: this is an optional class. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKLST_H_ -#define _WX_CHECKLST_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "checklst.h" -#endif - -#if !defined(__MWERKS__) && !defined(__UNIX__) -typedef unsigned int size_t; -#endif - -class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxCheckListBox) -public: - // ctors - wxCheckListBox() { Init(); } - wxCheckListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int nStrings = 0, - const wxString *choices = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Init(); - - Create(parent, id, pos, size, nStrings, choices, style, validator, name); - } - wxCheckListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Init(); - - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int nStrings = 0, - const wxString *choices = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - - // items may be checked - bool IsChecked(size_t uiIndex) const; - void Check(size_t uiIndex, bool bCheck = TRUE); - void OnChar(wxKeyEvent& event) ; - void OnLeftClick(wxMouseEvent& event) ; - - // metrics - wxInt32 m_checkBoxWidth; - wxInt32 m_checkBoxHeight; - wxInt32 m_TextBaseLineOffset; - - // the array containing the checked status of the items - wxArrayInt m_checks; - - // override all methods which add/delete items to update m_checks array as - // well - virtual void Delete(int n); -protected: - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - virtual void DoClear(); - // common part of all ctors - void Init(); -private: - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_CHECKLST_H_ diff --git a/include/wx/mac/classic/chkconf.h b/include/wx/mac/classic/chkconf.h deleted file mode 100644 index e7c5d596c5..0000000000 --- a/include/wx/mac/classic/chkconf.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Name: wx/mac/chkconf.h - * Purpose: Compiler-specific configuration checking - * Author: Julian Smart - * Modified by: - * Created: 01/02/97 - * RCS-ID: $Id$ - * Copyright: (c) Julian Smart - * Licence: wxWindows licence - */ - -#ifndef _WX_MAC_CHKCONF_H_ -#define _WX_MAC_CHKCONF_H_ - -/* - * disable the settings which don't work for some compilers - */ - -/* - * wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior - */ - -#if defined(__MWERKS__) - #undef wxUSE_DEBUG_NEW_ALWAYS - #define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#endif - /* _WX_MAC_CHKCONF_H_ */ - diff --git a/include/wx/mac/classic/choice.h b/include/wx/mac/classic/choice.h deleted file mode 100644 index 4c10bab315..0000000000 --- a/include/wx/mac/classic/choice.h +++ /dev/null @@ -1,111 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: choice.h -// Purpose: wxChoice class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICE_H_ -#define _WX_CHOICE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "choice.h" -#endif - -#include "wx/control.h" - -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr; - -WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ; - -// Choice item -class WXDLLEXPORT wxChoice: public wxChoiceBase -{ - DECLARE_DYNAMIC_CLASS(wxChoice) - -public: - wxChoice() - : m_strings(), m_datas(), m_macPopUpMenuHandle(NULL) - {} - - virtual ~wxChoice() ; - - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetCount() const ; - virtual int GetSelection() const ; - virtual void SetSelection(int n); - - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual void SetString( int , const wxString& s ) ; - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - virtual wxSize DoGetBestSize() const ; - -public: // for wxComboBox only - virtual void DoSetItemClientData( int n, void* clientData ); - virtual void* DoGetItemClientData( int n ) const; - virtual void DoSetItemClientObject( int n, wxClientData* clientData ); - virtual wxClientData* DoGetItemClientObject( int n ) const; - -protected: - // free all memory we have (used by Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() - void FreeData(); - - wxArrayString m_strings; - wxChoiceDataArray m_datas ; - WXHMENU m_macPopUpMenuHandle ; -}; - -#endif - // _WX_CHOICE_H_ diff --git a/include/wx/mac/classic/clipbrd.h b/include/wx/mac/classic/clipbrd.h deleted file mode 100644 index 34bb3e3129..0000000000 --- a/include/wx/mac/classic/clipbrd.h +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: clipbrd.h -// Purpose: Clipboard functionality. -// Note: this functionality is under review, and -// is derived from wxWindows 1.xx code. Please contact -// the wxWindows developers for further information. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLIPBRD_H_ -#define _WX_CLIPBRD_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "clipbrd.h" -#endif - -#if wxUSE_CLIPBOARD - -#include "wx/list.h" -#include "wx/module.h" -#include "wx/dataobj.h" // for wxDataFormat - -//----------------------------------------------------------------------------- -// wxClipboard -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObject; -class WXDLLEXPORT wxClipboard : public wxClipboardBase -{ - DECLARE_DYNAMIC_CLASS(wxClipboard) - -public: - wxClipboard(); - ~wxClipboard(); - - // open the clipboard before SetData() and GetData() - virtual bool Open(); - - // close the clipboard after SetData() and GetData() - virtual void Close(); - - // query whether the clipboard is opened - virtual bool IsOpened() const; - - // set the clipboard data. all other formats will be deleted. - virtual bool SetData( wxDataObject *data ); - - // add to the clipboard data. - virtual bool AddData( wxDataObject *data ); - - // ask if data in correct format is available - virtual bool IsSupported( const wxDataFormat& format ); - - // fill data with data on the clipboard (if available) - virtual bool GetData( wxDataObject& data ); - - // clears wxTheClipboard and the system's clipboard if possible - virtual void Clear(); - - // flushes the clipboard: this means that the data which is currently on - // clipboard will stay available even after the application exits (possibly - // eating memory), otherwise the clipboard will be emptied on exit - virtual bool Flush(); - - // X11 has two clipboards which get selected by this call. Empty on MSW. - void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } - -private: - wxDataObject *m_data; - bool m_open; -}; - -#endif // wxUSE_CLIPBOARD - -#endif - // _WX_CLIPBRD_H_ diff --git a/include/wx/mac/classic/colordlg.h b/include/wx/mac/classic/colordlg.h deleted file mode 100644 index 443ba6fd68..0000000000 --- a/include/wx/mac/classic/colordlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colordlg.h -// Purpose: wxColourDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLORDLG_H_ -#define _WX_COLORDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "colordlg.h" -#endif - -#include "wx/setup.h" -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * Platform-specific colour dialog implementation - */ - -class WXDLLEXPORT wxColourDialog: public wxDialog -{ -DECLARE_DYNAMIC_CLASS(wxColourDialog) -public: - wxColourDialog(); - wxColourDialog(wxWindow *parent, wxColourData *data = NULL); - - bool Create(wxWindow *parent, wxColourData *data = NULL); - - int ShowModal(); - wxColourData& GetColourData() { return m_colourData; } - -protected: - wxColourData m_colourData; - wxWindow* m_dialogParent; -}; - -#endif - // _WX_COLORDLG_H_ diff --git a/include/wx/mac/classic/colour.h b/include/wx/mac/classic/colour.h deleted file mode 100644 index 158e631d64..0000000000 --- a/include/wx/mac/classic/colour.h +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colour.h -// Purpose: wxColour class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLOUR_H_ -#define _WX_COLOUR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "colour.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" - -// Colour -class WXDLLEXPORT wxColour: public wxObject -{ -public: - // ctors - // default - wxColour() { Init(); } - // from RGB - wxColour( unsigned char red, unsigned char green, unsigned char blue ) - { Set(red, green, blue); } - wxColour( unsigned long colRGB ) - { Set(colRGB); } - - // implicit conversion from the colour name - wxColour( const wxString &colourName ) - { InitFromName(colourName); } - wxColour( const wxChar *colourName ) - { InitFromName(colourName); } - - // copy ctors and assignment operators - wxColour( const wxColour& col ); - wxColour( const wxColour* col ); - wxColour& operator = ( const wxColour& col ); - - // dtor - ~wxColour(); - - // Set() functions - void Set( unsigned char red, unsigned char green, unsigned char blue ); - void Set( unsigned long colRGB ) - { - // we don't need to know sizeof(long) here because we assume that the three - // least significant bytes contain the R, G and B values - Set((unsigned char)colRGB, - (unsigned char)(colRGB >> 8), - (unsigned char)(colRGB >> 16)); - } - - // accessors - bool Ok() const {return m_isInit; } - - unsigned char Red() const { return m_red; } - unsigned char Green() const { return m_green; } - unsigned char Blue() const { return m_blue; } - - // comparison - bool operator == (const wxColour& colour) const - { - return (m_isInit == colour.m_isInit - && m_red == colour.m_red - && m_green == colour.m_green - && m_blue == colour.m_blue); - } - bool operator != (const wxColour& colour) const { return !(*this == colour); } - - const WXCOLORREF& GetPixel() const { return m_pixel; }; - - void InitFromName(const wxString& col); - -protected : - - // Helper function - void Init(); - -private: - bool m_isInit; - unsigned char m_red; - unsigned char m_blue; - unsigned char m_green; - -public: - WXCOLORREF m_pixel ; - void Set( const WXCOLORREF* color ) ; - -private: - DECLARE_DYNAMIC_CLASS(wxColour) -}; - -#endif - // _WX_COLOUR_H_ diff --git a/include/wx/mac/classic/combobox.h b/include/wx/mac/classic/combobox.h deleted file mode 100644 index 68b3b02820..0000000000 --- a/include/wx/mac/classic/combobox.h +++ /dev/null @@ -1,136 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h -// Purpose: wxComboBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOBOX_H_ -#define _WX_COMBOBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "combobox.h" -#endif - -#include "wx/textctrl.h" -#include "wx/choice.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr; - -// Combobox item -class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxComboBox) - - public: - inline wxComboBox() {} - virtual ~wxComboBox(); - // override the base class virtuals involved in geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - - // forward these functions to all subcontrols - virtual bool Enable(bool enable = TRUE); - virtual bool Show(bool show = TRUE); - virtual void SetFocus(); - - // callback functions - virtual void DelegateTextChanged( const wxString& value ); - virtual void DelegateChoice( const wxString& value ); - - inline wxComboBox(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - { - Create(parent, id, value, pos, size, n, choices, style, validator, name); - } - inline wxComboBox(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - { - Create(parent, id, value, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - - // List functions - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetSelection() const ; - virtual void SetSelection(int n); - virtual void Select(int n) { SetSelection(n) ; } - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual wxString GetStringSelection() const ; - virtual void SetString(int n, const wxString& s) ; - virtual bool SetStringSelection(const wxString& sel); - - // Text field functions - virtual wxString GetValue() const ; - virtual void SetValue(const wxString& value); - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const ; - virtual long GetLastPosition() const ; - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - virtual int GetCount() const { return m_choice->GetCount() ; } - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - -protected: - virtual int DoAppend(const wxString& item) ; - virtual int DoInsert(const wxString& item, int pos) ; - - virtual void DoSetItemClientData(int n, void* clientData) ; - virtual void* DoGetItemClientData(int n) const ; - virtual void DoSetItemClientObject(int n, wxClientData* clientData) ; - virtual wxClientData* DoGetItemClientObject(int n) const ; - - void FreeData(); - - // the subcontrols - wxTextCtrl* m_text; - wxChoice* m_choice; -}; - -#endif - // _WX_COMBOBOX_H_ diff --git a/include/wx/mac/classic/control.h b/include/wx/mac/classic/control.h deleted file mode 100644 index cc588f3861..0000000000 --- a/include/wx/mac/classic/control.h +++ /dev/null @@ -1,109 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: control.h -// Purpose: wxControl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONTROL_H_ -#define _WX_CONTROL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "control.h" -#endif - -WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr; - -// General item class -class WXDLLEXPORT wxControl : public wxControlBase -{ - DECLARE_ABSTRACT_CLASS(wxControl) - -public: - wxControl(); - wxControl(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxControlNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxControlNameStr); - virtual ~wxControl(); - - // Simulates an event - virtual void Command(wxCommandEvent& event) { ProcessCommand(event); } - - // implementation from now on - // -------------------------- - - // Calls the callback and appropriate event handlers - bool ProcessCommand(wxCommandEvent& event); - virtual void SetLabel(const wxString& title) ; - - wxList& GetSubcontrols() { return m_subControls; } - - void OnEraseBackground(wxEraseEvent& event); - - virtual bool Enable(bool enable = TRUE) ; - virtual bool Show(bool show = TRUE) ; - virtual void DoSetWindowVariant( wxWindowVariant variant ) ; - - virtual void MacRedrawControl () ; - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label , - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name , - WXRECTPTR outBounds , - unsigned char* maclabel ) ; - virtual void MacPostControlCreate() ; - virtual void MacAdjustControlRect() ; - virtual WXWidget MacGetContainerForEmbedding() ; - virtual void MacSuperChangedPosition() ; - virtual void MacSuperEnabled( bool enabled ) ; - virtual void MacSuperShown( bool show ) ; - virtual bool MacCanFocus() const ; - virtual void MacUpdateDimensions() ; - void* MacGetControlAction() { return m_macControlAction ; } - - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; - void OnKeyDown( wxKeyEvent &event ) ; - void OnMouseEvent( wxMouseEvent &event ) ; - void OnPaint(wxPaintEvent& event) ; - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ; - WXWidget GetMacControl() { return m_macControl ;} - -protected: - // For controls like radiobuttons which are really composite - WXWidget m_macControl ; - void* m_macControlAction ; - bool m_macControlIsShown ; - wxList m_subControls; - int m_macHorizontalBorder ; - int m_macVerticalBorder ; - - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_EVENT_TABLE() -}; - - -wxControl *wxFindControlFromMacControl(WXWidget inControl ) ; -void wxAssociateControlWithMacControl(WXWidget inControl, wxControl *control) ; -void wxRemoveMacControlAssociation(wxControl *control) ; - -#endif - // _WX_CONTROL_H_ diff --git a/include/wx/mac/classic/cursor.h b/include/wx/mac/classic/cursor.h deleted file mode 100644 index c8414a4ee0..0000000000 --- a/include/wx/mac/classic/cursor.h +++ /dev/null @@ -1,85 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cursor.h -// Purpose: wxCursor class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CURSOR_H_ -#define _WX_CURSOR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "cursor.h" -#endif - -#include "wx/bitmap.h" - -class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData -{ - DECLARE_NO_COPY_CLASS(wxCursorRefData) - - friend class WXDLLEXPORT wxBitmap; - friend class WXDLLEXPORT wxCursor; -public: - wxCursorRefData(); - ~wxCursorRefData(); - -protected: - WXHCURSOR m_hCursor; - bool m_disposeHandle; - bool m_releaseHandle; - bool m_isColorCursor ; - long m_themeCursor ; -}; - -#define M_CURSORDATA ((wxCursorRefData *)m_refData) -#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) - -// Cursor -class WXDLLEXPORT wxCursor: public wxBitmap -{ - DECLARE_DYNAMIC_CLASS(wxCursor) - -public: - wxCursor(); - - // Copy constructors - wxCursor(const wxCursor& cursor) - : wxBitmap() - { Ref(cursor); } - - wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, - const char maskBits[] = NULL); - - wxCursor(const wxImage & image) ; - wxCursor(const char **bits) ; - wxCursor(char **bits) ; - wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE, - int hotSpotX = 0, int hotSpotY = 0); - - wxCursor(int cursor_type); - ~wxCursor(); - - bool CreateFromXpm(const char **bits) ; - virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } - - 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; } - inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } - - void MacInstall() const ; - - void SetHCURSOR(WXHCURSOR cursor); - inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } -private : - void CreateFromImage(const wxImage & image) ; -}; - -extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); - -#endif - // _WX_CURSOR_H_ diff --git a/include/wx/mac/classic/dataform.h b/include/wx/mac/classic/dataform.h deleted file mode 100644 index 6e8846c6da..0000000000 --- a/include/wx/mac/classic/dataform.h +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataform.h -// Purpose: declaration of the wxDataFormat class -// Author: Stefan Csomor (lifted from dnd.h) -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DATAFORM_H -#define _WX_MAC_DATAFORM_H - -class WXDLLEXPORT wxDataFormat -{ -public: - typedef unsigned long NativeFormat; - - wxDataFormat(); - wxDataFormat(wxDataFormatId vType); - wxDataFormat(const wxString& rId); - wxDataFormat(const wxChar* pId); - wxDataFormat(NativeFormat vFormat); - - wxDataFormat& operator=(NativeFormat vFormat) - { SetId(vFormat); return *this; } - - // comparison (must have both versions) - bool operator==(NativeFormat format) const - { return m_format == (NativeFormat)format; } - bool operator!=(NativeFormat format) const - { return m_format != (NativeFormat)format; } - bool operator==(wxDataFormatId format) const - { return m_type == (wxDataFormatId)format; } - bool operator!=(wxDataFormatId format) const - { return m_type != (wxDataFormatId)format; } - - // explicit and implicit conversions to NativeFormat which is one of - // standard data types (implicit conversion is useful for preserving the - // compatibility with old code) - NativeFormat GetFormatId() const { return m_format; } - operator NativeFormat() const { return m_format; } - - void SetId(NativeFormat format); - - // string ids are used for custom types - this SetId() must be used for - // application-specific formats - wxString GetId() const; - void SetId(const wxChar* pId); - - // implementation - wxDataFormatId GetType() const { return m_type; } - void SetType( wxDataFormatId type ); - -private: - wxDataFormatId m_type; - NativeFormat m_format; -}; - -#endif // _WX_MAC_DATAFORM_H diff --git a/include/wx/mac/classic/dataobj.h b/include/wx/mac/classic/dataobj.h deleted file mode 100644 index 15b58e3a37..0000000000 --- a/include/wx/mac/classic/dataobj.h +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.h -// Purpose: declaration of the wxDataObject -// Author: Stefan Csomor (adapted from Robert Roebling's gtk port) -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DATAOBJ_H_ -#define _WX_MAC_DATAOBJ_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// wxDataObject is the same as wxDataObjectBase under wxGTK -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObject : public wxDataObjectBase -{ -public: - wxDataObject(); -#ifdef __DARWIN__ - ~wxDataObject() { } -#endif - - virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const; -}; - -#endif // _WX_MAC_DATAOBJ_H_ - diff --git a/include/wx/mac/classic/dataobj2.h b/include/wx/mac/classic/dataobj2.h deleted file mode 100644 index 64b0ac084a..0000000000 --- a/include/wx/mac/classic/dataobj2.h +++ /dev/null @@ -1,86 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: os2/dataobj2.h -// Purpose: declaration of standard wxDataObjectSimple-derived classes -// Author: David Webster (adapted from Robert Roebling's gtk port -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GTK_DATAOBJ2_H_ -#define _WX_GTK_DATAOBJ2_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject is a specialization of wxDataObject for bitmaps -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapDataObject : public wxBitmapDataObjectBase -{ -public: - // ctors - wxBitmapDataObject(); - wxBitmapDataObject(const wxBitmap& bitmap); - - // destr - ~wxBitmapDataObject(); - - // override base class virtual to update PNG data too - virtual void SetBitmap(const wxBitmap& bitmap); - - // implement base class pure virtuals - // ---------------------------------- - - virtual size_t GetDataSize() const ; - virtual bool GetDataHere(void *buf) const ; - virtual bool SetData(size_t len, const void *buf); - -protected : - void Init() ; - void Clear() ; - - void* m_pictHandle ; - bool m_pictCreated ; -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -}; - -// ---------------------------------------------------------------------------- -// wxFileDataObject is a specialization of wxDataObject for file names -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDataObject : public wxFileDataObjectBase -{ -public: - // implement base class pure virtuals - // ---------------------------------- - - void AddFile( const wxString &filename ); - - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t len, const void *buf); - -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -}; - -#endif // _WX_GTK_DATAOBJ2_H_ - diff --git a/include/wx/mac/classic/dc.h b/include/wx/mac/classic/dc.h deleted file mode 100644 index 5fc2601e55..0000000000 --- a/include/wx/mac/classic/dc.h +++ /dev/null @@ -1,293 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.h -// Purpose: wxDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DC_H_ -#define _WX_DC_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dc.h" -#endif - -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/icon.h" -#include "wx/font.h" -#include "wx/gdicmn.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#ifndef MM_TEXT -#define MM_TEXT 0 -#define MM_ISOTROPIC 1 -#define MM_ANISOTROPIC 2 -#define MM_LOMETRIC 3 -#define MM_HIMETRIC 4 -#define MM_TWIPS 5 -#define MM_POINTS 6 -#define MM_METRIC 7 -#endif - -//----------------------------------------------------------------------------- -// global variables -//----------------------------------------------------------------------------- - -extern int wxPageNumber; - -class wxMacPortStateHelper ; -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDC: public wxDCBase -{ - DECLARE_DYNAMIC_CLASS(wxDC) - DECLARE_NO_COPY_CLASS(wxDC) - - public: - - wxDC(); - ~wxDC(); - - - // implement base class pure virtuals - // ---------------------------------- - - virtual void Clear(); - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } - virtual void EndDoc(void) {}; - - virtual void StartPage(void) {}; - virtual void EndPage(void) {}; - - virtual void SetFont(const wxFont& font); - virtual void SetPen(const wxPen& pen); - virtual void SetBrush(const wxBrush& brush); - virtual void SetBackground(const wxBrush& brush); - virtual void SetBackgroundMode(int mode); - virtual void SetPalette(const wxPalette& palette); - - virtual void DestroyClippingRegion(); - - virtual wxCoord GetCharHeight() const; - virtual wxCoord GetCharWidth() const; - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; - virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; - - virtual bool CanDrawBitmap() const; - virtual bool CanGetTextExtent() const; - virtual int GetDepth() const; - virtual wxSize GetPPI() const; - - virtual void SetMapMode(int mode); - virtual void SetUserScale(double x, double y); - - virtual void SetLogicalScale(double x, double y); - virtual void SetLogicalOrigin(wxCoord x, wxCoord y); - virtual void SetDeviceOrigin(wxCoord x, wxCoord y); - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - virtual void SetLogicalFunction(int function); - - virtual void SetTextForeground(const wxColour& colour) ; - virtual void SetTextBackground(const wxColour& colour) ; - - void ComputeScaleAndOrigin(void); - public: - - - wxCoord XDEV2LOG(wxCoord x) const - { - long new_x = x - m_deviceOriginX ; - if (new_x > 0) - return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX; - else - return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX; - } - wxCoord XDEV2LOGREL(wxCoord x) const - { - if (x > 0) - return (wxCoord)((double)(x) / m_scaleX + 0.5); - else - return (wxCoord)((double)(x) / m_scaleX - 0.5); - } - wxCoord YDEV2LOG(wxCoord y) const - { - long new_y = y - m_deviceOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY; - else - return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY; - } - wxCoord YDEV2LOGREL(wxCoord y) const - { - if (y > 0) - return (wxCoord)((double)(y) / m_scaleY + 0.5); - else - return (wxCoord)((double)(y) / m_scaleY - 0.5); - } - wxCoord XLOG2DEV(wxCoord x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX ; - else - return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX ; - } - wxCoord XLOG2DEVREL(wxCoord x) const - { - if (x > 0) - return (wxCoord)((double)(x) * m_scaleX + 0.5); - else - return (wxCoord)((double)(x) * m_scaleX - 0.5); - } - wxCoord YLOG2DEV(wxCoord y) const - { - long new_y = y - m_logicalOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY ; - else - return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY ; - } - wxCoord YLOG2DEVREL(wxCoord y) const - { - if (y > 0) - return (wxCoord)((double)(y) * m_scaleY + 0.5); - else - return (wxCoord)((double)(y) * m_scaleY - 0.5); - } - wxCoord XLOG2DEVMAC(wxCoord x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ; - else - return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ; - } - wxCoord YLOG2DEVMAC(wxCoord y) const - { - long new_y = y - m_logicalOriginY ; - if (new_y > 0) - return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ; - else - return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ; - } - - WXHRGN MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; } - static void MacSetupBackgroundForCurrentPort(const wxBrush& background ) ; -// - -protected: - virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); - - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; - - virtual void DoDrawPoint(wxCoord x, wxCoord y); - virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - - virtual void DoDrawArc(wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc); - - virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea); - - virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double radius); - virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - - virtual void DoCrossHair(wxCoord x, wxCoord y); - - virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); - virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); - - virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); - virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, - double angle); - - virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); - virtual void DoSetClippingRegion(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y, - wxCoord *width, wxCoord *height) - { - GetClippingBox(x, y, width, height); - } - - virtual void DoGetSizeMM(int* width, int* height) const; - - virtual void DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset); - virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); - - protected: - //begin wxmac - // Variables used for scaling - double m_mm_to_pix_x,m_mm_to_pix_y; - // not yet used - bool m_needComputeScaleX,m_needComputeScaleY; - // If un-scrolled is non-zero or d.o. changes with scrolling. - // Set using SetInternalDeviceOrigin(). - long m_internalDeviceOriginX,m_internalDeviceOriginY; - // To be set by external classes such as wxScrolledWindow - // using SetDeviceOrigin() - long m_externalDeviceOriginX,m_externalDeviceOriginY; - - // Begin implementation for Mac - public: - - WXHDC m_macPort ; - WXHBITMAP m_macMask ; - - // in order to preserve the const inheritance of the virtual functions, we have to - // use mutable variables starting from CWPro 5 - - void MacInstallFont() const ; - void MacInstallPen() const ; - void MacInstallBrush() const ; - - mutable bool m_macFontInstalled ; - mutable bool m_macPenInstalled ; - mutable bool m_macBrushInstalled ; - - WXHRGN m_macBoundaryClipRgn ; - WXHRGN m_macCurrentClipRgn ; - wxPoint m_macLocalOrigin ; - void MacSetupPort( wxMacPortStateHelper* ph ) const ; - void MacCleanupPort( wxMacPortStateHelper* ph ) const ; - mutable void* m_macATSUIStyle ; - mutable wxMacPortStateHelper* m_macCurrentPortStateHelper ; - mutable bool m_macFormerAliasState ; - mutable short m_macFormerAliasSize ; - mutable bool m_macAliasWasEnabled ; - mutable void* m_macForegroundPixMap ; - mutable void* m_macBackgroundPixMap ; -}; - -#endif - // _WX_DC_H_ diff --git a/include/wx/mac/classic/dcclient.h b/include/wx/mac/classic/dcclient.h deleted file mode 100644 index 8e01314084..0000000000 --- a/include/wx/mac/classic/dcclient.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.h -// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCCLIENT_H_ -#define _WX_DCCLIENT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcclient.h" -#endif - -#include "wx/dc.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxPaintDC; -class WXDLLEXPORT wxWindow; - -class WXDLLEXPORT wxWindowDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxWindowDC) - - public: - wxWindowDC(void); - - // Create a DC corresponding to a canvas - wxWindowDC(wxWindow *win); - - ~wxWindowDC(void); - virtual void DoGetSize( int *width, int *height ) const; - protected : - wxWindow *m_window; -}; - - -class WXDLLEXPORT wxClientDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxClientDC) - - public: - wxClientDC(void); - - // Create a DC corresponding to a canvas - wxClientDC(wxWindow *win); - - ~wxClientDC(void); - virtual void DoGetSize( int *width, int *height ) const; -}; - -class WXDLLEXPORT wxPaintDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxPaintDC) - - public: - wxPaintDC(void); - - // Create a DC corresponding to a canvas - wxPaintDC(wxWindow *win); - - ~wxPaintDC(void); - virtual void DoGetSize( int *width, int *height ) const; -}; - -#endif - // _WX_DCCLIENT_H_ diff --git a/include/wx/mac/classic/dcmemory.h b/include/wx/mac/classic/dcmemory.h deleted file mode 100644 index c8ea44e5ad..0000000000 --- a/include/wx/mac/classic/dcmemory.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.h -// Purpose: wxMemoryDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCMEMORY_H_ -#define _WX_DCMEMORY_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcmemory.h" -#endif - -#include "wx/dcclient.h" - -class WXDLLEXPORT wxMemoryDC: public wxPaintDC -{ - DECLARE_DYNAMIC_CLASS(wxMemoryDC) - - public: - wxMemoryDC(void); - wxMemoryDC( wxDC *dc ); // Create compatible DC - ~wxMemoryDC(void); - virtual void SelectObject( const wxBitmap& bitmap ); - virtual void DoGetSize( int *width, int *height ) const; - wxBitmap GetSelectedObject() { return m_selected ; } - private: - wxBitmap m_selected; -}; - -#endif - // _WX_DCMEMORY_H_ diff --git a/include/wx/mac/classic/dcprint.h b/include/wx/mac/classic/dcprint.h deleted file mode 100644 index 0e2b5bcf0d..0000000000 --- a/include/wx/mac/classic/dcprint.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcprint.h -// Purpose: wxPrinterDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCPRINT_H_ -#define _WX_DCPRINT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcprint.h" -#endif - -#include "wx/dc.h" -#include "wx/cmndata.h" - -class wxNativePrinterDC ; - -class WXDLLEXPORT wxPrinterDC: public wxDC -{ - public: - DECLARE_CLASS(wxPrinterDC) - -#if wxUSE_PRINTING_ARCHITECTURE - // Create a printer DC - wxPrinterDC(const wxPrintData& printdata ); - ~wxPrinterDC(); - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) ; - virtual void EndDoc(void) ; - virtual void StartPage(void) ; - virtual void EndPage(void) ; - wxPrintData& GetPrintData() { return m_printData; } - virtual void DoGetSize( int *width, int *height ) const; - - protected: - wxPrintData m_printData ; - wxNativePrinterDC* m_nativePrinterDC ; -#endif // wxUSE_PRINTING_ARCHITECTURE -}; - -#endif - // _WX_DCPRINT_H_ - diff --git a/include/wx/mac/classic/dcscreen.h b/include/wx/mac/classic/dcscreen.h deleted file mode 100644 index ab83b37618..0000000000 --- a/include/wx/mac/classic/dcscreen.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcscreen.h -// Purpose: wxScreenDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCSCREEN_H_ -#define _WX_DCSCREEN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dcscreen.h" -#endif - -#include "wx/dcclient.h" - -class WXDLLEXPORT wxScreenDC: public wxWindowDC -{ - DECLARE_DYNAMIC_CLASS(wxScreenDC) - - public: - // Create a DC representing the whole screen - wxScreenDC(); - ~wxScreenDC(); - - // Compatibility with X's requirements for - // drawing on top of all windows - static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; } - static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; } - static bool EndDrawingOnTop() { return TRUE; } -}; - -#endif - // _WX_DCSCREEN_H_ - diff --git a/include/wx/mac/classic/dialog.h b/include/wx/mac/classic/dialog.h deleted file mode 100644 index e6834011c5..0000000000 --- a/include/wx/mac/classic/dialog.h +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.h -// Purpose: wxDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_ -#define _WX_DIALOG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dialog.h" -#endif - -#include "wx/panel.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr; - -WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr; - -class WXDLLEXPORT wxMacToolTip ; - -// Dialog boxes -class WXDLLEXPORT wxDialog : public wxDialogBase -{ - DECLARE_DYNAMIC_CLASS(wxDialog) - -public: - wxDialog(); - - // Constructor with a modal flag, but no window id - the old convention - wxDialog(wxWindow *parent, - const wxString& title, bool modal, - int x = -1, int y= -1, int width = 500, int height = 500, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; - Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), - style | modalStyle, name); - } - - // Constructor with no modal flag - the new convention. - wxDialog(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - ~wxDialog(); - -// virtual bool Destroy(); - bool Show(bool show = true); - - void SetModal(bool flag); - virtual bool IsModal() const; - - // For now, same as Show(TRUE) but returns return code - virtual int ShowModal(); - - // may be called to terminate the dialog with the given return code - virtual void EndModal(int retCode); - - // returns TRUE if we're in a modal loop - bool IsModalShowing() const; - - // implementation - // -------------- - - // event handlers - void OnCharHook(wxKeyEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - // Standard buttons - void OnOK(wxCommandEvent& event); - void OnApply(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // show modal dialog and enter modal loop - void DoShowModal(); - -private: - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_DIALOG_H_ diff --git a/include/wx/mac/classic/dirdlg.h b/include/wx/mac/classic/dirdlg.h deleted file mode 100644 index 734292ade3..0000000000 --- a/include/wx/mac/classic/dirdlg.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.h -// Purpose: wxDirDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRDLG_H_ -#define _WX_DIRDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dirdlg.h" -#endif - -class WXDLLEXPORT wxDirDialog : public wxDialog -{ -public: - wxDirDialog(wxWindow *parent, - const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = _T(""), - long style = 0, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - const wxString& name = wxDirDialogNameStr); - - void SetMessage(const wxString& message) { m_message = message; } - void SetPath(const wxString& path) { m_path = path; } - void SetStyle(long style) { m_dialogStyle = style; } - - wxString GetMessage() const { return m_message; } - wxString GetPath() const { return m_path; } - long GetStyle() const { return m_dialogStyle; } - - virtual int ShowModal(); - -protected: - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; - wxString m_path; - - DECLARE_DYNAMIC_CLASS(wxDirDialog) -}; - -#endif - // _WX_DIRDLG_H_ diff --git a/include/wx/mac/classic/display.h b/include/wx/mac/classic/display.h deleted file mode 100644 index 060c9c7ef4..0000000000 --- a/include/wx/mac/classic/display.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: display.h -// Purpose: wxDisplay class customization for Mac -// Author: Brian Victor -// Modified by: Royce Mitchell III -// Created: 06/21/02 -// RCS-ID: $Id$ -// Copyright: (c) wxWindows team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_DISPLAY_H_ -#define _WX_MAC_DISPLAY_H_ - -#include "wx/object.h" -#include "wx/display.h" - -class wxDisplayMacPriv; -class wxRect; -class wxString; - -class WXDLLEXPORT wxDisplay : public wxDisplayBase -{ -public: - wxDisplay ( size_t index = 0 ); - - ~wxDisplay(); - - virtual wxRect GetGeometry() const; - virtual int GetDepth() const; - virtual wxString GetName() const; - - virtual wxArrayVideoModes - GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const; - - virtual wxVideoMode GetCurrentMode() const; - - virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode); - -private: - wxDisplayMacPriv* m_priv; - - DECLARE_NO_COPY_CLASS(wxDisplay) -}; - -#endif // _WX_MAC_DISPLAY_H_ diff --git a/include/wx/mac/classic/dnd.h b/include/wx/mac/classic/dnd.h deleted file mode 100644 index 989a977628..0000000000 --- a/include/wx/mac/classic/dnd.h +++ /dev/null @@ -1,114 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dnd.h -// Purpose: Declaration of the wxDropTarget, wxDropSource class etc. -// Author: Stefan Csomor -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DND_H_ -#define _WX_DND_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dnd.h" -#endif - -#if wxUSE_DRAG_AND_DROP - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" -#include "wx/string.h" -#include "wx/dataobj.h" -#include "wx/cursor.h" - -//------------------------------------------------------------------------- -// classes -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindow; - -class WXDLLEXPORT wxDropTarget; -class WXDLLEXPORT wxTextDropTarget; -class WXDLLEXPORT wxFileDropTarget; - -class WXDLLEXPORT wxDropSource; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// this macro may be used instead for wxDropSource ctor arguments: it will use -// the icon 'name' from an XPM file under GTK, but will expand to something -// else under MSW. If you don't use it, you will have to use #ifdef in the -// application code. -#define wxDROP_ICON(X) wxCursor( (const char**) X##_xpm ) - -//------------------------------------------------------------------------- -// wxDropTarget -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropTarget: public wxDropTargetBase -{ - public: - - wxDropTarget(wxDataObject *dataObject = (wxDataObject*) NULL ); - - virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); - virtual bool OnDrop(wxCoord x, wxCoord y); - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); - virtual bool GetData(); - - bool CurrentDragHasSupportedFormat() ; - void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; } - void* GetCurrentDrag() { return m_currentDrag ; } - protected : - void* m_currentDrag ; -}; - -//------------------------------------------------------------------------- -// wxDropSource -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropSource: public wxDropSourceBase -{ -public: - // ctors: if you use default ctor you must call SetData() later! - // - // NB: the "wxWindow *win" parameter is unused and is here only for wxGTK - // compatibility, as well as both icon parameters - wxDropSource( wxWindow *win = (wxWindow *)NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - - /* constructor for setting one data object */ - wxDropSource( wxDataObject& data, - wxWindow *win, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - - ~wxDropSource(); - - // do it (call this in response to a mouse button press, for example) - // params: if bAllowMove is false, data can be only copied - virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); - - wxWindow* GetWindow() { return m_window ; } - void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; } - void* GetCurrentDrag() { return m_currentDrag ; } - bool MacInstallDefaultCursor(wxDragResult effect) ; - protected : - - wxWindow *m_window; - void* m_currentDrag ; -}; - -#endif - // D&D - -#endif - //_WX_DND_H_ - diff --git a/include/wx/mac/classic/filedlg.h b/include/wx/mac/classic/filedlg.h deleted file mode 100644 index 4cc0387a08..0000000000 --- a/include/wx/mac/classic/filedlg.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: filedlg.h -// Purpose: wxFileDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDLG_H_ -#define _WX_FILEDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "filedlg.h" -#endif - -//------------------------------------------------------------------------- -// wxFileDialog -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDialog: public wxFileDialogBase -{ -DECLARE_DYNAMIC_CLASS(wxFileDialog) -protected: - wxArrayString m_fileNames; - wxArrayString m_paths; - -public: - wxFileDialog(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = 0, - const wxPoint& pos = wxDefaultPosition); - - virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; } - virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; } - - virtual int ShowModal(); - - // not supported for file dialog, RR - virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} -}; - -#endif // _WX_FILEDLG_H_ diff --git a/include/wx/mac/classic/font.h b/include/wx/mac/classic/font.h deleted file mode 100644 index 78aa2f4d5f..0000000000 --- a/include/wx/mac/classic/font.h +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: font.h -// Purpose: wxFont class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONT_H_ -#define _WX_FONT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "font.h" -#endif - -// ---------------------------------------------------------------------------- -// wxFont -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFont : public wxFontBase -{ -public: - // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) - : wxFontBase() - { - Init(); - Ref(font); - } - - wxFont(int size, - int family, - int style, - int weight, - bool underlined = FALSE, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - Init(); - - (void)Create(size, family, style, weight, underlined, face, encoding); - } - - wxFont(const wxNativeFontInfo& info) - { - Init(); - - (void)Create(info); - } - - wxFont(const wxString& fontDesc); - - bool Create(int size, - int family, - int style, - int weight, - bool underlined = FALSE, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - - bool Create(const wxNativeFontInfo& info); - - virtual ~wxFont(); - - // assignment - wxFont& operator=(const wxFont& font); - - // implement base class pure virtuals - virtual int GetPointSize() const; - virtual int GetFamily() const; - virtual int GetStyle() const; - virtual int GetWeight() const; - virtual bool GetUnderlined() const; - virtual wxString GetFaceName() const; - virtual wxFontEncoding GetEncoding() const; - virtual const wxNativeFontInfo *GetNativeFontInfo() const; - - virtual void SetPointSize(int pointSize); - virtual void SetFamily(int family); - virtual void SetStyle(int style); - virtual void SetWeight(int weight); - virtual void SetFaceName(const wxString& faceName); - virtual void SetUnderlined(bool underlined); - virtual void SetEncoding(wxFontEncoding encoding); - - // implementation only from now on - // ------------------------------- - - virtual bool RealizeResource(); - - // Unofficial API, don't use - virtual void SetNoAntiAliasing( bool noAA = TRUE ) ; - virtual bool GetNoAntiAliasing() ; - - // Mac-specific, risks to change, don't use in portable code - short GetMacFontNum() const; - short GetMacFontSize() const; - wxByte GetMacFontStyle() const; - wxUint32 GetMacATSUFontID() const; - -protected: - // common part of all ctors - void Init(); - - void Unshare(); - -private: - DECLARE_DYNAMIC_CLASS(wxFont) -}; - -#endif - // _WX_FONT_H_ diff --git a/include/wx/mac/classic/fontdlg.h b/include/wx/mac/classic/fontdlg.h deleted file mode 100644 index 3d654b56c8..0000000000 --- a/include/wx/mac/classic/fontdlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.h -// Purpose: wxFontDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTDLG_H_ -#define _WX_FONTDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "fontdlg.h" -#endif - -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * Font dialog - */ - -class WXDLLEXPORT wxFontDialog: public wxDialog -{ -DECLARE_DYNAMIC_CLASS(wxFontDialog) -public: - wxFontDialog(); - wxFontDialog(wxWindow *parent, const wxFontData& data); - - bool Create(wxWindow *parent, const wxFontData& data); - - int ShowModal(); - wxFontData& GetFontData() { return m_fontData; } - -protected: - wxWindow* m_dialogParent; - wxFontData m_fontData; -}; - -#endif - // _WX_FONTDLG_H_ - diff --git a/include/wx/mac/classic/frame.h b/include/wx/mac/classic/frame.h deleted file mode 100644 index f92f7196fc..0000000000 --- a/include/wx/mac/classic/frame.h +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.h -// Purpose: wxFrame class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAME_H_ -#define _WX_FRAME_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "frame.h" -#endif - -#include "wx/window.h" -#include "wx/toolbar.h" -#include "wx/accel.h" -#include "wx/icon.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; - -class WXDLLEXPORT wxMenuBar; -class WXDLLEXPORT wxStatusBar; -class WXDLLEXPORT wxMacToolTip ; - -class WXDLLEXPORT wxFrame: public wxFrameBase -{ -public: - // construction - wxFrame() { Init(); } - wxFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init(); - - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - virtual ~wxFrame(); - - // implementation only from now on - // ------------------------------- - - // override some more virtuals - virtual bool Enable(bool enable = TRUE) ; - - // get the origin of the client area (which may be different from (0, 0) - // if the frame has a toolbar) in client coordinates - virtual wxPoint GetClientAreaOrigin() const; - - // event handlers - void OnActivate(wxActivateEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Toolbar -#if wxUSE_TOOLBAR - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = -1, - const wxString& name = wxToolBarNameStr); - - virtual void PositionToolBar(); -#endif // wxUSE_TOOLBAR - - // Status bar -#if wxUSE_STATUSBAR - virtual wxStatusBar* OnCreateStatusBar(int number = 1, - long style = wxST_SIZEGRIP, - wxWindowID id = 0, - const wxString& name = wxStatusLineNameStr); - - virtual void PositionStatusBar(); -#endif // wxUSE_STATUSBAR - - // tooltip management -#if wxUSE_TOOLTIPS - wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; } - void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; } - wxMacToolTip* m_hwndToolTip ; -#endif // tooltips - - // called by wxWindow whenever it gets focus - void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } - wxWindow *GetLastFocus() const { return m_winLastFocused; } - -protected: - // common part of all ctors - void Init(); - - // override base class virtuals - virtual void DoGetClientSize(int *width, int *height) const; - virtual void DoSetClientSize(int width, int height); - - virtual void DetachMenuBar(); - virtual void AttachMenuBar(wxMenuBar *menubar); - -protected: - // the last focused child: we restore focus to it on activation - wxWindow *m_winLastFocused; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxFrame) -}; - -#endif - // _WX_FRAME_H_ diff --git a/include/wx/mac/classic/gauge.h b/include/wx/mac/classic/gauge.h deleted file mode 100644 index 4eb5db3a69..0000000000 --- a/include/wx/mac/classic/gauge.h +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.h -// Purpose: wxGauge class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GAUGE_H_ -#define _WX_GAUGE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "gauge.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr; - -// Group box -class WXDLLEXPORT wxGauge: public wxGaugeBase -{ - DECLARE_DYNAMIC_CLASS(wxGauge) - public: - inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; } - - inline wxGauge(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxGA_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxGaugeNameStr) - { - Create(parent, id, range, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxGA_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxGaugeNameStr); - - void SetShadowWidth(int w); - void SetBezelFace(int w); - void SetRange(int r); - void SetValue(int pos); - - int GetShadowWidth() const ; - int GetBezelFace() const ; - int GetRange() const ; - int GetValue() const ; - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; - - protected: - int m_rangeMax; - int m_gaugePos; -}; - -#endif - // _WX_GAUGE_H_ diff --git a/include/wx/mac/classic/gdiobj.h b/include/wx/mac/classic/gdiobj.h deleted file mode 100644 index 1ad618bf84..0000000000 --- a/include/wx/mac/classic/gdiobj.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.h -// Purpose: wxGDIObject class: base class for other GDI classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GDIOBJ_H_ -#define _WX_GDIOBJ_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "gdiobj.h" -#endif - -#include "wx/object.h" - -class WXDLLEXPORT wxGDIRefData: public wxObjectRefData { -public: - inline wxGDIRefData() - { - } -}; - -#define M_GDIDATA ((wxGDIRefData *)m_refData) - -class WXDLLEXPORT wxGDIObject: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxGDIObject) - public: - wxGDIObject() : m_visible(FALSE) { } - ~wxGDIObject() { } - - bool IsNull() const { return (m_refData == 0); } - - virtual bool GetVisible() { return m_visible; } - virtual void SetVisible(bool v) { m_visible = v; } - -protected: - bool m_visible; // Can a pointer to this object be safely taken? - // - only if created within FindOrCreate... -}; - -#endif - // _WX_GDIOBJ_H_ diff --git a/include/wx/mac/classic/glcanvas.h b/include/wx/mac/classic/glcanvas.h deleted file mode 100644 index 6f044609c3..0000000000 --- a/include/wx/mac/classic/glcanvas.h +++ /dev/null @@ -1,134 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: glcanvas.h -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -# pragma interface "glcanvas.h" -#endif - -#ifndef _WX_GLCANVAS_H_ -#define _WX_GLCANVAS_H_ - -#include "wx/setup.h" - -#if wxUSE_GLCANVAS - -#include "wx/palette.h" -#include "wx/scrolwin.h" -#include "wx/app.h" - -#ifdef __DARWIN__ -# include -# include -#else -# include -# include -#endif - -//--------------------------------------------------------------------------- -// Constants for attriblist -//--------------------------------------------------------------------------- - -enum -{ - WX_GL_RGBA=1, /* use true color palette */ - WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */ - WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */ - WX_GL_DOUBLEBUFFER, /* use doublebuffer */ - WX_GL_STEREO, /* use stereoscopic display */ - WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */ - WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */ - WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */ - WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */ - WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */ - WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */ - WX_GL_STENCIL_SIZE, /* bits for stencil buffer */ - WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */ - WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */ - WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */ - WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */ -}; - -class WXDLLEXPORT wxGLCanvas; /* forward reference */ - -class WXDLLEXPORT wxGLContext: public wxObject -{ -public: - wxGLContext(AGLPixelFormat fmt, wxGLCanvas *win, - const wxPalette& WXUNUSED(palette), - const wxGLContext *other /* for sharing display lists */ - ); - ~wxGLContext(); - - void SetCurrent(); - void Update(); // must be called after window drag/grows/zoom or clut change - void SetColour(const wxChar *colour); - void SwapBuffers(); - - - inline wxWindow* GetWindow() const { return m_window; } - inline AGLDrawable GetDrawable() const { return m_drawable; } - -public: - AGLContext m_glContext; - AGLDrawable m_drawable; - wxWindow* m_window; -}; - -class WXDLLEXPORT wxGLCanvas: public wxWindow -{ - DECLARE_CLASS(wxGLCanvas) - public: - wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxT("GLCanvas") , int *attribList = 0, const wxPalette& palette = wxNullPalette); - wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL, - wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("GLCanvas"), - int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette ); - - wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxT("GLCanvas"), int *attribList = 0, const wxPalette& palette = wxNullPalette ); - - ~wxGLCanvas(); - - bool Create(wxWindow *parent, const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette); - - void SetCurrent(); - void SetColour(const wxChar *colour); - void SwapBuffers(); - void UpdateContext(); - void SetViewport(); - virtual bool Show(bool show = TRUE) ; - - // Unlike some other platforms, this must get called if you override it. - // It sets the viewport correctly and update the context. - // You shouldn't call glViewport yourself either (use SetViewport if you must reset it.) - void OnSize(wxSizeEvent& event); - - virtual void MacSuperChangedPosition() ; - virtual void MacTopLevelWindowChangedPosition() ; - virtual void MacSuperShown( bool show ) ; - - void MacUpdateView() ; - - inline wxGLContext* GetContext() const { return m_glContext; } - -protected: - wxGLContext* m_glContext; - bool m_macCanvasIsShown ; -DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_GLCANVAS -#endif // _WX_GLCANVAS_H_ diff --git a/include/wx/mac/classic/gsockmac.h b/include/wx/mac/classic/gsockmac.h deleted file mode 100644 index 6bb4a2aa71..0000000000 --- a/include/wx/mac/classic/gsockmac.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockunx.h - * Purpose: GSocket Macintosh header - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#ifndef __GSOCK_UNX_H -#define __GSOCK_UNX_H - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/setup.h" -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/gsocket.h" -#else -#include "gsocket.h" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef GSocket* GSocketPtr ; - -/* Definition of GSocket */ -struct _GSocket -{ - wxMacNotifierTableRef m_mac_events ; - EndpointRef m_endpoint; - GAddress *m_local; - GAddress *m_peer; - GSocketError m_error; - - int m_non_blocking; - int m_server; - int m_stream; - int m_oriented; - unsigned long m_timeout; - - /* Callbacks */ - GSocketEventFlags m_detected; - GSocketCallback m_cbacks[GSOCK_MAX_EVENT]; - char *m_data[GSOCK_MAX_EVENT]; - int m_takesEvents ; -}; - -/* Definition of GAddress */ - -struct _GAddress -{ - UInt32 m_host ; - UInt16 m_port ; - GAddressType m_family; - GSocketError m_error; -}; - -/* Input / Output */ - -GSocketError _GSocket_Input_Timeout(GSocket *socket); -GSocketError _GSocket_Output_Timeout(GSocket *socket); -int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size); -int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size); -int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size); -int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size); - -/* Callbacks */ - -void _GSocket_Enable_Events(GSocket *socket); -void _GSocket_Disable_Events(GSocket *socket); -void _GSocket_Internal_Proc(unsigned long e , void* data ) ; - -/* GAddress */ - -GSocketError _GAddress_translate_from(GAddress *address, - InetAddress *addr ); -GSocketError _GAddress_translate_to(GAddress *address, - InetAddress *addr); - -GSocketError _GAddress_Init_INET(GAddress *address); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ - -#endif /* __GSOCK_UNX_H */ diff --git a/include/wx/mac/classic/helpxxxx.h b/include/wx/mac/classic/helpxxxx.h deleted file mode 100644 index a33c0737a5..0000000000 --- a/include/wx/mac/classic/helpxxxx.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpxxxx.h -// Purpose: Help system: native implementation for your system. Replace -// XXXX with suitable name. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPXXXX_H_ -#define _WX_HELPXXXX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "helpxxxx.h" -#endif - -#include "wx/wx.h" - -#include "wx/helpbase.h" - -class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase -{ - DECLARE_CLASS(wxXXXXHelpController) - - public: - wxXXXXHelpController(); - ~wxXXXXHelpController(); - - // Must call this to set the filename and server name - virtual bool Initialize(const wxString& file); - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = ""); - virtual bool DisplayContents(); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplayBlock(long blockNo); - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - - virtual bool Quit(); - virtual void OnQuit(); - - inline wxString GetHelpFile() const { return m_helpFile; } - -protected: - wxString m_helpFile; -}; - -#endif - // _WX_HELPXXXX_H_ diff --git a/include/wx/mac/classic/icon.h b/include/wx/mac/classic/icon.h deleted file mode 100644 index bdc0ff755f..0000000000 --- a/include/wx/mac/classic/icon.h +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.h -// Purpose: wxIcon class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICON_H_ -#define _WX_ICON_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "icon.h" -#endif - -#include "wx/bitmap.h" - -// Icon -class WXDLLEXPORT wxIcon: public wxBitmap -{ -public: - wxIcon(); - - // Copy constructors - wxIcon(const wxIcon& icon) - : wxBitmap() - { Ref(icon); } - - wxIcon(const char **data); - wxIcon(char **data); - wxIcon(const char bits[], int width , int height ); - wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE, - int desiredWidth = -1, int desiredHeight = -1); - wxIcon(const wxIconLocation& loc) - { - LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON); - } - ~wxIcon(); - - bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ , - int desiredWidth /* = -1 */ , int desiredHeight = -1); - bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE ) - { return LoadFile( name , flags , -1 , -1 ) ; } - - wxIcon& operator=(const wxIcon& icon) - { if (this != &icon) Ref(icon); return *this; } - bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } - bool operator!=(const wxIcon& icon) const { return !(*this == icon); } - - // create from bitmap (which should have a mask unless it's monochrome): - // there shouldn't be any implicit bitmap -> icon conversion (i.e. no - // ctors, assignment operators...), but it's ok to have such function - void CopyFromBitmap(const wxBitmap& bmp); - - DECLARE_DYNAMIC_CLASS(wxIcon) -}; - -/* -class WXDLLEXPORT wxICONFileHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxICONFileHandler) -public: - inline wxICONFileHandler() - { - m_name = "ICO icon file"; - m_extension = "ico"; - m_type = wxBITMAP_TYPE_ICO; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth = -1, int desiredHeight = -1); -}; -*/ - -class WXDLLEXPORT wxICONResourceHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxICONResourceHandler) -public: - inline wxICONResourceHandler() - { - m_name = wxT("ICON resource"); - m_extension = wxEmptyString; - m_type = wxBITMAP_TYPE_ICON_RESOURCE; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth = -1, int desiredHeight = -1); - -}; - -#endif - // _WX_ICON_H_ diff --git a/include/wx/mac/classic/imaglist.h b/include/wx/mac/classic/imaglist.h deleted file mode 100644 index e8fbf6e713..0000000000 --- a/include/wx/mac/classic/imaglist.h +++ /dev/null @@ -1,147 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaglist.h -// Purpose: wxImageList class. Note: if your GUI doesn't have -// an image list equivalent, you can use the generic class -// in src/generic. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_ -#define _WX_IMAGLIST_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "imaglist.h" -#endif - -#include "wx/bitmap.h" - -/* - * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to - * images for their items by an index into an image list. - * A wxImageList is capable of creating images with optional masks from - * a variety of sources - a single bitmap plus a colour to indicate the mask, - * two bitmaps, or an icon. - * - */ - -// Flags for Draw -#define wxIMAGELIST_DRAW_NORMAL 0x0001 -#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002 -#define wxIMAGELIST_DRAW_SELECTED 0x0004 -#define wxIMAGELIST_DRAW_FOCUSED 0x0008 - -// Flag values for Set/GetImageList -enum { - wxIMAGE_LIST_NORMAL, // Normal icons - wxIMAGE_LIST_SMALL, // Small icons - wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation) -}; - -// Eventually we'll make this a reference-counted wxGDIObject. For -// now, the app must take care of ownership issues. That is, the -// image lists must be explicitly deleted after the control(s) that uses them -// is (are) deleted, or when the app exits. -class WXDLLEXPORT wxImageList: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxImageList) - public: - /* - * Public interface - */ - - wxImageList(); - - // Creates an image list. - // Specify the width and height of the images in the list, - // whether there are masks associated with them (e.g. if creating images - // from icons), and the initial size of the list. - inline wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1) - { - Create(width, height, mask, initialCount); - } - ~wxImageList(); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Returns the number of images in the image list. - int GetImageCount() const; - - bool GetSize(int index, int&width, int &height) const; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Creates an image list - // width, height specify the size of the images in the list (all the same). - // mask specifies whether the images have masks or not. - // initialNumber is the initial number of images to reserve. - bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1); - - // Adds a bitmap, and optionally a mask bitmap. - // Note that wxImageList creates *new* bitmaps, so you may delete - // 'bitmap' and 'mask' after calling Add. - int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); - - // Adds a bitmap, using the specified colour to create the mask bitmap - // Note that wxImageList creates *new* bitmaps, so you may delete - // 'bitmap' after calling Add. - int Add(const wxBitmap& bitmap, const wxColour& maskColour); - - // Adds a bitmap and mask from an icon. - int Add(const wxIcon& icon); - - // Replaces a bitmap, optionally passing a mask bitmap. - // Note that wxImageList creates new bitmaps, so you may delete - // 'bitmap' and 'mask' after calling Replace. - bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); - -/* Not supported by Win95 - // Replacing a bitmap, using the specified colour to create the mask bitmap - // Note that wxImageList creates new bitmaps, so you may delete - // 'bitmap'. - bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour); -*/ - - // Replaces a bitmap and mask from an icon. - // You can delete 'icon' after calling Replace. - bool Replace(int index, const wxIcon& icon); - - // Removes the image at the given index. - bool Remove(int index); - - // Remove all images - bool RemoveAll(); - - // Draws the given image on a dc at the specified position. - // If 'solidBackground' is TRUE, Draw sets the image list background - // colour to the background colour of the wxDC, to speed up - // drawing by eliminating masked drawing where possible. - bool Draw(int index, wxDC& dc, int x, int y, - int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = FALSE); - -/* TODO (optional?) - wxIcon *MakeIcon(int index); -*/ - -/* TODO - // Implementation - //////////////////////////////////////////////////////////////////////////// - - // Returns the native image list handle - inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; } - -protected: - WXHIMAGELIST m_hImageList; -*/ - -}; - -#endif - // _WX_IMAGLIST_H_ diff --git a/include/wx/mac/classic/joystick.h b/include/wx/mac/classic/joystick.h deleted file mode 100644 index 6db596e3b3..0000000000 --- a/include/wx/mac/classic/joystick.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.h -// Purpose: wxJoystick class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_JOYSTICK_H_ -#define _WX_JOYSTICK_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "joystick.h" -#endif - -#include "wx/event.h" - -class WXDLLEXPORT wxJoystick: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxJoystick) - public: - /* - * Public interface - */ - - wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; }; - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - wxPoint GetPosition() const; - int GetZPosition() const; - int GetButtonState() const; - int GetPOVPosition() const; - int GetPOVCTSPosition() const; - int GetRudderPosition() const; - int GetUPosition() const; - int GetVPosition() const; - int GetMovementThreshold() const; - void SetMovementThreshold(int threshold) ; - - // Capabilities - //////////////////////////////////////////////////////////////////////////// - - bool IsOk() const; // Checks that the joystick is functioning - int GetNumberJoysticks() const ; - int GetManufacturerId() const ; - int GetProductId() const ; - wxString GetProductName() const ; - int GetXMin() const; - int GetYMin() const; - int GetZMin() const; - int GetXMax() const; - int GetYMax() const; - int GetZMax() const; - int GetNumberButtons() const; - int GetNumberAxes() const; - int GetMaxButtons() const; - int GetMaxAxes() const; - int GetPollingMin() const; - int GetPollingMax() const; - int GetRudderMin() const; - int GetRudderMax() const; - int GetUMin() const; - int GetUMax() const; - int GetVMin() const; - int GetVMax() const; - - bool HasRudder() const; - bool HasZ() const; - bool HasU() const; - bool HasV() const; - bool HasPOV() const; - bool HasPOV4Dir() const; - bool HasPOVCTS() const; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // pollingFreq = 0 means that movement events are sent when above the threshold. - // If pollingFreq > 0, events are received every this many milliseconds. - bool SetCapture(wxWindow* win, int pollingFreq = 0); - bool ReleaseCapture(); - -protected: - int m_joystick; -}; - -#endif - // _WX_JOYSTICK_H_ diff --git a/include/wx/mac/classic/listbox.h b/include/wx/mac/classic/listbox.h deleted file mode 100644 index 77c0f27209..0000000000 --- a/include/wx/mac/classic/listbox.h +++ /dev/null @@ -1,181 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h -// Purpose: wxListBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_LISTBOX_H_ -#define _WX_LISTBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "listbox.h" -#endif - -// ---------------------------------------------------------------------------- -// simple types -// ---------------------------------------------------------------------------- -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -#if wxUSE_OWNER_DRAWN - class WXDLLEXPORT wxOwnerDrawn; - - // define the array of list box items - #include "wx/dynarray.h" - - WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray); -#endif // wxUSE_OWNER_DRAWN - -// forward decl for GetSelections() -class wxArrayInt; - -// List box item - -WX_DEFINE_ARRAY( char * , wxListDataArray ) ; - -// ---------------------------------------------------------------------------- -// List box control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListBox : public wxListBoxBase -{ -public: - // ctors and such - wxListBox(); - wxListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); - - virtual ~wxListBox(); - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); - - // implement base class pure virtuals - virtual void Clear(); - virtual void Delete(int n); - - virtual int GetCount() const; - virtual wxString GetString(int n) const; - virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; - - virtual bool IsSelected(int n) const; - virtual void SetSelection(int n, bool select = TRUE); - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(int n, void* clientData); - virtual void* DoGetItemClientData(int n) const; - virtual void DoSetItemClientObject(int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(int n) const; - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; - - // wxCheckListBox support -#if wxUSE_OWNER_DRAWN - // plug-in for derived classes - virtual wxOwnerDrawn *CreateItem(size_t n); - - // allows to get the item and use SetXXX functions to set it's appearance - wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; } - - // get the index of the given item - int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); } -#endif // wxUSE_OWNER_DRAWN - - // Windows callbacks - - virtual void SetupColours(); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual bool MacCanFocus() const { return true ; } - void OnChar(wxKeyEvent& event); - - void* m_macList ; - wxArrayString m_stringArray ; - wxListDataArray m_dataArray ; - wxArrayInt m_selectionPreImage ; - void MacSetRedraw( bool doDraw ) ; -protected: - void MacDestroy() ; - void MacDelete( int n ) ; - void MacInsert( int n , const wxString& item) ; - void MacAppend( const wxString& item) ; - void MacSet( int n , const wxString& item ) ; - void MacClear() ; - void MacSetSelection( int n , bool select ) ; - int MacGetSelection() const ; - int MacGetSelections(wxArrayInt& aSelections) const ; - bool MacIsSelected( int n ) const ; - void MacScrollTo( int n ) ; - void OnSize( wxSizeEvent &size ) ; - void MacDoClick() ; - void MacDoDoubleClick() ; - - // do we have multiple selections? - bool HasMultipleSelection() const; - - // free memory (common part of Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() - void FreeData(); - - int m_noItems; - int m_selected; - wxString m_typeIn ; - long m_lastTypeIn ; - - virtual wxSize DoGetBestSize() const; - -#if wxUSE_OWNER_DRAWN - // control items - wxListBoxItemsArray m_aItems; -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxListBox) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_LISTBOX_H_ diff --git a/include/wx/mac/classic/listctrl.h b/include/wx/mac/classic/listctrl.h deleted file mode 100644 index 196f97add1..0000000000 --- a/include/wx/mac/classic/listctrl.h +++ /dev/null @@ -1,451 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listctrl.h -// Purpose: wxListCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTCTRL_H_ -#define _WX_LISTCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "listctrl.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" - -/* - The wxListCtrl can show lists of items in four different modes: - wxLC_LIST: multicolumn list view, with optional small icons (icons could be - optional for some platforms). Columns are computed automatically, - i.e. you don't set columns as in wxLC_REPORT. In other words, - the list wraps, unlike a wxListBox. - wxLC_REPORT: single or multicolumn report view (with optional header) - wxLC_ICON: large icon view, with optional labels - wxLC_SMALL_ICON: small icon view, with optional labels - - You can change the style dynamically, either with SetSingleStyle or - SetWindowStyleFlag. - - Further window styles: - - wxLC_ALIGN_TOP icons align to the top (default) - wxLC_ALIGN_LEFT icons align to the left - wxLC_AUTOARRANGE icons arrange themselves - wxLC_USER_TEXT the app provides label text on demand, except for column headers - wxLC_EDIT_LABELS labels are editable: app will be notified. - wxLC_NO_HEADER no header in report mode - wxLC_NO_SORT_HEADER can't click on header - wxLC_SINGLE_SEL single selection - wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems) - wxLC_SORT_DESCENDING sort descending (ditto) - - Items are referred to by their index (position in the list starting from zero). - - Label text is supplied via insertion/setting functions and is stored by the - control, unless the wxLC_USER_TEXT style has been specified, in which case - the app will be notified when text is required (see sample). - - Images are dealt with by (optionally) associating 3 image lists with the control. - Zero-based indexes into these image lists indicate which image is to be used for - which item. Each image in an image list can contain a mask, and can be made out - of either a bitmap, two bitmaps or an icon. See ImagList.h for more details. - - Notifications are passed via the wxWindows 2.0 event system. - - See the sample wxListCtrl app for API usage. - - */ - -// Mask flags to tell app/GUI what fields of wxListItem are valid -#define wxLIST_MASK_STATE 0x0001 -#define wxLIST_MASK_TEXT 0x0002 -#define wxLIST_MASK_IMAGE 0x0004 -#define wxLIST_MASK_DATA 0x0008 -#define wxLIST_SET_ITEM 0x0010 -#define wxLIST_MASK_WIDTH 0x0020 -#define wxLIST_MASK_FORMAT 0x0040 - -// State flags for indicating the state of an item -#define wxLIST_STATE_DONTCARE 0x0000 -#define wxLIST_STATE_DROPHILITED 0x0001 -#define wxLIST_STATE_FOCUSED 0x0002 -#define wxLIST_STATE_SELECTED 0x0004 -#define wxLIST_STATE_CUT 0x0008 - -// Hit test flags, used in HitTest -#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area. -#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area. -#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item. -#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item. -#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item. -#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item. -#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state. -#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the client area. -#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the client area. - -#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL wxLIST_HITTEST_ONITEMSTATEICON) - -// Flags for GetNextItem -enum { - wxLIST_NEXT_ABOVE, // Searches for an item above the specified item - wxLIST_NEXT_ALL, // Searches for subsequent item by index - wxLIST_NEXT_BELOW, // Searches for an item below the specified item - wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item - wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item -}; - -// Alignment flags for Arrange -enum { - wxLIST_ALIGN_DEFAULT, - wxLIST_ALIGN_LEFT, - wxLIST_ALIGN_TOP, - wxLIST_ALIGN_SNAP_TO_GRID -}; - -// Column format -enum { - wxLIST_FORMAT_LEFT, - wxLIST_FORMAT_RIGHT, - wxLIST_FORMAT_CENTRE, - wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE -}; - -// Autosize values for SetColumnWidth -enum { - wxLIST_AUTOSIZE = -1, - wxLIST_AUTOSIZE_USEHEADER = -2 -}; - -// Flag values for GetItemRect -enum { - wxLIST_RECT_BOUNDS, - wxLIST_RECT_ICON, - wxLIST_RECT_LABEL -}; - -// Flag values for FindItem -enum { - wxLIST_FIND_UP, - wxLIST_FIND_DOWN, - wxLIST_FIND_LEFT, - wxLIST_FIND_RIGHT -}; - -// wxListItem: data representing an item, or report field. -// It also doubles up to represent entire column information -// when inserting or setting a column. -class WXDLLEXPORT wxListItem: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxListItem) -public: - long m_mask; // Indicates what fields are valid - long m_itemId; // The zero-based item position - int m_col; // Zero-based column, if in report mode - long m_state; // The state of the item - long m_stateMask; // Which flags of m_state are valid (uses same flags) - wxString m_text; // The label/header text - int m_image; // The zero-based index into an image list - long m_data; // App-defined data - - // For columns only - int m_format; // left, right, centre - int m_width; // width of column - - wxListItem(); -}; - -// type of compare function for wxListCtrl sort operation -typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData); - -class WXDLLEXPORT wxListCtrl: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxListCtrl) - public: - /* - * Public interface - */ - - wxListCtrl(); - - inline wxListCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listCtrl") - { - Create(parent, id, pos, size, style, validator, name); - } - ~wxListCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl"); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Gets information about this column - bool GetColumn(int col, wxListItem& item) const; - - // Sets information about this column - bool SetColumn(int col, wxListItem& item) ; - - // Gets the column width - int GetColumnWidth(int col) const; - - // Sets the column width - bool SetColumnWidth(int col, int width) ; - - // Gets the number of items that can fit vertically in the - // visible area of the list control (list or report view) - // or the total number of items in the list control (icon - // or small icon view) - int GetCountPerPage() const; - - // Gets the edit control for editing labels. - wxTextCtrl* GetEditControl() const; - - // Gets information about the item - bool GetItem(wxListItem& info) const ; - - // Sets information about the item - bool SetItem(wxListItem& info) ; - - // Sets a string field at a particular column - long SetItem(long index, int col, const wxString& label, int imageId = -1); - - // Gets the item state - int GetItemState(long item, long stateMask) const ; - - // Sets the item state - bool SetItemState(long item, long state, long stateMask) ; - - // Sets the item image - bool SetItemImage(long item, int image, int selImage) ; - - // Gets the item text - wxString GetItemText(long item) const ; - - // Sets the item text - void SetItemText(long item, const wxString& str) ; - - // Gets the item data - long GetItemData(long item) const ; - - // Sets the item data - bool SetItemData(long item, long data) ; - - // Gets the item rectangle - bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ; - - // Gets the item position - bool GetItemPosition(long item, wxPoint& pos) const ; - - // Sets the item position - bool SetItemPosition(long item, const wxPoint& pos) ; - - // Gets the number of items in the list control - int GetItemCount() const; - - // Gets the number of columns in the list control - int GetColumnCount() const; - - // Retrieves the spacing between icons in pixels. - // If small is TRUE, gets the spacing for the small icon - // view, otherwise the large icon view. - int GetItemSpacing(bool isSmall) const; - - // Gets the number of selected items in the list control - int GetSelectedItemCount() const; - - // Gets the text colour of the listview - wxColour GetTextColour() const; - - // Sets the text colour of the listview - void SetTextColour(const wxColour& col); - - // Gets the index of the topmost visible item when in - // list or report view - long GetTopItem() const ; - - // Add or remove a single window style - void SetSingleStyle(long style, bool add = TRUE) ; - - // Set the whole window style - void SetWindowStyleFlag(long style) ; - - // Searches for an item, starting from 'item'. - // item can be -1 to find the first item that matches the - // specified flags. - // Returns the item or -1 if unsuccessful. - long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ; - - // Implementation: converts wxWindows style to MSW style. - // Can be a single style flag or a bit list. - // oldStyle is 'normalised' so that it doesn't contain - // conflicting styles. - long ConvertToMSWStyle(long& oldStyle, long style) const; - - // Gets one of the three image lists - wxImageList *GetImageList(int which) const ; - - // Sets the image list - // N.B. There's a quirk in the Win95 list view implementation. - // If in wxLC_LIST mode, it'll *still* display images by the labels if - // there's a small-icon image list set for the control - even though you - // haven't specified wxLIST_MASK_IMAGE when inserting. - // So you have to set a NULL small-icon image list to be sure that - // the wxLC_LIST mode works without icons. Of course, you may want icons... - void SetImageList(wxImageList *imageList, int which) ; - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Arranges the items - bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); - - // Deletes an item - bool DeleteItem(long item); - - // Deletes all items - bool DeleteAllItems() ; - - // Deletes a column - bool DeleteColumn(int col); - - // Deletes all columns - bool DeleteAllColumns(); - - // Clears items, and columns if there are any. - void ClearAll(); - - // Edit the label - wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - - // End label editing, optionally cancelling the edit - bool EndEditLabel(bool cancel); - - // Ensures this item is visible - bool EnsureVisible(long item) ; - - // Find an item whose label matches this string, starting from the item after 'start' - // or the beginning if 'start' is -1. - long FindItem(long start, const wxString& str, bool partial = FALSE); - - // Find an item whose data matches this data, starting from the item after 'start' - // or the beginning if 'start' is -1. - long FindItem(long start, long data); - - // Find an item nearest this position in the specified direction, starting from - // the item after 'start' or the beginning if 'start' is -1. - long FindItem(long start, const wxPoint& pt, int direction); - - // Determines which item (if any) is at the specified point, - // giving details in 'flags' (see wxLIST_HITTEST_... flags above) - long HitTest(const wxPoint& point, int& flags); - - // Inserts an item, returning the index of the new item if successful, - // -1 otherwise. - // TOD: Should also have some further convenience functions - // which don't require setting a wxListItem object - long InsertItem(wxListItem& info); - - // Insert a string item - long InsertItem(long index, const wxString& label); - - // Insert an image item - long InsertItem(long index, int imageIndex); - - // Insert an image/string item - long InsertItem(long index, const wxString& label, int imageIndex); - - // For list view mode (only), inserts a column. - long InsertColumn(long col, wxListItem& info); - - long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT, - int width = -1); - - // Scrolls the list control. If in icon, small icon or report view mode, - // x specifies the number of pixels to scroll. If in list view mode, x - // specifies the number of columns to scroll. - // If in icon, small icon or list view mode, y specifies the number of pixels - // to scroll. If in report view mode, y specifies the number of lines to scroll. - bool ScrollList(int dx, int dy); - - // Sort items. - - // fn is a function which takes 3 long arguments: item1, item2, data. - // item1 is the long data associated with a first item (NOT the index). - // item2 is the long data associated with a second item (NOT the index). - // data is the same value as passed to SortItems. - // The return value is a negative number if the first item should precede the second - // item, a positive number of the second item should precede the first, - // or zero if the two items are equivalent. - - // data is arbitrary data to be passed to the sort function. - bool SortItems(wxListCtrlCompare fn, long data); - -/* Why should we need this function? Leave for now. - * We might need it because item data may have changed, - * but the display needs refreshing (in string callback mode) - // Updates an item. If the list control has the wxLI_AUTO_ARRANGE style, - // the items will be rearranged. - bool Update(long item); -*/ - - void Command(wxCommandEvent& event) { ProcessCommand(event); }; - -protected: - wxTextCtrl* m_textCtrl; // The control used for editing a label - wxImageList * m_imageListNormal; // The image list for normal icons - wxImageList * m_imageListSmall; // The image list for small icons - wxImageList * m_imageListState; // The image list state icons (not implemented yet) - - long m_baseStyle; // Basic Windows style flags, for recreation purposes - wxStringList m_stringPool; // Pool of 3 strings to satisfy Windows callback - // requirements - int m_colCount; // Windows doesn't have GetColumnCount so must - // keep track of inserted/deleted columns - -}; - -class WXDLLEXPORT wxListEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxListEvent) - - public: - wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - - int m_code; - long m_itemIndex; - long m_oldItemIndex; - int m_col; - bool m_cancelled; - wxPoint m_pointDrag; - - wxListItem m_item; -}; - -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - -#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, -#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL }, - -#endif - // _WX_LISTCTRL_H_ diff --git a/include/wx/mac/classic/macnotfy.h b/include/wx/mac/classic/macnotfy.h deleted file mode 100644 index ae8a24e6de..0000000000 --- a/include/wx/mac/classic/macnotfy.h +++ /dev/null @@ -1,33 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: Mac Notifier Support - * Name: macnotfy.h - * Author: Stefan CSomor - * Purpose: Mac Notifier include file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#ifndef MAC_NOTIFYERS -#define MAC_NOTIFYERS - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef void (*wxMacNotificationProcPtr)(unsigned long event , void* data ) ; - -typedef void *wxMacNotifierTableRef ; -void wxMacCreateNotifierTable() ; -void wxMacDestroyNotifierTable() ; -wxMacNotifierTableRef wxMacGetNotifierTable() ; -void wxMacAddEvent( wxMacNotifierTableRef table , wxMacNotificationProcPtr handler , unsigned long event , void* data , short wakeUp ) ; -void wxMacWakeUp() ; -void wxMacProcessNotifierEvents() ; -void wxMacProcessNotifierAndPendingEvents() ; -void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data ) ; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAC_NOTIFYERS */ \ No newline at end of file diff --git a/include/wx/mac/classic/macsock.h b/include/wx/mac/classic/macsock.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/wx/mac/classic/mdi.h b/include/wx/mac/classic/mdi.h deleted file mode 100644 index 1114ee525d..0000000000 --- a/include/wx/mac/classic/mdi.h +++ /dev/null @@ -1,180 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.h -// Purpose: MDI (Multiple Document Interface) classes. -// This doesn't have to be implemented just like Windows, -// it could be a tabbed design as in wxGTK. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MDI_H_ -#define _WX_MDI_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "mdi.h" -#endif - -#include "wx/frame.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr; - -class WXDLLEXPORT wxMDIClientWindow; -class WXDLLEXPORT wxMDIChildFrame; - -class WXDLLEXPORT wxMDIParentFrame: public wxFrame -{ - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - -public: - - wxMDIParentFrame(); - inline wxMDIParentFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window - const wxString& name = wxFrameNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - ~wxMDIParentFrame(); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr); - - // Mac OS activate event - virtual void MacActivate(long timestamp, bool activating); - - // wxWindows activate event - void OnActivate(wxActivateEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - - void SetMenuBar(wxMenuBar *menu_bar); - - // Get the active MDI child window (Windows only) - wxMDIChildFrame *GetActiveChild() const ; - - // Get the client window - inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }; - - // Create the client window class (don't Create the window, - // just return a new class) - virtual wxMDIClientWindow *OnCreateClient() ; - - // MDI operations - virtual void Cascade(); - virtual void Tile(); - virtual void ArrangeIcons(); - virtual void ActivateNext(); - virtual void ActivatePrevious(); - -protected: - - // TODO maybe have this member - wxMDIClientWindow *m_clientWindow; - wxMDIChildFrame * m_currentChild; - wxMenu* m_windowMenu; - - // TRUE if MDI Frame is intercepting commands, not child - bool m_parentFrameActive; - -private: - friend class WXDLLEXPORT wxMDIChildFrame; -DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxMDIChildFrame: public wxFrame -{ -DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) -public: - - wxMDIChildFrame(); - inline wxMDIChildFrame(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init() ; - Create(parent, id, title, pos, size, style, name); - } - - ~wxMDIChildFrame(); - - bool Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - // Mac OS activate event - virtual void MacActivate(long timestamp, bool activating); - - // Set menu bar - void SetMenuBar(wxMenuBar *menu_bar); - - // MDI operations - virtual void Maximize(); - virtual void Maximize( bool ){ Maximize() ; } // this one is inherited from wxFrame - virtual void Restore(); - virtual void Activate(); -protected: - - // common part of all ctors - void Init(); -}; - -/* The client window is a child of the parent MDI frame, and itself - * contains the child MDI frames. - * However, you create the MDI children as children of the MDI parent: - * only in the implementation does the client window become the parent - * of the children. Phew! So the children are sort of 'adopted'... - */ - -class WXDLLEXPORT wxMDIClientWindow: public wxWindow -{ - DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) - public: - - wxMDIClientWindow() ; - inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0) - { - CreateClient(parent, style); - } - - ~wxMDIClientWindow(); - - // Note: this is virtual, to allow overridden behaviour. - virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); - - // Gets the size available for subwindows after menu size, toolbar size - // and status bar size have been subtracted. If you want to manage your own - // toolbar(s), don't call SetToolBar. - void DoGetClientSize(int *width, int *height) const; - - // Explicitly call default scroll behaviour - void OnScroll(wxScrollEvent& event); - -protected: - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_MDI_H_ diff --git a/include/wx/mac/classic/menu.h b/include/wx/mac/classic/menu.h deleted file mode 100644 index 854a70d107..0000000000 --- a/include/wx/mac/classic/menu.h +++ /dev/null @@ -1,169 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.h -// Purpose: wxMenu, wxMenuBar classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MENU_H_ -#define _WX_MENU_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "menu.h" -#endif - -class WXDLLEXPORT wxFrame; - -#include "wx/arrstr.h" - -// ---------------------------------------------------------------------------- -// Menu -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenu : public wxMenuBase -{ -public: - // ctors & dtor - wxMenu(const wxString& title, long style = 0) - : wxMenuBase(title, style) { Init(); } - - wxMenu(long style = 0) : wxMenuBase(style) { Init(); } - - virtual ~wxMenu(); - - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - virtual void Attach(wxMenuBarBase *menubar) ; - - virtual void Break(); - - virtual void SetTitle(const wxString& title); - - // MSW-specific - bool ProcessCommand(wxCommandEvent& event); - - // implementation only from now on - // ------------------------------- - - int MacGetIndexFromId( int id ) ; - int MacGetIndexFromItem( wxMenuItem *pItem ) ; - void MacEnableMenu( bool bDoEnable ) ; - // MacOS needs to know about submenus somewhere within this menu - // before it can be displayed , also hide special menu items like preferences - // that are handled by the OS - void MacBeforeDisplay( bool isSubMenu ) ; - // undo all changes from the MacBeforeDisplay call - void MacAfterDisplay( bool isSubMenu ) ; - - // semi-private accessors - // get the window which contains this menu - wxWindow *GetWindow() const; - // get the menu handle - WXHMENU GetHMenu() const { return m_hMenu; } - - short MacGetMenuId() { return m_macMenuId ; } - -private: - // common part of all ctors - void Init(); - - // common part of Append/Insert (behaves as Append is pos == (size_t)-1) - bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1); - - // terminate the current radio group, if any - void EndRadioGroup(); - - // if TRUE, insert a breal before appending the next item - bool m_doBreak; - - // the position of the first item in the current radio group or -1 - int m_startRadioGroup; - - // the menu handle of this menu - WXHMENU m_hMenu; - - short m_macMenuId; - - static short s_macNextMenuId ; - - DECLARE_DYNAMIC_CLASS(wxMenu) -}; - -// ---------------------------------------------------------------------------- -// Menu Bar (a la Windows) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase -{ -public: - // ctors & dtor - // default constructor - wxMenuBar(); - // unused under MSW - wxMenuBar(long style); - // menubar takes ownership of the menus arrays but copies the titles - wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); - virtual ~wxMenuBar(); - - // menubar construction - virtual bool Append( wxMenu *menu, const wxString &title ); - virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); - virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title); - virtual wxMenu *Remove(size_t pos); - - virtual int FindMenuItem(const wxString& menuString, - const wxString& itemString) const; - virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const; - - virtual void EnableTop( size_t pos, bool flag ); - virtual void SetLabelTop( size_t pos, const wxString& label ); - virtual wxString GetLabelTop( size_t pos ) const; - - // implementation from now on - WXHMENU Create(); - int FindMenu(const wxString& title); - void Detach(); - - // returns TRUE if we're attached to a frame - bool IsAttached() const { return m_menuBarFrame != NULL; } - // get the frame we live in - wxFrame *GetFrame() const { return m_menuBarFrame; } - // attach to a frame - void Attach(wxFrame *frame); - - // clear the invoking window for all menus and submenus - void UnsetInvokingWindow() ; - - // set the invoking window for all menus and submenus - void SetInvokingWindow( wxFrame* frame ) ; - - // if the menubar is modified, the display is not updated automatically, - // call this function to update it (m_menuBarFrame should be !NULL) - void Refresh(bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL); - - void MacInstallMenuBar() ; - static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; } - static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; } - static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; } - -protected: - // common part of all ctors - void Init(); - wxWindow *m_invokingWindow; - - wxArrayString m_titles; - -private: - static wxMenuBar* s_macInstalledMenuBar ; - static wxMenuBar* s_macCommonMenuBar ; - - DECLARE_DYNAMIC_CLASS(wxMenuBar) -}; - -#endif // _WX_MENU_H_ diff --git a/include/wx/mac/classic/menuitem.h b/include/wx/mac/classic/menuitem.h deleted file mode 100644 index 7e78a57f63..0000000000 --- a/include/wx/mac/classic/menuitem.h +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.h -// Purpose: wxMenuItem class -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.11.97 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MENUITEM_H -#define _MENUITEM_H - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "menuitem.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/setup.h" - -// ---------------------------------------------------------------------------- -// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour -// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenuItem: public wxMenuItemBase -{ -public: - // ctor & dtor - wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL, - int id = wxID_SEPARATOR, - const wxString& name = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL, - wxMenu *subMenu = (wxMenu *)NULL); - virtual ~wxMenuItem(); - - // override base class virtuals - virtual void SetText(const wxString& strName); - - virtual void Enable(bool bDoEnable = TRUE); - virtual void Check(bool bDoCheck = TRUE); - - virtual void SetBitmap(const wxBitmap& bitmap) ; - virtual const wxBitmap& GetBitmap() const { return m_bitmap; } - - // update the os specific representation - void UpdateItemBitmap() ; - void UpdateItemText() ; - void UpdateItemStatus() ; - - // mark item as belonging to the given radio group - void SetAsRadioGroupStart(); - void SetRadioGroupStart(int start); - void SetRadioGroupEnd(int end); - -private: - void UncheckRadio() ; - - // the positions of the first and last items of the radio group this item - // belongs to or -1: start is the radio group start and is valid for all - // but first radio group items (m_isRadioGroupStart == FALSE), end is valid - // only for the first one - union - { - int start; - int end; - } m_radioGroup; - - // does this item start a radio group? - bool m_isRadioGroupStart; - - wxBitmap m_bitmap; // Bitmap for menuitem, if any - void* m_menu ; // the appropriate menu , may also be a system menu - - DECLARE_DYNAMIC_CLASS(wxMenuItem) -}; - -#endif //_MENUITEM_H diff --git a/include/wx/mac/classic/metafile.h b/include/wx/mac/classic/metafile.h deleted file mode 100644 index 2b528efeca..0000000000 --- a/include/wx/mac/classic/metafile.h +++ /dev/null @@ -1,166 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: metafile.h -// Purpose: wxMetaFile, wxMetaFileDC classes. -// This probably should be restricted to Windows platforms, -// but if there is an equivalent on your platform, great. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_METAFIILE_H_ -#define _WX_METAFIILE_H_ - -#if wxUSE_METAFILE -#include "wx/dc.h" -#include "wx/gdiobj.h" - -#if wxUSE_DATAOBJ -#include "wx/dataobj.h" -#endif - -/* - * Metafile and metafile device context classes - * - */ - -#define wxMetaFile wxMetafile -#define wxMetaFileDC wxMetafileDC - -class WXDLLEXPORT wxMetafile; - -class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxMetafile; -public: - wxMetafileRefData(void); - ~wxMetafileRefData(void); - -public: - WXHMETAFILE m_metafile; -}; - -#define M_METAFILEDATA ((wxMetafileRefData *)m_refData) - -class WXDLLEXPORT wxMetafile: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxMetafile) -public: - // Copy constructor - wxMetafile(const wxMetafile& metafile) - : wxGDIObject() - { Ref(metafile); } - - wxMetafile(const wxString& file = wxEmptyString); - ~wxMetafile(void); - - // After this is called, the metafile cannot be used for anything - // since it is now owned by the clipboard. - virtual bool SetClipboard(int width = 0, int height = 0); - - virtual bool Play(wxDC *dc); - inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); }; - - wxSize GetSize() const; - int GetWidth() const { return GetSize().x; } - int GetHeight() const { return GetSize().y; } - - // Implementation - inline WXHMETAFILE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; } - void SetHMETAFILE(WXHMETAFILE mf) ; - - // Operators - inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; } - inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; } - inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; } - -protected: -}; - -class WXDLLEXPORT wxMetafileDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxMetafileDC) - - public: - // the ctor parameters specify the filename (empty for memory metafiles), - // the metafile picture size and the optional description/comment - wxMetafileDC(const wxString& filename = wxEmptyString, - int width = 0, int height = 0, - const wxString& description = wxEmptyString); - - ~wxMetafileDC(void); - - // Should be called at end of drawing - virtual wxMetafile *Close(void); - virtual void DoGetSize(int *width, int *height) const ; - - // Implementation - inline wxMetafile *GetMetaFile(void) const { return m_metaFile; } - inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } - -protected: - wxMetafile* m_metaFile; -}; - -/* - * Pass filename of existing non-placeable metafile, and bounding box. - * Adds a placeable metafile header, sets the mapping mode to anisotropic, - * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode. - * - */ - -// No origin or extent -#define wxMakeMetaFilePlaceable wxMakeMetafilePlaceable -bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0); - -// Optional origin and extent -bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE); - -// ---------------------------------------------------------------------------- -// wxMetafileDataObject is a specialization of wxDataObject for metafile data -// ---------------------------------------------------------------------------- - -#if wxUSE_DATAOBJ -class WXDLLEXPORT wxMetafileDataObject : public wxDataObjectSimple -{ -public: - // ctors - wxMetafileDataObject() - : wxDataObjectSimple(wxDF_METAFILE) { }; - wxMetafileDataObject(const wxMetafile& metafile) - : wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { } - - // virtual functions which you may override if you want to provide data on - // demand only - otherwise, the trivial default versions will be used - virtual void SetMetafile(const wxMetafile& metafile) - { m_metafile = metafile; } - virtual wxMetafile GetMetafile() const - { return m_metafile; } - - // implement base class pure virtuals - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t len, const void *buf); - - virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const - { return GetDataSize(); } - virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format), - void *buf) const - { return GetDataHere(buf); } - virtual bool SetData(const wxDataFormat& WXUNUSED(format), - size_t len, const void *buf) - { return SetData(len, buf); } -protected: - wxMetafile m_metafile; -}; -#endif - -#endif // wxUSE_METAFILE - - -#endif - // _WX_METAFIILE_H_ diff --git a/include/wx/mac/classic/mimetype.h b/include/wx/mac/classic/mimetype.h deleted file mode 100644 index a65acd964c..0000000000 --- a/include/wx/mac/classic/mimetype.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/mimetype.h -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifndef _MIMETYPE_IMPL_H -#define _MIMETYPE_IMPL_H - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "mimetype.h" -#endif - -#include "wx/defs.h" -#include "wx/mimetype.h" - - -class wxMimeTypesManagerImpl -{ -public : - wxMimeTypesManagerImpl() { } -#ifdef __DARWIN__ - ~wxMimeTypesManagerImpl() { } -#endif - - // load all data into memory - done when it is needed for the first time - void Initialize(int mailcapStyles = wxMAILCAP_STANDARD, - const wxString& extraDir = wxEmptyString); - - // and delete the data here - void ClearData(); - - // implement containing class functions - wxFileType *GetFileTypeFromExtension(const wxString& ext); - wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ; - wxFileType *GetFileTypeFromMimeType(const wxString& mimeType); - - size_t EnumAllFileTypes(wxArrayString& mimetypes); - - // this are NOPs under MacOS - bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE) { return TRUE; } - bool ReadMimeTypes(const wxString& WXUNUSED(filename)) { return TRUE; } - - void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); } - - // create a new filetype association - wxFileType *Associate(const wxFileTypeInfo& ftInfo); - // remove association - bool Unassociate(wxFileType *ft); - - // create a new filetype with the given name and extension - wxFileType *CreateFileType(const wxString& filetype, const wxString& ext); - -private: - wxArrayFileTypeInfo m_fallbacks; -}; - -class wxFileTypeImpl -{ -public: - // initialization functions - // this is used to construct a list of mimetypes which match; - // if built with GetFileTypeFromMimetype index 0 has the exact match and - // index 1 the type / * match - // if built with GetFileTypeFromExtension, index 0 has the mimetype for - // the first extension found, index 1 for the second and so on - - void Init(wxMimeTypesManagerImpl *manager, size_t index) - { m_manager = manager; m_index.Add(index); } - - // initialize us with our file type name - void SetFileType(const wxString& strFileType) - { m_strFileType = strFileType; } - void SetExt(const wxString& ext) - { m_ext = ext; } - - // implement accessor functions - bool GetExtensions(wxArrayString& extensions); - bool GetMimeType(wxString *mimeType) const; - bool GetMimeTypes(wxArrayString& mimeTypes) const; - bool GetIcon(wxIconLocation *iconLoc) const; - bool GetDescription(wxString *desc) const; - bool GetOpenCommand(wxString *openCmd, - const wxFileType::MessageParameters&) const - { return GetCommand(openCmd, "open"); } - bool GetPrintCommand(wxString *printCmd, - const wxFileType::MessageParameters&) const - { return GetCommand(printCmd, "print"); } - - size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands, - const wxFileType::MessageParameters& params) const; - - // remove the record for this file type - // probably a mistake to come here, use wxMimeTypesManager.Unassociate (ft) instead - bool Unassociate(wxFileType *ft) - { - return m_manager->Unassociate(ft); - } - - // set an arbitrary command, ask confirmation if it already exists and - // overwriteprompt is TRUE - bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = TRUE); - bool SetDefaultIcon(const wxString& strIcon = wxEmptyString, int index = 0); - - private: - // helper function - bool GetCommand(wxString *command, const char *verb) const; - - wxMimeTypesManagerImpl *m_manager; - wxArrayInt m_index; // in the wxMimeTypesManagerImpl arrays - wxString m_strFileType, m_ext; -}; - -#endif - //_MIMETYPE_H - -/* vi: set cin tw=80 ts=4 sw=4: */ diff --git a/include/wx/mac/classic/minifram.h b/include/wx/mac/classic/minifram.h deleted file mode 100644 index 7f43f953b3..0000000000 --- a/include/wx/mac/classic/minifram.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: minifram.h -// Purpose: wxMiniFrame class. A small frame for e.g. floating toolbars. -// If there is no equivalent on your platform, just make it a -// normal frame. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MINIFRAM_H_ -#define _WX_MINIFRAM_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "minifram.h" -#endif - -#include "wx/frame.h" - -class WXDLLEXPORT wxMiniFrame: public wxFrame { - - DECLARE_DYNAMIC_CLASS(wxMiniFrame) - -public: - inline wxMiniFrame() {} - inline wxMiniFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, - const wxString& name = wxFrameNameStr) - { - // Use wxFrame constructor in absence of more specific code. - Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT , name); - } - - ~wxMiniFrame() {} -protected: -}; - -#endif - // _WX_MINIFRAM_H_ diff --git a/include/wx/mac/classic/msgdlg.h b/include/wx/mac/classic/msgdlg.h deleted file mode 100644 index 1a869f0855..0000000000 --- a/include/wx/mac/classic/msgdlg.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msgdlg.h -// Purpose: wxMessageDialog class. Use generic version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSGBOXDLG_H_ -#define _WX_MSGBOXDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "msgdlg.h" -#endif - -#include "wx/setup.h" -#include "wx/dialog.h" - -/* - * Message box dialog - */ - -WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr; - -class WXDLLEXPORT wxMessageDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxMessageDialog) - -protected: - wxString m_caption; - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; -public: - wxMessageDialog(wxWindow *parent, - const wxString& message, - const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK|wxCENTRE, - const wxPoint& pos = wxDefaultPosition); - - int ShowModal(); - - // not supported for message dialog, RR - virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} - -}; - -#endif - // _WX_MSGBOXDLG_H_ diff --git a/include/wx/mac/classic/notebook.h b/include/wx/mac/classic/notebook.h deleted file mode 100644 index 7f3724805c..0000000000 --- a/include/wx/mac/classic/notebook.h +++ /dev/null @@ -1,157 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: notebook.h -// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet) -// Author: Stefan Csomor -// Modified by: -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NOTEBOOK_H_ -#define _WX_NOTEBOOK_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "notebook.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// fwd declarations -class WXDLLEXPORT wxImageList; -class WXDLLEXPORT wxWindow; - -// ---------------------------------------------------------------------------- -// wxNotebook -// ---------------------------------------------------------------------------- - -// @@@ this class should really derive from wxTabCtrl, but the interface is not -// exactly the same, so I can't do it right now and instead we reimplement -// part of wxTabCtrl here -class wxNotebook : public wxNotebookBase -{ -public: - // ctors - // ----- - // default for dynamic class - wxNotebook(); - // the same arguments as for wxControl (@@@ any special styles?) - wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("notebook")); - // Create() function - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("notebook")); - // dtor - ~wxNotebook(); - - // accessors - // --------- - // set the currently selected page, return the index of the previously - // selected one (or -1 on error) - // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events - int SetSelection(size_t nPage); - // get the currently selected page - int GetSelection() const { return m_nSelection; } - - // set/get the title of a page - bool SetPageText(size_t nPage, const wxString& strText); - wxString GetPageText(size_t nPage) const; - - // sets/returns item's image index in the current image list - int GetPageImage(size_t nPage) const; - bool SetPageImage(size_t nPage, int nImage); - - // control the appearance of the notebook pages - // set the size (the same for all pages) - virtual void SetPageSize(const wxSize& size); - // set the padding between tabs (in pixels) - virtual void SetPadding(const wxSize& padding); - // sets the size of the tabs (assumes all tabs are the same size) - virtual void SetTabSize(const wxSize& sz); - - // calculate size for wxNotebookSizer - wxSize CalcSizeFromPage(const wxSize& sizePage) const; - wxRect GetPageRect() const ; -/* - // get number of pages in the dialog - int GetPageCount() const; - - // cycle thru the tabs - void AdvanceSelection(bool bForward = TRUE); - - - // currently it's always 1 because wxGTK doesn't support multi-row - // tab controls - int GetRowCount() const; -*/ - // operations - // ---------- - // remove all pages - bool DeleteAllPages(); - // the same as AddPage(), but adds it at the specified position - bool InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect = FALSE, - int imageId = -1); -/* - // get the panel which represents the given page - wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; } -*/ - // callbacks - // --------- - void OnSize(wxSizeEvent& event); - void OnSelChange(wxNotebookEvent& event); - void OnSetFocus(wxFocusEvent& event); - void OnNavigationKey(wxNavigationKeyEvent& event); - void OnMouse(wxMouseEvent &event); - - // implementation - // -------------- - -#if wxUSE_CONSTRAINTS - virtual void SetConstraintSizes(bool recurse = TRUE); - virtual bool DoPhase(int nPhase); - -#endif - - // base class virtuals - // ------------------- - virtual void Command(wxCommandEvent& event); -protected: - virtual wxSize DoGetBestSize() const ; - virtual wxNotebookPage *DoRemovePage(size_t page) ; - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - // common part of all ctors - void Init(); - - // helper functions - void ChangePage(int nOldSel, int nSel); // change pages - void MacSetupTabs(); - - // the icon indices - wxArrayInt m_images; - - int m_nSelection; // the current selection (-1 if none) - - DECLARE_DYNAMIC_CLASS(wxNotebook) - DECLARE_EVENT_TABLE() -}; - - -#endif // _WX_NOTEBOOK_H_ diff --git a/include/wx/mac/classic/palette.h b/include/wx/mac/classic/palette.h deleted file mode 100644 index 74f9a4dd30..0000000000 --- a/include/wx/mac/classic/palette.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.h -// Purpose: wxPalette class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PALETTE_H_ -#define _WX_PALETTE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "palette.h" -#endif - -#include "wx/colour.h" -#include "wx/gdiobj.h" - -class WXDLLEXPORT wxPalette; - -class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData -{ - DECLARE_NO_COPY_CLASS(wxPaletteRefData) - - friend class WXDLLEXPORT wxPalette; -public: - wxPaletteRefData(); - ~wxPaletteRefData(); -protected: - wxColour* m_palette; - wxInt32 m_count ; -}; - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -class WXDLLEXPORT wxPalette: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxPalette) - -public: - wxPalette(); - wxPalette(const wxPalette& palette) - : wxGDIObject() - { Ref(palette); } - - wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - ~wxPalette(); - bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const; - bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; - - virtual bool Ok() const { return (m_refData != NULL) ; } - - inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; } - inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } - inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } - -/* TODO: implementation - inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } - void SetHPALETTE(WXHPALETTE pal); -*/ -}; - -#endif - // _WX_PALETTE_H_ diff --git a/include/wx/mac/classic/pen.h b/include/wx/mac/classic/pen.h deleted file mode 100644 index 50afa0d9c4..0000000000 --- a/include/wx/mac/classic/pen.h +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/pen.h -// Purpose: wxPen class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PEN_H_ -#define _WX_PEN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pen.h" -#endif - -#include "wx/gdiobj.h" -#include "wx/colour.h" -#include "wx/bitmap.h" - -class WXDLLEXPORT wxPen; - -class WXDLLEXPORT wxPenRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxPen; -public: - wxPenRefData(); - wxPenRefData(const wxPenRefData& data); - ~wxPenRefData(); - - wxPenRefData& operator=(const wxPenRefData& data); - -protected: - int m_width; - int m_style; - int m_join ; - int m_cap ; - wxBitmap m_stipple ; - int m_nbDash ; - wxDash * m_dash ; - wxColour m_colour; -/* TODO: implementation - WXHPEN m_hPen; -*/ -}; - -#define M_PENDATA ((wxPenRefData *)m_refData) - -// Pen -class WXDLLEXPORT wxPen: public wxGDIObject -{ - DECLARE_DYNAMIC_CLASS(wxPen) -public: - wxPen(); - wxPen(const wxColour& col, int width = 1, int style = wxSOLID); - wxPen(const wxBitmap& stipple, int width); - wxPen(const wxPen& pen) - : wxGDIObject() - { Ref(pen); } - ~wxPen(); - - inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } - inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; } - inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; } - - virtual bool Ok() const { return (m_refData != NULL) ; } - - // Override in order to recreate the pen - void SetColour(const wxColour& col) ; - void SetColour(unsigned char r, unsigned char g, unsigned char b) ; - - void SetWidth(int width) ; - void SetStyle(int style) ; - void SetStipple(const wxBitmap& stipple) ; - void SetDashes(int nb_dashes, const wxDash *dash) ; - void SetJoin(int join) ; - void SetCap(int cap) ; - - inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); }; - inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); }; - inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); }; - inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); }; - inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); }; - inline int GetDashes(wxDash **ptr) const { - *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0); - } - - inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); }; - -// Implementation - - // Useful helper: create the brush resource - bool RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_PEN_H_ diff --git a/include/wx/mac/classic/pnghand.h b/include/wx/mac/classic/pnghand.h deleted file mode 100644 index 19271c4705..0000000000 --- a/include/wx/mac/classic/pnghand.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pnghand.h -// Purpose: PNG bitmap handler -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pnghand.h" -#endif - -#ifndef _WX_PNGHAND_H_ -#define _WX_PNGHAND_H_ - -class WXDLLEXPORT wxPNGFileHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxPNGFileHandler) -public: - inline wxPNGFileHandler(void) - { - m_name = wxT("PNG bitmap file"); - m_extension = wxT("bmp"); - m_type = wxBITMAP_TYPE_PNG; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); - virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); -}; - -#endif - // _WX_PNGHAND_H_ - diff --git a/include/wx/mac/classic/pngread.h b/include/wx/mac/classic/pngread.h deleted file mode 100644 index d1a8b96a5a..0000000000 --- a/include/wx/mac/classic/pngread.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * File: pngread.h - * Purpose: PNG file reader - * Author: Alejandro Aguilar Sierra/Julian Smart - * Created: 1995 - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * - */ - -#ifndef _WX_PNGREAD__ -#define _WX_PNGREAD__ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "pngread.h" -#endif - -#ifndef byte -typedef unsigned char byte; -#endif - -#define WXIMA_COLORS DIB_PAL_COLORS - -typedef byte * ImagePointerType; - -typedef struct -{ - byte red; - byte green; - byte blue; -} rgb_color_struct; - - -#define COLORTYPE_PALETTE 1 -#define COLORTYPE_COLOR 2 -#define COLORTYPE_ALPHA 4 - -class wxPNGReader -{ -protected: - int filetype; - char filename[255]; - ImagePointerType RawImage; // Image data - - int Width, Height; // Dimensions - int Depth; // (bits x pixel) - int ColorType; // Bit 1 = Palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - long EfeWidth; // Efective Width - - void *lpbi; - int bgindex; - wxPalette* m_palette; - bool imageOK; -friend class wxPNGReaderIter; -public: - wxPNGReader(void); - wxPNGReader (char* ImageFileName); // Read an image file - virtual ~wxPNGReader (); - - void Create(int width, int height, int deep, int colortype=-1); - - bool ReadFile( char* ImageFileName=0 ); - bool SaveFile( char* ImageFileName=0 ); - bool SaveXPM(char *filename, char *name = 0); - int GetWidth( void ) const { return Width; }; - int GetHeight( void ) const { return Height; }; - int GetDepth( void ) const { return Depth; }; - int GetColorType( void ) const { return ColorType; }; - - int GetIndex(int x, int y); - bool GetRGB(int x, int y, byte* r, byte* g, byte* b); - - bool SetIndex(int x, int y, int index); - bool SetRGB(int x, int y, byte r, byte g, byte b); - - // ColorMap settings - bool SetPalette(wxPalette* colourmap); - bool SetPalette(int n, rgb_color_struct *rgb_struct); - bool SetPalette(int n, byte *r, byte *g=0, byte *b=0); - wxPalette* GetPalette() const { return m_palette; } - - void NullData(); - inline int GetBGIndex(void) { return bgindex; } - - inline bool Inside(int x, int y) - { return (0<=y && yRawImage; - Itx = Ity = 0; - Stepx = Stepy = 0; -} - -inline -wxPNGReaderIter::operator wxPNGReader* () -{ - return ima; -} - -inline -bool wxPNGReaderIter::ItOK () -{ - if (ima) - return ima->Inside(Itx, Ity); - else - return FALSE; -} - - -inline void wxPNGReaderIter::reset() -{ - IterImage = ima->RawImage; - Itx = Ity = 0; -} - -inline void wxPNGReaderIter::upset() -{ - Itx = 0; - Ity = ima->Height-1; - IterImage = ima->RawImage + ima->EfeWidth*(ima->Height-1); -} - -inline bool wxPNGReaderIter::NextRow() -{ - if (++Ity >= ima->Height) return 0; - IterImage += ima->EfeWidth; - return 1; -} - -inline bool wxPNGReaderIter::PrevRow() -{ - if (--Ity < 0) return 0; - IterImage -= ima->EfeWidth; - return 1; -} - -////////////////////////// AD - for interlace /////////////////////////////// -inline void wxPNGReaderIter::SetY(int y) -{ - if ((y < 0) || (y > ima->Height)) return; - Ity = y; - IterImage = ima->RawImage + ima->EfeWidth*y; -} - -///////////////////////////////////////////////////////////////////////////// - -inline void wxPNGReaderIter::SetRow(byte *buf, int n) -{ -// Here should be bcopy or memcpy - //_fmemcpy(IterImage, (void far *)buf, n); - if (n<0) - n = ima->GetWidth(); - - for (int i=0; iEfeWidth) - return 1; - else - if (++Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::PrevByte() -{ - if (--Itx >= 0) - return 1; - else - if (--Ity >= 0) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::NextStep() -{ - Itx += Stepx; - if (Itx < ima->EfeWidth) - return 1; - else { - Ity += Stepy; - if (Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -inline bool wxPNGReaderIter::PrevStep() -{ - Itx -= Stepx; - if (Itx >= 0) - return 1; - else { - Ity -= Stepy; - if (Ity >= 0 && Ity < ima->Height) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -#endif - diff --git a/include/wx/mac/classic/printdlg.h b/include/wx/mac/classic/printdlg.h deleted file mode 100644 index 6bb45dad2f..0000000000 --- a/include/wx/mac/classic/printdlg.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.h -// Purpose: wxPrintDialog, wxPageSetupDialog classes. -// Use generic, PostScript version if no -// platform-specific implementation. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTDLG_H_ -#define _WX_PRINTDLG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "printdlg.h" -#endif - -#include "wx/dialog.h" -#include "wx/cmndata.h" - -/* - * wxPrinterDialog - * The common dialog for printing. - */ - -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxPrintDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxPrintDialog) - - public: - wxPrintDialog(); - wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL); - wxPrintDialog(wxWindow *parent, wxPrintData* data ); - ~wxPrintDialog(); - - bool Create(wxWindow *parent, wxPrintDialogData* data = NULL); - virtual int ShowModal(); - - wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } - wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); } - virtual wxDC *GetPrintDC(); - - private: - wxPrintDialogData m_printDialogData; - wxDC* m_printerDC; - bool m_destroyDC; - wxWindow* m_dialogParent; -}; - -class WXDLLEXPORT wxPageSetupDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxPageSetupDialog) - - public: - wxPageSetupDialog(); - wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL); - ~wxPageSetupDialog(); - - bool Create(wxWindow *parent, wxPageSetupData *data = NULL); - virtual int ShowModal(); - - inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; } - private: - wxPageSetupData m_pageSetupData; - wxWindow* m_dialogParent; -}; - -#endif - // _WX_PRINTDLG_H_ diff --git a/include/wx/mac/classic/printmac.h b/include/wx/mac/classic/printmac.h deleted file mode 100644 index c5eb431026..0000000000 --- a/include/wx/mac/classic/printmac.h +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printwin.h -// Purpose: wxWindowsPrinter, wxWindowsPrintPreview classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTWIN_H_ -#define _WX_PRINTWIN_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "printwin.h" -#endif - -#include "wx/prntbase.h" - -/* - * Represents the printer: manages printing a wxPrintout object - */ - -class WXDLLEXPORT wxMacPrinter: public wxPrinterBase -{ - DECLARE_DYNAMIC_CLASS(wxMacPrinter) - - public: - wxMacPrinter(wxPrintDialogData *data = NULL); - virtual ~wxMacPrinter(); - - virtual bool Print(wxWindow *parent, - wxPrintout *printout, - bool prompt = TRUE); - virtual wxDC* PrintDialog(wxWindow *parent); - virtual bool Setup(wxWindow *parent); - -}; - -/* - * wxPrintPreview - * Programmer creates an object of this class to preview a wxPrintout. - */ - -class WXDLLEXPORT wxMacPrintPreview: public wxPrintPreviewBase -{ - DECLARE_CLASS(wxMacPrintPreview) - - public: - wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting = NULL, - wxPrintDialogData *data = NULL); - wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - virtual ~wxMacPrintPreview(); - - virtual bool Print(bool interactive); - virtual void DetermineScaling(); -}; - -#endif - // _WX_PRINTWIN_H_ diff --git a/include/wx/mac/classic/private.h b/include/wx/mac/classic/private.h deleted file mode 100644 index 2f0c5cb7e0..0000000000 --- a/include/wx/mac/classic/private.h +++ /dev/null @@ -1,238 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: private.h -// Purpose: Private declarations: as this header is only included by -// wxWindows itself, it may contain identifiers which don't start -// with "wx". -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_H_ -#define _WX_PRIVATE_H_ - -#include "wx/defs.h" -#include "wx/app.h" - -#ifdef __DARWIN__ -# include -#else -# include -# include -# include -# include -# include -# include -# include -#endif - -#if UNIVERSAL_INTERFACES_VERSION < 0x0340 - #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/" -#endif - -#if wxUSE_GUI - -#include "wx/window.h" - -class wxMacPortStateHelper -{ - DECLARE_NO_COPY_CLASS(wxMacPortStateHelper) - -public: - wxMacPortStateHelper( GrafPtr newport) ; - wxMacPortStateHelper() ; - ~wxMacPortStateHelper() ; - - void Setup( GrafPtr newport ) ; - void Clear() ; - bool IsCleared() { return m_clip == NULL ; } - GrafPtr GetCurrentPort() { return m_currentPort ; } - -private: - GrafPtr m_currentPort ; - GrafPtr m_oldPort ; - RgnHandle m_clip ; - ThemeDrawingState m_drawingState ; - short m_textFont ; - short m_textSize ; - short m_textStyle ; - short m_textMode ; -} ; - -class WXDLLEXPORT wxMacPortSetter -{ - DECLARE_NO_COPY_CLASS(wxMacPortSetter) - -public: - wxMacPortSetter( const wxDC* dc ) ; - ~wxMacPortSetter() ; -private: - wxMacPortStateHelper m_ph ; - const wxDC* m_dc ; -} ; - -class WXDLLEXPORT wxMacWindowClipper -{ - DECLARE_NO_COPY_CLASS(wxMacWindowClipper) - -public: - wxMacWindowClipper( const wxWindow* win ) ; - ~wxMacWindowClipper() ; -private: - RgnHandle m_formerClip ; - RgnHandle m_newClip ; -} ; - -class wxMacDrawingHelper -{ - DECLARE_NO_COPY_CLASS(wxMacDrawingHelper) - -public: - wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ; - ~wxMacDrawingHelper() ; - bool Ok() { return m_ok ; } - void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; } - void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; } - void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; } - const Point& GetOrigin() { return m_origin ; } -private: - Point m_origin ; - GrafPtr m_formerPort ; - GrafPtr m_currentPort ; - PenState m_savedPenState ; - bool m_ok ; -} ; - -// app.h -bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec) ; - -#endif // wxUSE_GUI - -// filefn.h -WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ; -WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ; -WXDLLEXPORT void wxMacFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; -# ifndef __DARWIN__ -// Mac file names are POSIX (Unix style) under Darwin, so these are not needed -WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ; -WXDLLEXPORT void wxUnixFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; -WXDLLEXPORT wxString wxMac2UnixFilename( const wxChar *s) ; -WXDLLEXPORT wxString wxUnix2MacFilename( const wxChar *s); -# endif - -// utils.h -WXDLLEXPORT wxString wxMacFindFolder(short vRefNum, - OSType folderType, - Boolean createFolder); - -#if wxUSE_GUI - -GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ; -void wxMacDestroyGWorld( GWorldPtr gw ) ; -PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ; -CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ; -void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ; -CTabHandle wxMacCreateColorTable( int numColors ) ; -void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType = 0 ) ; - -#define MAC_WXCOLORREF(a) (*((RGBColor*)&(a))) -#define MAC_WXHBITMAP(a) (GWorldPtr(a)) -#define MAC_WXHMETAFILE(a) (PicHandle(a)) -#define MAC_WXHICON(a) (CIconHandle(a)) -#define MAC_WXHCURSOR(a) (CursHandle(a)) -#define MAC_WXHRGN(a) (RgnHandle(a)) -#define MAC_WXHWND(a) (WindowPtr(a)) -#define MAC_WXRECPTR(a) ((Rect*)a) -#define MAC_WXPOINTPTR(a) ((Point*)a) -#define MAC_WXHMENU(a) ((MenuHandle)a) - -#endif // wxUSE_GUI - -//--------------------------------------------------------------------------- -// wxMac string conversions -//--------------------------------------------------------------------------- - -void wxMacSetupConverters() ; -void wxMacCleanupConverters() ; - -void wxMacStringToPascal( const wxString&from , StringPtr to ) ; -wxString wxMacMakeStringFromPascal( ConstStringPtr from ) ; - -void wxMacConvertNewlines13To10( char * data ) ; -void wxMacConvertNewlines10To13( char * data ) ; -void wxMacConvertNewlines13To10( wxString *data ) ; -void wxMacConvertNewlines10To13( wxString *data ) ; - -#if wxUSE_UNICODE -void wxMacConvertNewlines13To10( wxChar * data ) ; -void wxMacConvertNewlines10To13( wxChar * data ) ; -#endif - -#if TARGET_CARBON - -class wxMacCFStringHolder -{ -public: - wxMacCFStringHolder() - { - m_cfs = NULL ; - m_release = false ; - } - - wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) - { - m_cfs = NULL ; - m_release = false ; - Assign( str , encoding ) ; - } - - wxMacCFStringHolder(CFStringRef ref , bool release = true ) - { - m_cfs = ref ; - m_release = release ; - } - - ~wxMacCFStringHolder() - { - Release() ; - } - - CFStringRef Detach() - { - CFStringRef retval = m_cfs ; - m_release = false ; - m_cfs = NULL ; - return retval ; - } - - void Release() - { - if ( m_release && m_cfs) - CFRelease( m_cfs ) ; - m_cfs = NULL ; - } - - void Assign( const wxString &str , wxFontEncoding encoding ) ; - - operator CFStringRef () { return m_cfs; } - wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; - -private: - - CFStringRef m_cfs; - bool m_release ; -} ; - -#endif - - - -wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) ; -wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) ; - - -#endif - // _WX_PRIVATE_H_ diff --git a/include/wx/mac/classic/private/hid.h b/include/wx/mac/classic/private/hid.h deleted file mode 100644 index 2947ee3575..0000000000 --- a/include/wx/mac/classic/private/hid.h +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include - -//Utility wrapper around CFArray -class wxCFArray -{ -public: - wxCFArray(CFTypeRef pData) : pArray((CFArrayRef) pData) {} - CFTypeRef operator [] (const int& nIndex) {return CFArrayGetValueAtIndex(pArray, nIndex); } - int Count() {return CFArrayGetCount(pArray);} -private: - CFArrayRef pArray; -}; - -// -// A wrapper around OS X HID Manager procedures. -// The tutorial "Working With HID Class Device Interfaces" Is -// Quite good, as is the sample program associated with it -// (Depite the author's protests!). -class wxHIDDevice -{ -public: - wxHIDDevice() : m_ppDevice(NULL), m_ppQueue(NULL), m_pCookies(NULL) {} - //kHIDPage_GenericDesktop - //kHIDUsage_GD_Joystick,kHIDUsage_GD_Mouse,kHIDUsage_GD_Keyboard - bool Create (const int& nClass = -1, const int& nType = -1); - - inline void AddCookie(CFTypeRef Data, const int& i); - inline void AddCookieInQueue(CFTypeRef Data, const int& i); - inline void InitCookies(const size_t& dwSize, bool bQueue = false); - - //Must be implemented by derived classes - //builds the cookie array - - //first call InitCookies to initialize the cookie - //array, then AddCookie to add a cookie at a certain point in an array - virtual void BuildCookies(wxCFArray& Array) = 0; - - //checks to see whether the cookie at index nIndex is active (element value != 0) - bool IsActive(const int& nIndex); - - //closes the device and cleans the queue and cookies - virtual ~wxHIDDevice(); -private: - IOHIDDeviceInterface** m_ppDevice; //this, essentially - IOHIDQueueInterface** m_ppQueue; //queue (if we want one) - IOHIDElementCookie* m_pCookies; //cookies - - const char* m_szName; //(product) name - mach_port_t m_pPort; -}; - -class wxHIDKeyboard : public wxHIDDevice -{ -public: - bool Create(); - virtual void BuildCookies(wxCFArray& Array); -}; \ No newline at end of file diff --git a/include/wx/mac/classic/private/print.h b/include/wx/mac/classic/private/print.h deleted file mode 100644 index d406494902..0000000000 --- a/include/wx/mac/classic/private/print.h +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: print.h -// Purpose: private implementation for printing on MacOS -// Author: Stefan Csomor -// Modified by: -// Created: 03/02/99 -// RCS-ID: $Id: -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_PRIVATE_PRINT_H_ -#define _WX_MAC_PRIVATE_PRINT_H_ - -#include "wx/cmndata.h" -#include "wx/mac/private.h" - -#if TARGET_CARBON && !defined(__DARWIN__) -# include -#endif - -#ifndef __DARWIN__ -# include "Printing.h" -#endif - -#if TARGET_CARBON -#if !PM_USE_SESSION_APIS -#error "only Carbon Printing Session API is supported" -#endif -#endif - -class wxNativePrintData -{ -public : - wxNativePrintData() {} - virtual ~wxNativePrintData() {} - - virtual void TransferFrom( wxPrintData * ) = 0 ; - virtual void TransferTo( wxPrintData * ) = 0 ; - - virtual void TransferFrom( wxPageSetupDialogData * ) = 0 ; - virtual void TransferTo( wxPageSetupDialogData * ) = 0 ; - - virtual void TransferFrom( wxPrintDialogData * ) = 0 ; - virtual void TransferTo( wxPrintDialogData * ) = 0 ; - - virtual void CopyFrom( wxNativePrintData * ) = 0; - - virtual int ShowPrintDialog() = 0 ; - virtual int ShowPageSetupDialog() = 0 ; - - static wxNativePrintData* Create() ; -} ; - -#if TARGET_CARBON - -class wxMacCarbonPrintData : public wxNativePrintData -{ -public : - wxMacCarbonPrintData() ; - ~wxMacCarbonPrintData() ; - - virtual void TransferFrom( wxPrintData * ) ; - virtual void TransferTo( wxPrintData * ) ; - - virtual void TransferFrom( wxPageSetupDialogData * ) ; - virtual void TransferTo( wxPageSetupDialogData * ) ; - - virtual void TransferFrom( wxPrintDialogData * ) ; - virtual void TransferTo( wxPrintDialogData * ) ; - - virtual void CopyFrom( wxNativePrintData * ) ; - virtual int ShowPrintDialog() ; - virtual int ShowPageSetupDialog() ; -private : - virtual void ValidateOrCreate() ; -public : - PMPrintSession m_macPrintSession ; - PMPageFormat m_macPageFormat ; - PMPrintSettings m_macPrintSettings ; -} ; - -#else - -class wxMacClassicPrintData : public wxNativePrintData -{ -public : - wxMacClassicPrintData() ; - ~wxMacClassicPrintData() ; - virtual void TransferFrom( wxPrintData * ) ; - virtual void TransferTo( wxPrintData * ) ; - virtual void TransferFrom( wxPageSetupDialogData * ) ; - virtual void TransferTo( wxPageSetupDialogData * ) ; - virtual void TransferFrom( wxPrintDialogData * ) ; - virtual void TransferTo( wxPrintDialogData * ) ; - virtual void CopyFrom( wxNativePrintData * ) ; - virtual int ShowPrintDialog() ; - virtual int ShowPageSetupDialog() ; -private : - virtual void ValidateOrCreate() ; -public : - THPrint m_macPrintSettings ; -} ; - -#endif - -#endif diff --git a/include/wx/mac/classic/radiobox.h b/include/wx/mac/classic/radiobox.h deleted file mode 100644 index c9642e2deb..0000000000 --- a/include/wx/mac/classic/radiobox.h +++ /dev/null @@ -1,108 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h -// Purpose: wxRadioBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBOX_H_ -#define _WX_RADIOBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "radiobox.h" -#endif - -// List box item -class WXDLLEXPORT wxBitmap ; - -class WXDLLEXPORT wxRadioButton ; - -class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase -{ - DECLARE_DYNAMIC_CLASS(wxRadioBox) -public: -// Constructors & destructor - wxRadioBox(); - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) - { - Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); - } - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr) - { - Create(parent, id, title, pos, size, choices, - majorDim, style, val, name); - } - ~wxRadioBox(); - bool Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim = 0, long style = wxRA_HORIZONTAL, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr); - -// Specific functions (in wxWindows2 reference) - virtual void SetSelection(int item); - virtual int GetSelection() const; - - inline virtual int GetCount() const { return m_noItems; } ; - - virtual wxString GetString(int item) const; - virtual void SetString(int item, const wxString& label) ; - - virtual void Enable(int item, bool enable); - virtual void Show(int item, bool show) ; - - virtual int GetColumnCount() const ; - virtual int GetRowCount() const ; - - - virtual bool Enable(bool enable = TRUE); - virtual wxString GetLabel() const; - virtual void SetLabel(const wxString& label) ; - virtual bool Show(bool show = TRUE); - -// Other external functions - void Command(wxCommandEvent& event); - void SetFocus(); - -// Other variable access functions - inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } - inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } - - void OnRadioButton( wxCommandEvent& event ) ; -protected: - wxRadioButton *m_radioButtonCycle; - - int m_majorDim ; - int m_noItems; - int m_noRowsOrCols; - -// Internal functions - virtual wxSize DoGetBestSize() const ; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_RADIOBOX_H_ diff --git a/include/wx/mac/classic/radiobut.h b/include/wx/mac/classic/radiobut.h deleted file mode 100644 index 22fe9c1bda..0000000000 --- a/include/wx/mac/classic/radiobut.h +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.h -// Purpose: wxRadioButton class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBUT_H_ -#define _WX_RADIOBUT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "radiobut.h" -#endif - -class WXDLLEXPORT wxRadioButton: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxRadioButton) - protected: -public: - inline wxRadioButton() {} - inline wxRadioButton(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxRadioButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxRadioButtonNameStr); - - virtual void SetValue(bool val); - virtual bool GetValue() const ; - - // implementation - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ); - void Command(wxCommandEvent& event); - wxRadioButton *AddInCycle(wxRadioButton *cycle); - inline wxRadioButton *NextInCycle() {return m_cycle;} - - protected: - - wxRadioButton *m_cycle; -}; - -// Not implemented -#if 0 -class WXDLLEXPORT wxBitmap ; - -WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr; - -class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton -{ - DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton) - protected: - wxBitmap *theButtonBitmap; - public: - inline wxBitmapRadioButton() { theButtonBitmap = NULL; } - inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr); - - virtual void SetLabel(const wxBitmap *label); - virtual void SetValue(bool val) ; - virtual bool GetValue() const ; -}; -#endif - -#endif - // _WX_RADIOBUT_H_ diff --git a/include/wx/mac/classic/region.h b/include/wx/mac/classic/region.h deleted file mode 100644 index ab04dd8975..0000000000 --- a/include/wx/mac/classic/region.h +++ /dev/null @@ -1,177 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: region.h -// Purpose: wxRegion class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_REGION_H_ -#define _WX_REGION_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "region.h" -#endif - -#include "wx/list.h" -#include "wx/gdiobj.h" -#include "wx/gdicmn.h" - -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxPoint; - -enum wxRegionContain { - wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2 -}; - -// So far, for internal use only -enum wxRegionOp { -wxRGN_AND, // Creates the intersection of the two combined regions. -wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1. -wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2. -wxRGN_OR, // Creates the union of two combined regions. -wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas. -}; - -class WXDLLEXPORT wxRegion : public wxGDIObject { -DECLARE_DYNAMIC_CLASS(wxRegion); - friend class WXDLLEXPORT wxRegionIterator; -public: - wxRegion(long x, long y, long w, long h); - wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRegion(const wxRect& rect); - wxRegion( WXHRGN hRegion ); - wxRegion(); - wxRegion( const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0) - { - Union(bmp, transColour, tolerance); - } - - ~wxRegion(); - - //# Copying - wxRegion(const wxRegion& r) - : wxGDIObject() - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - - //# Modify region - // Clear current region - void Clear(); - - // Union rectangle or region with this. - bool Union(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_OR); } - bool Union(const wxRect& rect) - { return Combine(rect, wxRGN_OR); } - bool Union(const wxRegion& region) - { return Combine(region, wxRGN_OR); } - - // Intersect rectangle or region with this. - bool Intersect(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_AND); } - bool Intersect(const wxRect& rect) - { return Combine(rect, wxRGN_AND); } - bool Intersect(const wxRegion& region) - { return Combine(region, wxRGN_AND); } - - // Subtract rectangle or region from this: - // Combines the parts of 'this' that are not part of the second region. - bool Subtract(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_DIFF); } - bool Subtract(const wxRect& rect) - { return Combine(rect, wxRGN_DIFF); } - bool Subtract(const wxRegion& region) - { return Combine(region, wxRGN_DIFF); } - - // XOR: the union of two combined regions except for any overlapping areas. - bool Xor(long x, long y, long width, long height) - { return Combine(x, y, width, height, wxRGN_XOR); } - bool Xor(const wxRect& rect) - { return Combine(rect, wxRGN_XOR); } - bool Xor(const wxRegion& region) - { return Combine(region, wxRGN_XOR); } - - //# Information on region - // Outer bounds of region - void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const; - wxRect GetBox() const ; - - // Is region empty? - bool Empty() const; - inline bool IsEmpty() const { return Empty(); } - - //# Tests - // Does the region contain the point (x,y)? - wxRegionContain Contains(long x, long y) const; - // Does the region contain the point pt? - wxRegionContain Contains(const wxPoint& pt) const; - // Does the region contain the rectangle (x, y, w, h)? - wxRegionContain Contains(long x, long y, long w, long h) const; - // Does the region contain the rectangle rect? - wxRegionContain Contains(const wxRect& rect) const; - - // Convert the region to a B&W bitmap with the white pixels being inside - // the region. - wxBitmap ConvertToBitmap() const; - - // Use the non-transparent pixels of a wxBitmap for the region to combine - // with this region. If the bitmap has a mask then it will be used, - // otherwise the colour to be treated as transparent may be specified, - // along with an optional tolerance value. - bool Union(const wxBitmap& bmp, - const wxColour& transColour = wxNullColour, - int tolerance = 0); - - // Internal - bool Combine(long x, long y, long width, long height, wxRegionOp op); - bool Combine(const wxRegion& region, wxRegionOp op); - bool Combine(const wxRect& rect, wxRegionOp op); - const WXHRGN GetWXHRGN() const ; -}; - -class WXDLLEXPORT wxRegionIterator : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxRegionIterator) - -public: - wxRegionIterator(); - wxRegionIterator(const wxRegion& region); - wxRegionIterator(const wxRegionIterator& iterator); - ~wxRegionIterator(); - - wxRegionIterator& operator=(const wxRegionIterator& iterator); - - void Reset() { m_current = 0; } - void Reset(const wxRegion& region); - - operator bool () const { return m_current < m_numRects; } - bool HaveRects() const { return m_current < m_numRects; } - - wxRegionIterator& operator++(); - wxRegionIterator operator++(int); - - long GetX() const; - long GetY() const; - long GetW() const; - long GetWidth() const { return GetW(); } - long GetH() const; - long GetHeight() const { return GetH(); } - wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); } -private: - void SetRects(long numRects, wxRect *rects); - - long m_current; - long m_numRects; - wxRegion m_region; - wxRect* m_rects; -}; - -#endif - // _WX_REGION_H_ diff --git a/include/wx/mac/classic/scrolbar.h b/include/wx/mac/classic/scrolbar.h deleted file mode 100644 index 633b615ced..0000000000 --- a/include/wx/mac/classic/scrolbar.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrollbar.h -// Purpose: wxScrollBar class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCROLBAR_H_ -#define _WX_SCROLBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "scrolbar.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr; - -// Scrollbar item -class WXDLLEXPORT wxScrollBar: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxScrollBar) - -public: - inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; } - ~wxScrollBar(); - - inline wxScrollBar(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSB_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxScrollBarNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSB_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxScrollBarNameStr); - - int GetThumbPosition() const ; - inline int GetThumbSize() const { return m_viewSize; } - inline int GetPageSize() const { return m_pageSize; } - inline int GetRange() const { return m_objectSize; } - - bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; } - - virtual void SetThumbPosition(int viewStart); - virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh = TRUE); - - void Command(wxCommandEvent& event); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - int m_pageSize; - int m_viewSize; - int m_objectSize; - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_SCROLBAR_H_ diff --git a/include/wx/mac/classic/setup.h b/include/wx/mac/classic/setup.h deleted file mode 100644 index b67d2f2c52..0000000000 --- a/include/wx/mac/classic/setup.h +++ /dev/null @@ -1,938 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: setup.h -// Purpose: Configuration for the library -// Author: Stefan Csomor -// Modified by: Stefan Csomor -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -#define wxUSE_LIBMSPACK 0 -#define wxUSE_SOUND 1 -// ---------------------------------------------------------------------------- -// global settings -// ---------------------------------------------------------------------------- - -// define this to 0 when building wxBase library - this can also be done from -// makefile/project file overriding the value here -#ifndef wxUSE_GUI - #define wxUSE_GUI 1 -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// compatibility settings -// ---------------------------------------------------------------------------- - -// This setting determines the compatibility with 2.0 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_2 0 - -// This setting determines the compatibility with 2.2 API: set it to 0 to -// flag all cases of using deprecated functions. -// -// Default is 1 but please try building your code with 0 as the default will -// change to 0 in the next version and the deprecated functions will disappear -// in the version after it completely. -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 1 - -// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap, -// but this is very dangerous because you can mistakenly pass an icon instead -// of a bitmap to a function taking "const wxBitmap&" - which will *not* work -// because an icon is not a valid bitmap -// -// Starting from 2.1.12, you have the choice under this backwards compatible -// behaviour (your code will still compile, but probably won't behave as -// expected!) and not deriving wxIcon class from wxBitmap, but providing a -// conversion ctor wxBitmap(const wxIcon&) instead. -// -// Recommended setting: 0 -#define wxICON_IS_BITMAP 0 - -// Define as 1 for font size to be backward compatible to 1.63 and earlier. -// 1.64 and later define point sizes to be compatible with Windows. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxFONT_SIZE_COMPATIBILITY 0 - -// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before. -// If migrating between versions, your dialogs may seem to shrink. -// -// Default is 1 -// -// Recommended setting: 0 (the new calculations are more correct!) -#define wxDIALOG_UNIT_COMPATIBILITY 1 - -// ---------------------------------------------------------------------------- -// debugging settings -// ---------------------------------------------------------------------------- - -// Generic comment about debugging settings: they are very useful if you don't -// use any other memory leak detection tools such as Purify/BoundsChecker, but -// are probably redundant otherwise. Also, Visual C++ CRT has the same features -// as wxWindows memory debugging subsystem built in since version 5.0 and you -// may prefer to use it instead of built in memory debugging code because it is -// faster and more fool proof. -// -// Using VC++ CRT memory debugging is enabled by default in debug mode -// (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) -// and if __NO_VC_CRTDBG__ is not defined. - -// If 1, enables wxDebugContext, for writing error messages to file, etc. If -// __WXDEBUG__ is not defined, will still use normal memory operators. It's -// recommended to set this to 1, since you may well need to output an error log -// in a production version (or non-debugging beta). -// -// Default is 1. -// -// Recommended setting: 1 but see comment above -#ifndef __MWERKS__ -#define wxUSE_DEBUG_CONTEXT 0 -#else -#define wxUSE_DEBUG_CONTEXT 1 -#endif - -// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF* -// __WXDEBUG__ is also defined. -// -// WARNING: this code may not work with all architectures, especially if -// alignment is an issue. This switch is currently ignored for mingw / cygwin -// -// Default is 1 -// -// Recommended setting: 1 but see comment in the beginning of this section -#define wxUSE_MEMORY_TRACING 1 - -// In debug mode, cause new and delete to be redefined globally. -// If this causes problems (e.g. link errors which is a common problem -// especially if you use another library which also redefines the global new -// and delete), set this to 0. -// This switch is currently ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If -// this causes problems (e.g. link errors), set this to 0. You may need to set -// this to 0 if using templates (at least for VC++). This switch is currently -// ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// wxHandleFatalExceptions() may be used to catch the program faults at run -// time and, instead of terminating the program with a usual GPF message box, -// call the user-defined wxApp::OnFatalException() function. If you set -// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work. -// -// This setting is for Win32 only and can only be enabled if your compiler -// supports Win32 structured exception handling (currently only VC++ does) -// -// Default is 1 -// -// Recommended setting: 1 if your compiler supports it. -#ifdef _MSC_VER - #define wxUSE_ON_FATAL_EXCEPTION 1 -#else - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be -// defined as wchar_t, wxString will use Unicode internally. If you set this -// to 1, you must use wxT() macro for all literal strings in the program. -// -// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x -// doesn't support it and the programs compiled in Unicode mode will not run -// under 9x). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000) -#if TARGET_CARBON && ( !defined(__MWERKS__) || !defined(__MACH__) ) -#define wxUSE_UNICODE 1 -#else -#define wxUSE_UNICODE 0 -#endif -// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without -// compiling the program in Unicode mode. More precisely, it will be possible -// to construct wxString from a wide (Unicode) string and convert any wxString -// to Unicode. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_WCHAR_T 1 - -// ---------------------------------------------------------------------------- -// global features -// ---------------------------------------------------------------------------- - -// Compile library in exception-safe mode? If set to 1, the library will try to -// behave correctly in presence of exceptions (even though it still will not -// use the exceptions itself) and notify the user code about any unhandled -// exceptions. If set to 0, propagation of the exceptions through the library -// code will lead to undefined behaviour -- but the code itself will be -// slightly smaller and faster. -// -// Default is 1 -// -// Recommended setting: depends on whether you intend to use C++ exceptions -// in your own code (1 if you do, 0 if you don't) -#define wxUSE_EXCEPTIONS 1 - -// Support for message/error logging. This includes wxLogXXX() functions and -// wxLog and derived classes. Don't set this to 0 unless you really know what -// you are doing. -// -// Default is 1 -// -// Recommended setting: 1 (always) -#define wxUSE_LOG 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOG_DIALOG 1 - -// Support for command line parsing using wxCmdLineParser class. -// -// Default is 1 -// -// Recommended setting: 1 (can be set to 0 if you don't use the cmd line) -#define wxUSE_CMDLINE_PARSER 1 - -// Support for multithreaded applications: if 1, compile in thread classes -// (thread.h) and make the library a bit more thread safe. Although thread -// support is quite stable by now, you may still consider recompiling the -// library without it if you have no use for it - this will result in a -// somewhat smaller and faster operation. -// -// This is ignored under Win16, threads are only supported under Win32. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled (1), compiles wxWindows streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifndef __MWERKS__ -#define wxUSE_STD_IOSTREAM 0 -#else -#define wxUSE_STD_IOSTREAM 1 -#endif - -// Use serialization (requires utils/serialize) -#define wxUSE_SERIAL 0 - -// ---------------------------------------------------------------------------- -// non GUI features selection -// ---------------------------------------------------------------------------- - -// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit -// integer which is implemented in terms of native 64 bit integers if any or -// uses emulation otherwise. -// -// This class is required by wxDateTime and so you should enable it if you want -// to use wxDateTime. For most modern platforms, it will use the native 64 bit -// integers in which case (almost) all of its functions are inline and it -// almost does not take any space, so there should be no reason to switch it -// off. -// -// Recommended setting: 1 -#define wxUSE_LONGLONG 1 - -// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level -// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. -// -// Default is 1 -// -// Recommended setting: 1 (wxFile is highly recommended as it is required by -// i18n code, wxFileConfig and others) -#define wxUSE_FILE 1 -#define wxUSE_FFILE 1 - -// use wxTextBuffer class: required by wxTextFile -#define wxUSE_TEXTBUFFER 1 - -// use wxTextFile class: requires wxFile and wxTextBuffer, required by -// wxFileConfig -#define wxUSE_TEXTFILE 1 - -// i18n support: _() macro, wxLocale class. Requires wxTextFile. -#define wxUSE_INTL 1 - -// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which -// allow to manipulate dates, times and time intervals. wxDateTime replaces the -// old wxTime and wxDate classes which are still provided for backwards -// compatibility (and implemented in terms of wxDateTime). -// -// Note that this class is relatively new and is still officially in alpha -// stage because some features are not yet (fully) implemented. It is already -// quite useful though and should only be disabled if you are aiming at -// absolutely minimal version of the library. -// -// Requires: wxUSE_LONGLONG -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_DATETIME 1 - -// Set wxUSE_TIMER to 1 to compile wxTimer class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_TIMER 1 - -// Use wxStopWatch clas. -// -// Default is 1 -// -// Recommended setting: 1 (needed by wxSocket) -#define wxUSE_STOPWATCH 1 - -// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes -// which allow the application to store its settings in the persistent -// storage. Setting this to 1 will also enable on-demand creation of the -// global config object in wxApp. -// -// See also wxUSE_CONFIG_NATIVE below. -// -// Recommended setting: 1 -#define wxUSE_CONFIG 1 - -// If wxUSE_CONFIG is 1, you may choose to use either the native config -// classes under Windows (using .INI files under Win16 and the registry under -// Win32) or the portable text file format used by the config classes under -// Unix. -// -// Default is 1 to use native classes. Note that you may still use -// wxFileConfig even if you set this to 1 - just the config object created by -// default for the applications needs will be a wxRegConfig or wxIniConfig and -// not wxFileConfig. -// -// Recommended setting: 1 -#define wxUSE_CONFIG_NATIVE 1 - -// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows -// to connect/disconnect from the network and be notified whenever the dial-up -// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DIALUP_MANAGER 1 - -// Compile in classes for run-time DLL loading and function calling. -// Required by wxUSE_DIALUP_MANAGER. -// -// This setting is for Win32 only -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DYNLIB_CLASS 1 - -// experimental extension, use with caution. -#define wxUSE_DYNAMIC_LOADER 0 - -// Set to 1 to use socket classes -#define wxUSE_SOCKETS 1 - -// Set to 1 to enable virtual file systems (required by wxHTML) -#define wxUSE_FILESYSTEM 1 - -// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ZIP 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG and wxUSE_GZSTREAM. -#define wxUSE_ZLIB 1 - -// Set to 1 to compile wxGzipInput/OutputStream classes. Requires wxUSE_ZLIB. -#define wxUSE_GZSTREAM 1 - -// If enabled, the code written by Apple will be used to write, in a portable -// way, float on the disk. See extended.c for the license which is different -// from wxWindows one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#define wxUSE_JOYSTICK 1 - -// wxFontMapper class -#define wxUSE_FONTMAP 1 - -// wxMimeTypesManager class -#define wxUSE_MIMETYPE 1 - -// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP -// or wxURL you need to set this to 1. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_PROTOCOL 1 - -// The settings for the individual URL schemes -#define wxUSE_PROTOCOL_FILE 1 -#define wxUSE_PROTOCOL_FTP 1 -#define wxUSE_PROTOCOL_HTTP 1 - -// Define this to use wxURL class. -#define wxUSE_URL 1 - -// Support for regular expression matching via wxRegEx class: enable this to -// use POSIX regular expressions in your code. You need to compile regex -// library from src/regex to use it under Windows. -// -// Default is 0 -// -// Recommended setting: 1 if your compiler supports it, if it doesn't please -// contribute us a makefile for src/regex for it -#define wxUSE_REGEX 0 - -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 1 - -// wxWave class -#define wxUSE_WAVE 1 - -// XML parsing classes. Note that their API will change in the future, so -// using wxXmlDocument and wxXmlNode in your app is not recommended. -// -// Default is 1 -// -// Recommended setting: 1 (needed by XRC) -#define wxUSE_XML 1 - -// ---------------------------------------------------------------------------- -// Individual GUI controls -// ---------------------------------------------------------------------------- - -// You must set wxUSE_CONTROLS to 1 if you are using any controls at all -// (without it, wxControl class is not compiled) -// -// Default is 1 -// -// Recommended setting: 1 (don't change except for very special programs) -#define wxUSE_CONTROLS 1 - -// wxPopupWindow class is a top level transient window. It is currently used -// to implement wxTipWindow but doesn't work yet under Mac. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_POPUPWIN 0 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_TIPWINDOW 0 - -// Each of the settings below corresponds to one wxWindows control. They are -// all switched on by default but may be disabled if you are sure that your -// program (including any standard dialogs it can show!) doesn't need them and -// if you desperately want to save some space. If you use any of these you must -// set wxUSE_CONTROLS as well. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_BUTTON 1 // wxButton -#define wxUSE_BMPBUTTON 1 // wxBitmapButton -#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl -#define wxUSE_CHECKBOX 1 // wxCheckBox -#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_LISTBOX 1 // wxListBox -#define wxUSE_LISTCTRL 1 // wxListCtrl -#define wxUSE_RADIOBOX 1 // wxRadioBox -#define wxUSE_RADIOBTN 1 // wxRadioButton -#define wxUSE_SCROLLBAR 1 // wxScrollBar -#define wxUSE_SLIDER 1 // wxSlider -#define wxUSE_SPINBTN 1 // wxSpinButton -#define wxUSE_SPINCTRL 1 // wxSpinCtrl -#define wxUSE_STATBOX 1 // wxStaticBox -#define wxUSE_STATLINE 1 // wxStaticLine -#define wxUSE_STATTEXT 1 // wxStaticText -#define wxUSE_STATBMP 1 // wxStaticBitmap -#define wxUSE_TEXTCTRL 1 // wxTextCtrl -#define wxUSE_TOGGLEBTN 1 // requires wxButton -#define wxUSE_TREECTRL 1 // wxTreeCtrl - -// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR -// below either wxStatusBar95 or a generic wxStatusBar will be used. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_STATUSBAR 1 - -// Two status bar implementations are available under Win32: the generic one -// or the wrapper around native control. For native look and feel the native -// version should be used. -// -// Default is 1. -// -// Recommended setting: 1 (there is no advantage in using the generic one) -#define wxUSE_NATIVE_STATUSBAR 1 - -// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar -// classes at all. Otherwise, use the native toolbar class unless -// wxUSE_TOOLBAR_NATIVE is 0. -// -// Default is 1 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 1 - -// this setting is obsolete, value is ignored -#define wxUSE_BUTTONBAR 1 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used ot logically organise the data presented to the user instead of -// putting everything in one huge dialog. It replaces wxTabControl and related -// classes of wxWin 1.6x. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_NOTEBOOK 1 - -// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_LISTBOOK 1 - -// wxTabDialog is a generic version of wxNotebook but it is incompatible with -// the new class. It shouldn't be used in new code. -// -// Default is 0. -// -// Recommended setting: 0 (use wxNotebook) -#define wxUSE_TAB_DIALOG 0 - -// wxGrid class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 0 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Use wxCaret: a class implementing a "cursor" in a text control (called caret -// under Windows). -// -// Default is 1. -// -// Recommended setting: 1 (can be safely set to 0, not used by the library) -#define wxUSE_CARET 1 - -// Use wxDisplay class: it allows enumerating all displays on a system and -// working with them. -// -// Default is 0 because it isn't yet implemented on all platforms -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 0 - -// Miscellaneous geometry code: needed for Canvas library -#define wxUSE_GEOMETRY 1 - -// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and -// wxListCtrl. -// -// Default is 1. -// -// Recommended setting: 1 (set it to 0 if you don't use any of the controls -// enumerated above, then this class is mostly useless too) -#define wxUSE_IMAGLIST 1 - -// Use wxMenu, wxMenuBar, wxMenuItem. -// -// Default is 1. -// -// Recommended setting: 1 (can't be disabled under MSW) -#define wxUSE_MENUS 1 - -// Use wxSashWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SASH 1 - -// Use wxSplitterWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SPLITTER 1 - -// Use wxToolTip and wxWindow::Set/GetToolTip() methods. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLTIPS 1 - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 0 - -// ---------------------------------------------------------------------------- -// common dialogs -// ---------------------------------------------------------------------------- - -// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. -// file selector, printer dialog). Switching this off also switches off the -// printing architecture and interactive wxPrinterDC. -// -// Default is 1 -// -// Recommended setting: 1 (unless it really doesn't work) -#define wxUSE_COMMON_DIALOGS 1 - -// wxBusyInfo displays window with message when app is busy. Works in same way -// as wxBusyCursor -#define wxUSE_BUSYINFO 1 - -// Use single/multiple choice dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_CHOICEDLG 1 - -// Use colour picker dialog -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_COLOURDLG 1 - -// wxDirDlg class for getting a directory name from user -#define wxUSE_DIRDLG 1 - -// TODO: setting to choose the generic or native one - -// Use file open/save dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in many places in the library itself) -#define wxUSE_FILEDLG 1 - -// Use find/replace dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely set to 0) -#define wxUSE_FINDREPLDLG 1 - -// Use font picker dialog -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_FONTDLG 1 - -// Use wxMessageDialog and wxMessageBox. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_MSGDLG 1 - -// progress dialog class for lengthy operations -#define wxUSE_PROGRESSDLG 1 - -// support for startup tips (wxShowTip &c) -#define wxUSE_STARTUP_TIPS 1 - -// text entry dialog and wxGetTextFromUser function -#define wxUSE_TEXTDLG 1 - -// number entry dialog -#define wxUSE_NUMBERDLG 1 - -// splash screen class -#define wxUSE_SPLASH 1 - -// wizards -#define wxUSE_WIZARDDLG 1 - -// ---------------------------------------------------------------------------- -// Metafiles support -// ---------------------------------------------------------------------------- - -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. -// -// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. -// -// Recommended setting: default or 0 for everything for portable programs. -#define wxUSE_METAFILE 1 -#define wxUSE_ENH_METAFILE 1 -#define wxUSE_WIN_METAFILES_ALWAYS 0 - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -#define wxUSE_MDI_ARCHITECTURE 1 - -// Set to 0 to disable print/preview architecture code -#define wxUSE_PRINTING_ARCHITECTURE 1 - -// wxHTML sublibrary allows to display HTML in wxWindow programs and much, -// much more. -// -// Default is 1. -// -// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a -// smaller library. -#define wxUSE_HTML 1 - -// OpenGL canvas -#define wxUSE_GLCANVAS 0 - -// ---------------------------------------------------------------------------- -// Data transfer -// ---------------------------------------------------------------------------- - -// Use wxClipboard class for clipboard copy/paste. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CLIPBOARD 1 - -// Use wxDataObject and related classes. Needed for clipboard and OLE drag and -// drop -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DATAOBJ 1 - -// Use wxDropTarget and wxDropSource classes for drag and drop (this is -// different from "built in" drag and drop in wxTreeCtrl which is always -// available). Requires wxUSE_DATAOBJ. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DRAG_AND_DROP 1 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running (it is only available under Win32) -// -// Default is 1 -// -// Recommended setting: 1 (the class is tiny, disabling it won't save much -// space) -#define wxUSE_SNGLINST_CHECKER 1 - -#define wxUSE_DRAGIMAGE 1 - -#define wxUSE_IPC 0 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility -#define wxUSE_WXHTML_HELP 1 - // 0 for no MS HTML Help -#define wxUSE_RESOURCES 1 - // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CONSTRAINTS 1 - // 0 for no window layout constraint system - -#define wxUSE_SPLINES 1 - // 0 for no splines - -#define wxUSE_MOUSEWHEEL 1 - // Include mouse wheel support - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 0 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 0 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 0 - -// For backward compatibility reasons, this parameter now only controls the -// default scrolling method used by cursors. This default behavior can be -// overriden by setting the second param of wxDB::wxDbGetConnection() or -// wxDb() constructor to indicate whether the connection (and any wxDbTable()s -// that use the connection) should support forward only scrolling of cursors, -// or both forward and backward support for backward scrolling cursors is -// dependent on the data source as well as the ODBC driver being used. -#define wxODBC_FWD_ONLY_CURSORS 1 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatability with the -// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, -// as future development will be done only on the non-deprecated -// functions/classes/member variables/etc. -#define wxODBC_BACKWARD_COMPATABILITY 0 - -// ---------------------------------------------------------------------------- -// other compiler (mis)features -// ---------------------------------------------------------------------------- - -// Set this to 0 if your compiler can't cope with omission of prototype -// parameters. -// -// Default is 1. -// -// Recommended setting: 1 (should never need to set this to 0) -#define REMOVE_UNUSED_ARG 1 - -// VC++ 4.2 and above allows and but you can't mix -// them. Set to 1 for , 0 for -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifndef __MWERKS__ -#define wxUSE_IOSTREAMH 0 -#else -#define wxUSE_IOSTREAMH 1 -#endif - -// ---------------------------------------------------------------------------- -// image format support -// ---------------------------------------------------------------------------- - -// wxImage supports many different image formats which can be configured at -// compile-time. BMP is always supported, others are optional and can be safely -// disabled if you don't plan to use images in such format sometimes saving -// substantial amount of code in the final library. -// -// Some formats require an extra library which is included in wxWin sources -// which is mentioned if it is the case. - -// Set to 1 for wxImage support (recommended). -#define wxUSE_IMAGE 1 - -// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. -#define wxUSE_LIBPNG 1 - -// Set to 1 for JPEG format support (requires libjpeg) -#define wxUSE_LIBJPEG 1 - -// Set to 1 for TIFF format support (requires libtiff) -#define wxUSE_LIBTIFF 1 - -// Set to 1 for GIF format support -#define wxUSE_GIF 1 - -// Set to 1 for PNM format support -#define wxUSE_PNM 1 - -// Set to 1 for PCX format support -#define wxUSE_PCX 1 - -// Set to 1 for IFF format support -#define wxUSE_IFF 0 - -// Set to 1 for XPM format support -#define wxUSE_XPM 1 - -// Set to 1 for MS Icons and Cursors format support -#define wxUSE_ICO_CUR 1 - -// Set to 1 to compile in wxPalette class -#define wxUSE_PALETTE 1 - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -#endif - // _WX_SETUP_H_ diff --git a/include/wx/mac/classic/setup0.h b/include/wx/mac/classic/setup0.h deleted file mode 100644 index c0b2f7642e..0000000000 --- a/include/wx/mac/classic/setup0.h +++ /dev/null @@ -1,933 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: setup.h -// Purpose: Configuration for the library -// Author: Stefan Csomor -// Modified by: Stefan Csomor -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -// ---------------------------------------------------------------------------- -// global settings -// ---------------------------------------------------------------------------- - -// define this to 0 when building wxBase library - this can also be done from -// makefile/project file overriding the value here -#ifndef wxUSE_GUI - #define wxUSE_GUI 1 -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// compatibility settings -// ---------------------------------------------------------------------------- - -// This setting determines the compatibility with 2.0 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_2 0 - -// This setting determines the compatibility with 2.2 API: set it to 0 to -// flag all cases of using deprecated functions. -// -// Default is 1 but please try building your code with 0 as the default will -// change to 0 in the next version and the deprecated functions will disappear -// in the version after it completely. -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 1 - -// in wxMSW version 2.1.11 and earlier, wxIcon always derives from wxBitmap, -// but this is very dangerous because you can mistakenly pass an icon instead -// of a bitmap to a function taking "const wxBitmap&" - which will *not* work -// because an icon is not a valid bitmap -// -// Starting from 2.1.12, you have the choice under this backwards compatible -// behaviour (your code will still compile, but probably won't behave as -// expected!) and not deriving wxIcon class from wxBitmap, but providing a -// conversion ctor wxBitmap(const wxIcon&) instead. -// -// Recommended setting: 0 -#define wxICON_IS_BITMAP 0 - -// Define as 1 for font size to be backward compatible to 1.63 and earlier. -// 1.64 and later define point sizes to be compatible with Windows. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxFONT_SIZE_COMPATIBILITY 0 - -// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before. -// If migrating between versions, your dialogs may seem to shrink. -// -// Default is 1 -// -// Recommended setting: 0 (the new calculations are more correct!) -#define wxDIALOG_UNIT_COMPATIBILITY 1 - -// ---------------------------------------------------------------------------- -// debugging settings -// ---------------------------------------------------------------------------- - -// Generic comment about debugging settings: they are very useful if you don't -// use any other memory leak detection tools such as Purify/BoundsChecker, but -// are probably redundant otherwise. Also, Visual C++ CRT has the same features -// as wxWindows memory debugging subsystem built in since version 5.0 and you -// may prefer to use it instead of built in memory debugging code because it is -// faster and more fool proof. -// -// Using VC++ CRT memory debugging is enabled by default in debug mode -// (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) -// and if __NO_VC_CRTDBG__ is not defined. - -// If 1, enables wxDebugContext, for writing error messages to file, etc. If -// __WXDEBUG__ is not defined, will still use normal memory operators. It's -// recommended to set this to 1, since you may well need to output an error log -// in a production version (or non-debugging beta). -// -// Default is 1. -// -// Recommended setting: 1 but see comment above -#ifndef __MWERKS__ -#define wxUSE_DEBUG_CONTEXT 0 -#else -#define wxUSE_DEBUG_CONTEXT 1 -#endif - -// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF* -// __WXDEBUG__ is also defined. -// -// WARNING: this code may not work with all architectures, especially if -// alignment is an issue. This switch is currently ignored for mingw / cygwin -// -// Default is 1 -// -// Recommended setting: 1 but see comment in the beginning of this section -#define wxUSE_MEMORY_TRACING 1 - -// In debug mode, cause new and delete to be redefined globally. -// If this causes problems (e.g. link errors which is a common problem -// especially if you use another library which also redefines the global new -// and delete), set this to 0. -// This switch is currently ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If -// this causes problems (e.g. link errors), set this to 0. You may need to set -// this to 0 if using templates (at least for VC++). This switch is currently -// ignored for mingw / cygwin -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// wxHandleFatalExceptions() may be used to catch the program faults at run -// time and, instead of terminating the program with a usual GPF message box, -// call the user-defined wxApp::OnFatalException() function. If you set -// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work. -// -// This setting is for Win32 only and can only be enabled if your compiler -// supports Win32 structured exception handling (currently only VC++ does) -// -// Default is 1 -// -// Recommended setting: 1 if your compiler supports it. -#ifdef _MSC_VER - #define wxUSE_ON_FATAL_EXCEPTION 1 -#else - #define wxUSE_ON_FATAL_EXCEPTION 0 -#endif - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be -// defined as wchar_t, wxString will use Unicode internally. If you set this -// to 1, you must use wxT() macro for all literal strings in the program. -// -// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x -// doesn't support it and the programs compiled in Unicode mode will not run -// under 9x). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000) -#define wxUSE_UNICODE 0 - -// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without -// compiling the program in Unicode mode. More precisely, it will be possible -// to construct wxString from a wide (Unicode) string and convert any wxString -// to Unicode. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_WCHAR_T 1 - -// ---------------------------------------------------------------------------- -// global features -// ---------------------------------------------------------------------------- - -// Compile library in exception-safe mode? If set to 1, the library will try to -// behave correctly in presence of exceptions (even though it still will not -// use the exceptions itself) and notify the user code about any unhandled -// exceptions. If set to 0, propagation of the exceptions through the library -// code will lead to undefined behaviour -- but the code itself will be -// slightly smaller and faster. -// -// Default is 1 -// -// Recommended setting: depends on whether you intend to use C++ exceptions -// in your own code (1 if you do, 0 if you don't) -#define wxUSE_EXCEPTIONS 1 - -// Support for message/error logging. This includes wxLogXXX() functions and -// wxLog and derived classes. Don't set this to 0 unless you really know what -// you are doing. -// -// Default is 1 -// -// Recommended setting: 1 (always) -#define wxUSE_LOG 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 (always) -#define wxUSE_LOG_DIALOG 1 - -// Support for command line parsing using wxCmdLineParser class. -// -// Default is 1 -// -// Recommended setting: 1 (can be set to 0 if you don't use the cmd line) -#define wxUSE_CMDLINE_PARSER 1 - -// Support for multithreaded applications: if 1, compile in thread classes -// (thread.h) and make the library a bit more thread safe. Although thread -// support is quite stable by now, you may still consider recompiling the -// library without it if you have no use for it - this will result in a -// somewhat smaller and faster operation. -// -// This is ignored under Win16, threads are only supported under Win32. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled (1), compiles wxWindows streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifndef __MWERKS__ -#define wxUSE_STD_IOSTREAM 0 -#else -#define wxUSE_STD_IOSTREAM 1 -#endif - -// Use serialization (requires utils/serialize) -#define wxUSE_SERIAL 0 - -// ---------------------------------------------------------------------------- -// non GUI features selection -// ---------------------------------------------------------------------------- - -// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit -// integer which is implemented in terms of native 64 bit integers if any or -// uses emulation otherwise. -// -// This class is required by wxDateTime and so you should enable it if you want -// to use wxDateTime. For most modern platforms, it will use the native 64 bit -// integers in which case (almost) all of its functions are inline and it -// almost does not take any space, so there should be no reason to switch it -// off. -// -// Recommended setting: 1 -#define wxUSE_LONGLONG 1 - -// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level -// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. -// -// Default is 1 -// -// Recommended setting: 1 (wxFile is highly recommended as it is required by -// i18n code, wxFileConfig and others) -#define wxUSE_FILE 1 -#define wxUSE_FFILE 1 - -// use wxTextBuffer class: required by wxTextFile -#define wxUSE_TEXTBUFFER 1 - -// use wxTextFile class: requires wxFile and wxTextBuffer, required by -// wxFileConfig -#define wxUSE_TEXTFILE 1 - -// i18n support: _() macro, wxLocale class. Requires wxTextFile. -#define wxUSE_INTL 1 - -// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which -// allow to manipulate dates, times and time intervals. wxDateTime replaces the -// old wxTime and wxDate classes which are still provided for backwards -// compatibility (and implemented in terms of wxDateTime). -// -// Note that this class is relatively new and is still officially in alpha -// stage because some features are not yet (fully) implemented. It is already -// quite useful though and should only be disabled if you are aiming at -// absolutely minimal version of the library. -// -// Requires: wxUSE_LONGLONG -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_DATETIME 1 - -// Set wxUSE_TIMER to 1 to compile wxTimer class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_TIMER 1 - -// Use wxStopWatch clas. -// -// Default is 1 -// -// Recommended setting: 1 (needed by wxSocket) -#define wxUSE_STOPWATCH 1 - -// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes -// which allow the application to store its settings in the persistent -// storage. Setting this to 1 will also enable on-demand creation of the -// global config object in wxApp. -// -// See also wxUSE_CONFIG_NATIVE below. -// -// Recommended setting: 1 -#define wxUSE_CONFIG 1 - -// If wxUSE_CONFIG is 1, you may choose to use either the native config -// classes under Windows (using .INI files under Win16 and the registry under -// Win32) or the portable text file format used by the config classes under -// Unix. -// -// Default is 1 to use native classes. Note that you may still use -// wxFileConfig even if you set this to 1 - just the config object created by -// default for the applications needs will be a wxRegConfig or wxIniConfig and -// not wxFileConfig. -// -// Recommended setting: 1 -#define wxUSE_CONFIG_NATIVE 1 - -// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows -// to connect/disconnect from the network and be notified whenever the dial-up -// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DIALUP_MANAGER 1 - -// Compile in classes for run-time DLL loading and function calling. -// Required by wxUSE_DIALUP_MANAGER. -// -// This setting is for Win32 only -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DYNLIB_CLASS 1 - -// experimental extension, use with caution. -#define wxUSE_DYNAMIC_LOADER 0 - -// Set to 1 to use socket classes -#define wxUSE_SOCKETS 1 - -// Set to 1 to enable virtual file systems (required by wxHTML) -#define wxUSE_FILESYSTEM 1 - -// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ZIP 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG and wxUSE_GZSTREAM. -#define wxUSE_ZLIB 1 - -// Set to 1 to compile wxGzipInput/OutputStream classes. Requires wxUSE_ZLIB. -#define wxUSE_GZSTREAM 1 - -// If enabled, the code written by Apple will be used to write, in a portable -// way, float on the disk. See extended.c for the license which is different -// from wxWindows one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#define wxUSE_JOYSTICK 1 - -// wxFontMapper class -#define wxUSE_FONTMAP 1 - -// wxMimeTypesManager class -#define wxUSE_MIMETYPE 1 - -// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP -// or wxURL you need to set this to 1. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_PROTOCOL 1 - -// The settings for the individual URL schemes -#define wxUSE_PROTOCOL_FILE 1 -#define wxUSE_PROTOCOL_FTP 1 -#define wxUSE_PROTOCOL_HTTP 1 - -// Define this to use wxURL class. -#define wxUSE_URL 1 - -// Support for regular expression matching via wxRegEx class: enable this to -// use POSIX regular expressions in your code. You need to compile regex -// library from src/regex to use it under Windows. -// -// Default is 0 -// -// Recommended setting: 1 if your compiler supports it, if it doesn't please -// contribute us a makefile for src/regex for it -#define wxUSE_REGEX 1 - -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 1 - -// wxSound class -#define wxUSE_SOUND 1 - -// XML parsing classes. Note that their API will change in the future, so -// using wxXmlDocument and wxXmlNode in your app is not recommended. -// -// Default is 1 -// -// Recommended setting: 1 (needed by XRC) -#define wxUSE_XML 1 - -// ---------------------------------------------------------------------------- -// Individual GUI controls -// ---------------------------------------------------------------------------- - -// You must set wxUSE_CONTROLS to 1 if you are using any controls at all -// (without it, wxControl class is not compiled) -// -// Default is 1 -// -// Recommended setting: 1 (don't change except for very special programs) -#define wxUSE_CONTROLS 1 - -// wxPopupWindow class is a top level transient window. It is currently used -// to implement wxTipWindow but doesn't work yet under Mac. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_POPUPWIN 0 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_TIPWINDOW 0 - -// Each of the settings below corresponds to one wxWindows control. They are -// all switched on by default but may be disabled if you are sure that your -// program (including any standard dialogs it can show!) doesn't need them and -// if you desperately want to save some space. If you use any of these you must -// set wxUSE_CONTROLS as well. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_BUTTON 1 // wxButton -#define wxUSE_BMPBUTTON 1 // wxBitmapButton -#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl -#define wxUSE_CHECKBOX 1 // wxCheckBox -#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_LISTBOX 1 // wxListBox -#define wxUSE_LISTCTRL 1 // wxListCtrl -#define wxUSE_RADIOBOX 1 // wxRadioBox -#define wxUSE_RADIOBTN 1 // wxRadioButton -#define wxUSE_SCROLLBAR 1 // wxScrollBar -#define wxUSE_SLIDER 1 // wxSlider -#define wxUSE_SPINBTN 1 // wxSpinButton -#define wxUSE_SPINCTRL 1 // wxSpinCtrl -#define wxUSE_STATBOX 1 // wxStaticBox -#define wxUSE_STATLINE 1 // wxStaticLine -#define wxUSE_STATTEXT 1 // wxStaticText -#define wxUSE_STATBMP 1 // wxStaticBitmap -#define wxUSE_TEXTCTRL 1 // wxTextCtrl -#define wxUSE_TOGGLEBTN 0 // requires wxButton -#define wxUSE_TREECTRL 1 // wxTreeCtrl - -// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR -// below either wxStatusBar95 or a generic wxStatusBar will be used. -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_STATUSBAR 1 - -// Two status bar implementations are available under Win32: the generic one -// or the wrapper around native control. For native look and feel the native -// version should be used. -// -// Default is 1. -// -// Recommended setting: 1 (there is no advantage in using the generic one) -#define wxUSE_NATIVE_STATUSBAR 1 - -// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar -// classes at all. Otherwise, use the native toolbar class unless -// wxUSE_TOOLBAR_NATIVE is 0. -// -// Default is 1 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 1 - -// this setting is obsolete, value is ignored -#define wxUSE_BUTTONBAR 1 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used ot logically organise the data presented to the user instead of -// putting everything in one huge dialog. It replaces wxTabControl and related -// classes of wxWin 1.6x. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_NOTEBOOK 1 - -// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_LISTBOOK 1 - -// wxTabDialog is a generic version of wxNotebook but it is incompatible with -// the new class. It shouldn't be used in new code. -// -// Default is 0. -// -// Recommended setting: 0 (use wxNotebook) -#define wxUSE_TAB_DIALOG 0 - -// wxGrid class -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 0 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Use wxCaret: a class implementing a "cursor" in a text control (called caret -// under Windows). -// -// Default is 1. -// -// Recommended setting: 1 (can be safely set to 0, not used by the library) -#define wxUSE_CARET 1 - -// Use wxDisplay class: it allows enumerating all displays on a system and -// working with them. -// -// Default is 0 because it isn't yet implemented on all platforms -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 0 - -// Miscellaneous geometry code: needed for Canvas library -#define wxUSE_GEOMETRY 1 - -// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and -// wxListCtrl. -// -// Default is 1. -// -// Recommended setting: 1 (set it to 0 if you don't use any of the controls -// enumerated above, then this class is mostly useless too) -#define wxUSE_IMAGLIST 1 - -// Use wxMenu, wxMenuBar, wxMenuItem. -// -// Default is 1. -// -// Recommended setting: 1 (can't be disabled under MSW) -#define wxUSE_MENUS 1 - -// Use wxSashWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SASH 1 - -// Use wxSplitterWindow class. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_SPLITTER 1 - -// Use wxToolTip and wxWindow::Set/GetToolTip() methods. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLTIPS 1 - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 0 - -// ---------------------------------------------------------------------------- -// common dialogs -// ---------------------------------------------------------------------------- - -// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. -// file selector, printer dialog). Switching this off also switches off the -// printing architecture and interactive wxPrinterDC. -// -// Default is 1 -// -// Recommended setting: 1 (unless it really doesn't work) -#define wxUSE_COMMON_DIALOGS 1 - -// wxBusyInfo displays window with message when app is busy. Works in same way -// as wxBusyCursor -#define wxUSE_BUSYINFO 1 - -// Use single/multiple choice dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_CHOICEDLG 1 - -// Use colour picker dialog -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_COLOURDLG 1 - -// wxDirDlg class for getting a directory name from user -#define wxUSE_DIRDLG 1 - -// TODO: setting to choose the generic or native one - -// Use file open/save dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (used in many places in the library itself) -#define wxUSE_FILEDLG 1 - -// Use find/replace dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely set to 0) -#define wxUSE_FINDREPLDLG 1 - -// Use font picker dialog -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_FONTDLG 1 - -// Use wxMessageDialog and wxMessageBox. -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_MSGDLG 1 - -// progress dialog class for lengthy operations -#define wxUSE_PROGRESSDLG 1 - -// support for startup tips (wxShowTip &c) -#define wxUSE_STARTUP_TIPS 1 - -// text entry dialog and wxGetTextFromUser function -#define wxUSE_TEXTDLG 1 - -// number entry dialog -#define wxUSE_NUMBERDLG 1 - -// splash screen class -#define wxUSE_SPLASH 1 - -// wizards -#define wxUSE_WIZARDDLG 1 - -// ---------------------------------------------------------------------------- -// Metafiles support -// ---------------------------------------------------------------------------- - -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. -// -// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. -// -// Recommended setting: default or 0 for everything for portable programs. -#define wxUSE_METAFILE 1 -#define wxUSE_ENH_METAFILE 1 -#define wxUSE_WIN_METAFILES_ALWAYS 0 - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -#define wxUSE_MDI_ARCHITECTURE 1 - -// Set to 0 to disable print/preview architecture code -#define wxUSE_PRINTING_ARCHITECTURE 1 - -// wxHTML sublibrary allows to display HTML in wxWindow programs and much, -// much more. -// -// Default is 1. -// -// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a -// smaller library. -#define wxUSE_HTML 1 - -// OpenGL canvas -#define wxUSE_GLCANVAS 0 - -// ---------------------------------------------------------------------------- -// Data transfer -// ---------------------------------------------------------------------------- - -// Use wxClipboard class for clipboard copy/paste. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CLIPBOARD 1 - -// Use wxDataObject and related classes. Needed for clipboard and OLE drag and -// drop -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DATAOBJ 1 - -// Use wxDropTarget and wxDropSource classes for drag and drop (this is -// different from "built in" drag and drop in wxTreeCtrl which is always -// available). Requires wxUSE_DATAOBJ. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DRAG_AND_DROP 1 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running (it is only available under Win32) -// -// Default is 1 -// -// Recommended setting: 1 (the class is tiny, disabling it won't save much -// space) -#define wxUSE_SNGLINST_CHECKER 1 - -#define wxUSE_DRAGIMAGE 1 - -#define wxUSE_IPC 0 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility -#define wxUSE_WXHTML_HELP 1 - // 0 for no MS HTML Help -#define wxUSE_RESOURCES 1 - // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CONSTRAINTS 1 - // 0 for no window layout constraint system - -#define wxUSE_SPLINES 1 - // 0 for no splines - -#define wxUSE_MOUSEWHEEL 1 - // Include mouse wheel support - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 0 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 0 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 0 - -// For backward compatibility reasons, this parameter now only controls the -// default scrolling method used by cursors. This default behavior can be -// overriden by setting the second param of wxDB::wxDbGetConnection() or -// wxDb() constructor to indicate whether the connection (and any wxDbTable()s -// that use the connection) should support forward only scrolling of cursors, -// or both forward and backward support for backward scrolling cursors is -// dependent on the data source as well as the ODBC driver being used. -#define wxODBC_FWD_ONLY_CURSORS 1 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatability with the -// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, -// as future development will be done only on the non-deprecated -// functions/classes/member variables/etc. -#define wxODBC_BACKWARD_COMPATABILITY 0 - -// ---------------------------------------------------------------------------- -// other compiler (mis)features -// ---------------------------------------------------------------------------- - -// Set this to 0 if your compiler can't cope with omission of prototype -// parameters. -// -// Default is 1. -// -// Recommended setting: 1 (should never need to set this to 0) -#define REMOVE_UNUSED_ARG 1 - -// VC++ 4.2 and above allows and but you can't mix -// them. Set to 1 for , 0 for -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifndef __MWERKS__ -#define wxUSE_IOSTREAMH 0 -#else -#define wxUSE_IOSTREAMH 1 -#endif - -// ---------------------------------------------------------------------------- -// image format support -// ---------------------------------------------------------------------------- - -// wxImage supports many different image formats which can be configured at -// compile-time. BMP is always supported, others are optional and can be safely -// disabled if you don't plan to use images in such format sometimes saving -// substantial amount of code in the final library. -// -// Some formats require an extra library which is included in wxWin sources -// which is mentioned if it is the case. - -// Set to 1 for wxImage support (recommended). -#define wxUSE_IMAGE 1 - -// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. -#define wxUSE_LIBPNG 1 - -// Set to 1 for JPEG format support (requires libjpeg) -#define wxUSE_LIBJPEG 1 - -// Set to 1 for TIFF format support (requires libtiff) -#define wxUSE_LIBTIFF 1 - -// Set to 1 for GIF format support -#define wxUSE_GIF 1 - -// Set to 1 for PNM format support -#define wxUSE_PNM 1 - -// Set to 1 for PCX format support -#define wxUSE_PCX 1 - -// Set to 1 for IFF format support -#define wxUSE_IFF 0 - -// Set to 1 for XPM format support -#define wxUSE_XPM 1 - -// Set to 1 for MS Icons and Cursors format support -#define wxUSE_ICO_CUR 1 - -// Set to 1 to compile in wxPalette class -#define wxUSE_PALETTE 1 - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -#endif - // _WX_SETUP_H_ diff --git a/include/wx/mac/classic/slider.h b/include/wx/mac/classic/slider.h deleted file mode 100644 index 9599a60c10..0000000000 --- a/include/wx/mac/classic/slider.h +++ /dev/null @@ -1,110 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.h -// Purpose: wxSlider class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SLIDER_H_ -#define _WX_SLIDER_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "slider.h" -#endif - -#include "wx/control.h" -#include "wx/slider.h" -#include "wx/stattext.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr; - -// Slider -class WXDLLEXPORT wxSlider: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxSlider) - -public: - wxSlider(); - - inline wxSlider(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSliderNameStr) - { - Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); - } - - ~wxSlider(); - - bool Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSliderNameStr); - - virtual int GetValue() const ; - virtual void SetValue(int); - - void SetRange(int minValue, int maxValue); - - inline int GetMin() const { return m_rangeMin; } - inline int GetMax() const { return m_rangeMax; } - - void SetMin(int minValue) { SetRange(minValue, m_rangeMax); } - void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); } - - // For trackbars only - void SetTickFreq(int n, int pos); - inline int GetTickFreq() const { return m_tickFreq; } - void SetPageSize(int pageSize); - int GetPageSize() const ; - void ClearSel() ; - void ClearTicks() ; - void SetLineSize(int lineSize); - int GetLineSize() const ; - int GetSelEnd() const ; - int GetSelStart() const ; - void SetSelection(int minPos, int maxPos); - void SetThumbLength(int len) ; - int GetThumbLength() const ; - void SetTick(int tickPos) ; - - - // set min/max size of the slider - virtual void SetSizeHints( int minW, int minH, - int maxW = -1, int maxH = -1, - int incW = -1, int incH = -1 ); - - protected: - virtual wxSize DoGetBestSize() const; - virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags); - virtual void DoMoveWindow(int x, int y, int w, int h); - - void Command(wxCommandEvent& event); - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual void MacUpdateDimensions() ; - - wxStaticText* m_macMinimumStatic ; - wxStaticText* m_macMaximumStatic ; - wxStaticText* m_macValueStatic ; - - int m_rangeMin; - int m_rangeMax; - int m_pageSize; - int m_lineSize; - int m_tickFreq; -private : -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_SLIDER_H_ diff --git a/include/wx/mac/classic/sound.h b/include/wx/mac/classic/sound.h deleted file mode 100644 index 18a84d101b..0000000000 --- a/include/wx/mac/classic/sound.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sound.h -// Purpose: wxSound class (loads and plays short Windows .wav files). -// Optional on non-Windows platforms. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOUND_H_ -#define _WX_SOUND_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "sound.h" -#endif - -#if wxUSE_SOUND - -#include "wx/object.h" - -class WXDLLEXPORT wxSound : public wxSoundBase -{ -public: - wxSound(); - wxSound(const wxString& fileName, bool isResource = FALSE); - wxSound(int size, const wxByte* data); - ~wxSound(); - -public: - bool Create(const wxString& fileName, bool isResource = FALSE); - bool IsOk() const { return !m_sndname.IsEmpty(); } - -protected: - // prevent collision with some BSD definitions of macro Free() - bool FreeData(); - - bool DoPlay(unsigned flags) const; - -private: - void* m_sndChan; - - wxString m_sndname; - void* m_hSnd; - int m_waveLength; - bool m_isResource; -}; - -#endif -#endif - // _WX_SOUND_H_ diff --git a/include/wx/mac/classic/spinbutt.h b/include/wx/mac/classic/spinbutt.h deleted file mode 100644 index 3b33a8d5ad..0000000000 --- a/include/wx/mac/classic/spinbutt.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.h -// Purpose: wxSpinButton class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPINBUTT_H_ -#define _WX_SPINBUTT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "spinbutt.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" - -/* - The wxSpinButton is like a small scrollbar than is often placed next - to a text control. - - wxSP_HORIZONTAL: horizontal spin button - wxSP_VERTICAL: vertical spin button (the default) - wxSP_ARROW_KEYS: arrow keys increment/decrement value - wxSP_WRAP: value wraps at either end - */ - -class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase -{ -public: - // construction - wxSpinButton(); - - wxSpinButton(wxWindow *parent, - wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxT("wxSpinButton")) - { - Create(parent, id, pos, size, style, name); - } - - virtual ~wxSpinButton(); - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxT("wxSpinButton")); - - - // accessors - virtual int GetMin() const; - virtual int GetMax() const; - virtual int GetValue() const; - virtual void SetValue(int val); - virtual void SetRange(int minVal, int maxVal); - - // implementation - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - -protected: - void MacHandleValueChanged( int inc ) ; - virtual wxSize DoGetBestSize() const; - int m_value ; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinButton) -}; - -#endif - // _WX_SPINBUTT_H_ diff --git a/include/wx/mac/classic/spinctrl.h b/include/wx/mac/classic/spinctrl.h deleted file mode 100755 index 9ffd5d1ee2..0000000000 --- a/include/wx/mac/classic/spinctrl.h +++ /dev/null @@ -1,188 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/spinctlg.h -// Purpose: generic wxSpinCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.10.99 -// RCS-ID: $Id$ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MAC_SPINCTRL_H_ -#define _WX_MAC_SPINCTRL_H_ - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if -// wxSpinButton is available, this is what we do - but if it isn't, we still -// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but -// the different interface. This allows to write programs using wxSpinCtrl -// without tons of #ifdefs. -// ---------------------------------------------------------------------------- - -#if wxUSE_SPINBTN - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "spinctlg.h" -#endif - -class WXDLLEXPORT wxSpinButton; -class WXDLLEXPORT wxTextCtrl; - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSpinCtrl : public wxControl -{ -public: - wxSpinCtrl() { Init(); } - - wxSpinCtrl(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - Init(); - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); - - // wxTextCtrl-like method - void SetSelection(long from, long to); - - virtual ~wxSpinCtrl(); - - // operations - void SetValue(int val); - void SetValue(const wxString& text); - void SetRange(int min, int max); - - // accessors - int GetValue() const; - int GetMin() const; - int GetMax() const; - - // implementation from now on - - // forward these functions to all subcontrols - virtual bool Enable(bool enable = TRUE); - virtual bool Show(bool show = TRUE); - - // get the subcontrols - wxTextCtrl *GetText() const { return m_text; } - wxSpinButton *GetSpinButton() const { return m_btn; } - - // set the value of the text (only) - void SetTextValue(int val); - - // put the numeric value of the string in the text ctrl into val and return - // TRUE or return FALSE if the text ctrl doesn't contain a number or if the - // number is out of range - bool GetTextValue(int *val) const; - -protected: - // override the base class virtuals involved into geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - - // common part of all ctors - void Init(); - -private: - // the subcontrols - wxTextCtrl *m_text; - wxSpinButton *m_btn; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinCtrl) -}; - -#else // !wxUSE_SPINBTN - -// ---------------------------------------------------------------------------- -// wxSpinCtrl is just a text control -// ---------------------------------------------------------------------------- - -#include "wx/textctrl.h" - -class WXDLLEXPORT wxSpinCtrl : public wxTextCtrl -{ -public: - wxSpinCtrl() { Init(); } - - wxSpinCtrl(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = -1, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_ARROW_KEYS, - int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) - { - SetRange(min, max); - - bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style, - wxDefaultValidator, name); - SetValue(initial); - - return ok; - } - - // accessors - int GetValue(int WXUNUSED(dummy) = 1) const - { - int n; - if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%d"), &n) != 1) ) - n = INT_MIN; - - return n; - } - - int GetMin() const { return m_min; } - int GetMax() const { return m_max; } - - // operations - void SetValue(const wxString& value) { wxTextCtrl::SetValue(value); } - void SetValue(int val) { wxString s; s << val; wxTextCtrl::SetValue(s); } - void SetRange(int min, int max) { m_min = min; m_max = max; } - -protected: - // initialize m_min/max with the default values - void Init() { SetRange(0, 100); } - - int m_min; - int m_max; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinCtrl) -}; - -#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN - -#endif // _WX_MAC_SPINCTRL_H_ - diff --git a/include/wx/mac/classic/statbmp.h b/include/wx/mac/classic/statbmp.h deleted file mode 100644 index 8a16726c57..0000000000 --- a/include/wx/mac/classic/statbmp.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.h -// Purpose: wxStaticBitmap class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBMP_H_ -#define _WX_STATBMP_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbmp.h" -#endif - -#include "wx/icon.h" - -class WXDLLEXPORT wxStaticBitmap: public wxStaticBitmapBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticBitmap) - public: - inline wxStaticBitmap() { } - - inline wxStaticBitmap(wxWindow *parent, wxWindowID id, - const wxBitmap& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxBitmap& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr); - - virtual void SetBitmap(const wxBitmap& bitmap); - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - void OnPaint( wxPaintEvent &event ) ; - - wxBitmap GetBitmap() const { return m_bitmap; } - wxIcon GetIcon() const - { - // icons and bitmaps are really the same thing in wxMac - return (const wxIcon &)m_bitmap; - } - void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; } - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return FALSE; } - virtual wxSize DoGetBestSize() const ; - - protected: - wxBitmap m_bitmap; - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBMP_H_ diff --git a/include/wx/mac/classic/statbox.h b/include/wx/mac/classic/statbox.h deleted file mode 100644 index 9f73a539ed..0000000000 --- a/include/wx/mac/classic/statbox.h +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.h -// Purpose: wxStaticBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBOX_H_ -#define _WX_STATBOX_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbox.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr; - -// Group box -class WXDLLEXPORT wxStaticBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxStaticBox) - - public: - inline wxStaticBox() {} - inline wxStaticBox(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBoxNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBoxNameStr); - - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - - -protected: - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBOX_H_ diff --git a/include/wx/mac/classic/statline.h b/include/wx/mac/classic/statline.h deleted file mode 100644 index 911e9f535c..0000000000 --- a/include/wx/mac/classic/statline.h +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/statline.h -// Purpose: a generic wxStaticLine class used for mac before adaptation -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_STATLINE_H_ -#define _WX_GENERIC_STATLINE_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "statline.h" -#endif - -class wxStaticBox; - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticLine : public wxStaticLineBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticLine) - -public: - // constructors and pseudo-constructors - wxStaticLine() : m_statbox(NULL) { } - - wxStaticLine( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ) - : m_statbox(NULL) - { - Create(parent, id, pos, size, style, name); - } - - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticTextNameStr ); - - // it's necessary to override this wxWindow function because we - // will want to return the main widget for m_statbox - // - WXWidget GetMainWidget() const; - -protected: - // we implement the static line using a static box - wxStaticBox *m_statbox; -}; - -#endif // _WX_GENERIC_STATLINE_H_ - diff --git a/include/wx/mac/classic/stattext.h b/include/wx/mac/classic/stattext.h deleted file mode 100644 index 17ecf98ad0..0000000000 --- a/include/wx/mac/classic/stattext.h +++ /dev/null @@ -1,62 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.h -// Purpose: wxStaticText class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATTEXT_H_ -#define _WX_STATTEXT_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "stattext.h" -#endif - -class WXDLLEXPORT wxStaticText: public wxStaticTextBase -{ - DECLARE_DYNAMIC_CLASS(wxStaticText) - public: - inline wxStaticText() : m_label() { } - - inline wxStaticText(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticTextNameStr) - { - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticTextNameStr); - - // accessors - void SetLabel( const wxString &str ) ; - bool SetFont( const wxFont &font ); - - // operations - virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; - virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; - // events - void DrawParagraph(wxDC &dc, wxString paragraph, int &y); - void OnPaint( wxPaintEvent &event ) ; - void OnDraw( wxDC &dc ) ; - virtual wxSize DoGetBestSize() const ; - virtual bool AcceptsFocus() const { return FALSE; } - private : - wxString m_label ; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATTEXT_H_ diff --git a/include/wx/mac/classic/statusbr.h b/include/wx/mac/classic/statusbr.h deleted file mode 100644 index 959c4e618d..0000000000 --- a/include/wx/mac/classic/statusbr.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: statusbr.h -// Purpose: native implementation of wxStatusBar. Optional; can use generic -// version instead. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBAR_H_ -#define _WX_STATBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "statbrma.h" -#endif - -class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric -{ - DECLARE_DYNAMIC_CLASS(wxStatusBarMac); - - wxStatusBarMac(); - wxStatusBarMac(wxWindow *parent, wxWindowID id, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Create(parent, id, style, name); - } - - ~wxStatusBarMac(); - - bool Create(wxWindow *parent, wxWindowID id, - long style , - const wxString& name = wxPanelNameStr) ; - - virtual void DrawFieldText(wxDC& dc, int i); - virtual void DrawField(wxDC& dc, int i); - virtual void SetStatusText(const wxString& text, int number = 0) ; - //////////////////////////////////////////////////////////////////////// - // Implementation - - virtual void MacSuperEnabled( bool enable ) ; - - void OnPaint(wxPaintEvent& event); -protected: - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBAR_H_ diff --git a/include/wx/mac/classic/tabctrl.h b/include/wx/mac/classic/tabctrl.h deleted file mode 100644 index 7a6e14300a..0000000000 --- a/include/wx/mac/classic/tabctrl.h +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.h -// Purpose: wxTabCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TABCTRL_H_ -#define _WX_TABCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "tabctrl.h" -#endif - -class wxImageList; - -/* - * Flags returned by HitTest - */ - -#define wxTAB_HITTEST_NOWHERE 1 -#define wxTAB_HITTEST_ONICON 2 -#define wxTAB_HITTEST_ONLABEL 4 -#define wxTAB_HITTEST_ONITEM 6 - -class WXDLLEXPORT wxTabCtrl: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxTabCtrl) - public: - /* - * Public interface - */ - - wxTabCtrl(); - - inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxT("tabCtrl")) - { - Create(parent, id, pos, size, style, name); - } - ~wxTabCtrl(); - -// Accessors - - // Get the selection - int GetSelection() const; - - // Get the tab with the current keyboard focus - int GetCurFocus() const; - - // Get the associated image list - wxImageList* GetImageList() const; - - // Get the number of items - int GetItemCount() const; - - // Get the rect corresponding to the tab - bool GetItemRect(int item, wxRect& rect) const; - - // Get the number of rows - int GetRowCount() const; - - // Get the item text - wxString GetItemText(int item) const ; - - // Get the item image - int GetItemImage(int item) const; - - // Get the item data - void* GetItemData(int item) const; - - // Set the selection - int SetSelection(int item); - - // Set the image list - void SetImageList(wxImageList* imageList); - - // Set the text for an item - bool SetItemText(int item, const wxString& text); - - // Set the image for an item - bool SetItemImage(int item, int image); - - // Set the data for an item - bool SetItemData(int item, void* data); - - // Set the size for a fixed-width tab control - void SetItemSize(const wxSize& size); - - // Set the padding between tabs - void SetPadding(const wxSize& padding); - -// Operations - - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxT("tabCtrl")); - - // Delete all items - bool DeleteAllItems(); - - // Delete an item - bool DeleteItem(int item); - - // Hit test - int HitTest(const wxPoint& pt, long& flags); - - // Insert an item - bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL); - - void Command(wxCommandEvent& event); - -protected: - wxImageList* m_imageList; - -DECLARE_EVENT_TABLE() -}; - -class WXDLLEXPORT wxTabEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxTabEvent) - - public: - wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0); -}; - -typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&); - -#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \ - id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL }, -#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \ - id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL }, - -#endif - // _WX_TABCTRL_H_ diff --git a/include/wx/mac/classic/taskbarosx.h b/include/wx/mac/classic/taskbarosx.h deleted file mode 100644 index 9c921c063d..0000000000 --- a/include/wx/mac/classic/taskbarosx.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: wx/mac/taskbarosx.h -// Purpose: Defines wxTaskBarIcon class for OSX -// Author: Ryan Norton -// Modified by: -// Created: 04/04/2003 -// RCS-ID: $Id$ -// Copyright: (c) Ryan Norton, 2003 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -#ifndef _TASKBAR_H_ -#define _TASKBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "taskbarosx.h" -#endif - -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxMenu; - -class WXDLLEXPORT wxTaskBarIcon : public wxTaskBarIconBase -{ -public: - //type of taskbar item to create (currently only DOCK is implemented) - enum wxTaskBarIconType - { - DOCK, - STATUSITEM, - MENUEXTRA - }; - - wxTaskBarIcon(const wxTaskBarIconType& nType = DOCK); - virtual ~wxTaskBarIcon(); - - // Operations: - bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); - bool RemoveIcon(); - bool PopupMenu(wxMenu *menu); - -protected: - wxTaskBarIconType m_nType; - - DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) -}; - -#endif - // _TASKBAR_H_ diff --git a/include/wx/mac/classic/textctrl.h b/include/wx/mac/classic/textctrl.h deleted file mode 100644 index df3a964339..0000000000 --- a/include/wx/mac/classic/textctrl.h +++ /dev/null @@ -1,184 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.h -// Purpose: wxTextCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTCTRL_H_ -#define _WX_TEXTCTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "textctrl.h" -#endif - -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr; - -// Single-line text item -class WXDLLEXPORT wxTextCtrl: public wxTextCtrlBase -{ - DECLARE_DYNAMIC_CLASS(wxTextCtrl) - -public: - // creation - // -------- - wxTextCtrl() { Init(); } - ~wxTextCtrl(); - wxTextCtrl(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTextCtrlNameStr) - { - Init(); - - Create(parent, id, value, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTextCtrlNameStr); - - // accessors - // --------- - virtual wxString GetValue() const ; - virtual void SetValue(const wxString& value); - - virtual int GetLineLength(long lineNo) const; - virtual wxString GetLineText(long lineNo) const; - virtual int GetNumberOfLines() const; - - virtual bool IsModified() const; - virtual bool IsEditable() const; - - // If the return values from and to are the same, there is no selection. - virtual void GetSelection(long* from, long* to) const; - - // operations - // ---------- - - // editing - - virtual void Clear(); - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - - // load the controls contents from the file - virtual bool LoadFile(const wxString& file); - - // sets/clears the dirty flag - virtual void MarkDirty(); - virtual void DiscardEdits(); - - // set the max number of characters which may be entered in a single line - // text control - virtual void SetMaxLength(unsigned long len) ; - - // text control under some platforms supports the text styles: these - // methods allow to apply the given text style to the given selection or to - // set/get the style which will be used for all appended text - virtual bool SetStyle(long start, long end, const wxTextAttr& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - - // writing text inserts it at the current position, appending always - // inserts it at the end - virtual void WriteText(const wxString& text); - virtual void AppendText(const wxString& text); - - // translate between the position (which is just an index in the text ctrl - // considering all its contents as a single strings) and (x, y) coordinates - // which represent column and line. - virtual long XYToPosition(long x, long y) const; - virtual bool PositionToXY(long pos, long *x, long *y) const; - - virtual void ShowPosition(long pos); - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - - virtual bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - - // Undo/redo - virtual void Undo(); - virtual void Redo(); - - virtual bool CanUndo() const; - virtual bool CanRedo() const; - - // Insertion point - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const; - virtual long GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - - // Implementation from now on - // -------------------------- - - // Implementation - // -------------- - virtual void Command(wxCommandEvent& event); - - virtual bool AcceptsFocus() const; - - // callbacks - void OnDropFiles(wxDropFilesEvent& event); - void OnChar(wxKeyEvent& event); // Process 'enter' if required - - void OnCut(wxCommandEvent& event); - void OnCopy(wxCommandEvent& event); - void OnPaste(wxCommandEvent& event); - void OnUndo(wxCommandEvent& event); - void OnRedo(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - - virtual bool MacCanFocus() const { return true ; } - virtual bool MacSetupCursor( const wxPoint& pt ) ; - - virtual void MacSuperShown( bool show ) ; - virtual bool Show(bool show = TRUE) ; - -protected: - // common part of all ctors - void Init(); - - virtual wxSize DoGetBestSize() const; - - bool m_editable ; - - // flag is set to true when the user edits the controls contents - bool m_dirty; - - // one of the following objects is used for representation, the other one is NULL - void* m_macTE ; - void* m_macTXN ; - void* m_macTXNvars ; - bool m_macUsesTXN ; - unsigned long m_maxLength ; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_TEXTCTRL_H_ diff --git a/include/wx/mac/classic/tglbtn.h b/include/wx/mac/classic/tglbtn.h deleted file mode 100644 index 5ab29aa84c..0000000000 --- a/include/wx/mac/classic/tglbtn.h +++ /dev/null @@ -1,59 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/tglbtn.h -// Purpose: Declaration of the wxToggleButton class, which implements a -// toggle button under wxMac. -// Author: Stefan Csomor -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id$ -// Copyright: (c) 2004 Stefan Csomor -// License: wxWindows License -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOGGLEBUTTON_H_ -#define _WX_TOGGLEBUTTON_H_ - -WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr; - -// Checkbox item (single checkbox) -class WXDLLEXPORT wxToggleButton : public wxControl -{ -public: - wxToggleButton() {} - wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - - virtual void SetValue(bool value); - virtual bool GetValue() const ; - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - - virtual void Command(wxCommandEvent& event); - -protected: - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton) -}; - -#endif // _WX_TOGGLEBUTTON_H_ - diff --git a/include/wx/mac/classic/timer.h b/include/wx/mac/classic/timer.h deleted file mode 100644 index 1d01ea91a4..0000000000 --- a/include/wx/mac/classic/timer.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.h -// Purpose: wxTimer class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIMER_H_ -#define _WX_TIMER_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "timer.h" -#endif - -#include "wx/object.h" -#include "wx/mac/macnotfy.h" - -class wxTimer ; - -struct MacTimerInfo ; - -class WXDLLEXPORT wxTimer: public wxTimerBase -{ -public: - wxTimer() { Init(); } - wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id) { Init(); } - ~wxTimer(); - - virtual bool Start(int milliseconds = -1, - bool one_shot = FALSE); // Start timer - virtual void Stop(); // Stop timer - - virtual bool IsRunning() const ; - - MacTimerInfo* m_info; -protected : - void Init(); -private: - - DECLARE_ABSTRACT_CLASS(wxTimer) -}; - -#endif - // _WX_TIMER_H_ diff --git a/include/wx/mac/classic/toolbar.h b/include/wx/mac/classic/toolbar.h deleted file mode 100644 index 1849125750..0000000000 --- a/include/wx/mac/classic/toolbar.h +++ /dev/null @@ -1,96 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.h -// Purpose: wxToolBar class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOOLBAR_H_ -#define _WX_TOOLBAR_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "toolbar.h" -#endif - -#if wxUSE_TOOLBAR - -#include "wx/tbarbase.h" -#include "wx/dynarray.h" - -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; - -class WXDLLEXPORT wxToolBar: public wxToolBarBase -{ - DECLARE_DYNAMIC_CLASS(wxToolBar) - public: - /* - * Public interface - */ - - wxToolBar() { Init(); } - - - inline wxToolBar(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER|wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr) - { - Init(); - Create(parent, id, pos, size, style, name); - } - ~wxToolBar(); - - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER|wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr); - - // override/implement base class virtuals - virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; - - virtual bool Realize(); - - virtual void SetToolBitmapSize(const wxSize& size); - virtual wxSize GetToolSize() const; - - virtual void SetRows(int nRows); - - // Add all the buttons - - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - virtual wxString MacGetToolTipString( wxPoint &where ) ; - void OnPaint(wxPaintEvent& event) ; - void OnMouse(wxMouseEvent& event) ; - virtual void MacSuperChangedPosition() ; -protected: - // common part of all ctors - void Init(); - - // implement base class pure virtuals - virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); - virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); - - virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); - virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); - virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); - - virtual wxToolBarToolBase *CreateTool(int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp); - virtual wxToolBarToolBase *CreateTool(wxControl *control); - - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_TOOLBAR - -#endif - // _WX_TOOLBAR_H_ diff --git a/include/wx/mac/classic/tooltip.h b/include/wx/mac/classic/tooltip.h deleted file mode 100644 index 7bf4ecf440..0000000000 --- a/include/wx/mac/classic/tooltip.h +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/tooltip.h -// Purpose: wxToolTip class - tooltip control -// Author: Stefan Csomor -// Modified by: -// Created: 31.01.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin, Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - - -class wxToolTip : public wxObject -{ -public: - // ctor & dtor - wxToolTip(const wxString &tip); - virtual ~wxToolTip(); - - // accessors - // tip text - void SetTip(const wxString& tip); - const wxString& GetTip() const { return m_text; } - - // the window we're associated with - void SetWindow(wxWindow *win); - wxWindow *GetWindow() const { return m_window; } - - // controlling tooltip behaviour: globally change tooltip parameters - // enable or disable the tooltips globally - static void Enable(bool flag); - // set the delay after which the tooltip appears - static void SetDelay(long milliseconds); - static void NotifyWindowDelete( WXHWND win ) ; - - // implementation only from now on - // ------------------------------- - - // should be called in response to mouse events - static void RelayEvent(wxWindow *win , wxMouseEvent &event); - static void RemoveToolTips(); - -private: - wxString m_text; // tooltip text - wxWindow *m_window; // window we're associated with - DECLARE_ABSTRACT_CLASS(wxToolTip) -}; - diff --git a/include/wx/mac/classic/toplevel.h b/include/wx/mac/classic/toplevel.h deleted file mode 100644 index ffb0bcd288..0000000000 --- a/include/wx/mac/classic/toplevel.h +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/toplevel.h -// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW -// Author: Stefan Csomor -// Modified by: -// Created: 20.09.01 -// RCS-ID: $Id$ -// Copyright: (c) 2001 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TOPLEVEL_H_ -#define _WX_MSW_TOPLEVEL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "toplevel.h" -#endif - -#if wxUSE_SYSTEM_OPTIONS - #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition") -#endif - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase -{ -public: - // constructors and such - wxTopLevelWindowMac() { Init(); } - - wxTopLevelWindowMac(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init(); - - (void)Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - virtual ~wxTopLevelWindowMac(); - - // implement base class pure virtuals - virtual void Maximize(bool maximize = TRUE); - virtual bool IsMaximized() const; - virtual void Iconize(bool iconize = TRUE); - virtual bool IsIconized() const; - virtual void SetIcon(const wxIcon& icon); - virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } - virtual void Restore(); - - virtual bool SetShape(const wxRegion& region); - - virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) - { return FALSE; } - virtual bool IsFullScreen() const { return FALSE; } - - // implementation from now on - // -------------------------- - - static void MacDelayedDeactivation(long timestamp); - virtual void MacCreateRealWindow( const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) ; - static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } - virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; - virtual void ClearBackground() ; - virtual WXWidget MacGetContainerForEmbedding() ; - WXWindow MacGetWindowRef() { return m_macWindow ; } - virtual void MacActivate( long timestamp , bool inIsActivating ) ; - virtual void MacUpdate( long timestamp ) ; -#if !TARGET_CARBON - virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; - virtual void MacKeyDown( WXEVENTREF ev ) ; -#endif - virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; - virtual void Raise(); - virtual void Lower(); - virtual void SetTitle( const wxString& title); - virtual bool Show( bool show = TRUE ); - virtual void DoMoveWindow(int x, int y, int width, int height); - void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; - short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; } - static bool MacEnableCompositing( bool useCompositing ); - bool MacUsesCompositing() { return m_macUsesCompositing; } - -#if TARGET_CARBON - WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } -#endif -protected: - // common part of all ctors - void Init(); - - // is the frame currently iconized? - bool m_iconized; - - // should the frame be maximized when it will be shown? set by Maximize() - // when it is called while the frame is hidden - bool m_maximizeOnShow; - bool m_macUsesCompositing ; - - short m_macWindowBackgroundTheme ; - WXWindow m_macWindow ; - WXWidget m_macRootControl ; - wxWindowMac* m_macFocus ; - WXHRGN m_macNoEraseUpdateRgn ; - bool m_macNeedsErasing ; - - static WXWindow s_macWindowInUpdate ; - static wxTopLevelWindowMac *s_macDeactivateWindow; - static bool s_macWindowCompositing ; -private : -#if TARGET_CARBON - WXEVENTHANDLERREF m_macEventHandler ; -#endif -}; - -// list of all frames and modeless dialogs -extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; - -// associate mac windows with wx counterparts - -wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ; -void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ; -void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ; - - -#endif // _WX_MSW_TOPLEVEL_H_ - diff --git a/include/wx/mac/classic/treectrl.h b/include/wx/mac/classic/treectrl.h deleted file mode 100644 index 306a0105a5..0000000000 --- a/include/wx/mac/classic/treectrl.h +++ /dev/null @@ -1,295 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.h -// Purpose: wxTreeCtrl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TREECTRL_H_ -#define _WX_TREECTRL_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "treectrl.h" -#endif - -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" - -#define wxTREE_MASK_HANDLE 0x0001 -#define wxTREE_MASK_STATE 0x0002 -#define wxTREE_MASK_TEXT 0x0004 -#define wxTREE_MASK_IMAGE 0x0008 -#define wxTREE_MASK_SELECTED_IMAGE 0x0010 -#define wxTREE_MASK_CHILDREN 0x0020 -#define wxTREE_MASK_DATA 0x0040 - -#define wxTREE_STATE_BOLD 0x0001 -#define wxTREE_STATE_DROPHILITED 0x0002 -#define wxTREE_STATE_EXPANDED 0x0004 -#define wxTREE_STATE_EXPANDEDONCE 0x0008 -#define wxTREE_STATE_FOCUSED 0x0010 -#define wxTREE_STATE_SELECTED 0x0020 -#define wxTREE_STATE_CUT 0x0040 - -#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area. -#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area. -#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item. -#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item. -#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item. -#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item. -#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item. -#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item. -#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state. -#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area. -#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area. - -#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL | wxTREE_HITTEST_ONITEMSTATEICON) - -// Flags for GetNextItem -enum { - wxTREE_NEXT_CARET, // Retrieves the currently selected item. - wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL. - wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation. - wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item. - wxTREE_NEXT_NEXT, // Retrieves the next sibling item. - wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item. - wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item. - wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item. - wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item. - wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part. -}; - -// Flags for ExpandItem -enum { - wxTREE_EXPAND_EXPAND, - wxTREE_EXPAND_COLLAPSE, - wxTREE_EXPAND_COLLAPSE_RESET, - wxTREE_EXPAND_TOGGLE -}; - -// Flags for InsertItem -enum { - wxTREE_INSERT_LAST = -1, - wxTREE_INSERT_FIRST = -2, - wxTREE_INSERT_SORT = -3 -}; - -class WXDLLEXPORT wxTreeItem: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxTreeItem) -public: - long m_mask; - long m_itemId; - long m_state; - long m_stateMask; - wxString m_text; - int m_image; - int m_selectedImage; - int m_children; - long m_data; - - wxTreeItem(); - -// Accessors - inline long GetMask() const { return m_mask; } - inline long GetItemId() const { return m_itemId; } - inline long GetState() const { return m_state; } - inline long GetStateMask() const { return m_stateMask; } - inline wxString GetText() const { return m_text; } - inline int GetImage() const { return m_image; } - inline int GetSelectedImage() const { return m_selectedImage; } - inline int GetChildren() const { return m_children; } - inline long GetData() const { return m_data; } - - inline void SetMask(long mask) { m_mask = mask; } - inline void SetItemId(long id) { m_itemId = m_itemId = id; } - inline void SetState(long state) { m_state = state; } - inline void SetStateMask(long stateMask) { m_stateMask = stateMask; } - inline void GetText(const wxString& text) { m_text = text; } - inline void SetImage(int image) { m_image = image; } - inline void GetSelectedImage(int selImage) { m_selectedImage = selImage; } - inline void SetChildren(int children) { m_children = children; } - inline void SetData(long data) { m_data = data; } -}; - -class WXDLLEXPORT wxTreeCtrl: public wxControl -{ -public: - /* - * Public interface - */ - - // creation - // -------- - wxTreeCtrl(); - - inline wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl") - { - Create(parent, id, pos, size, style, validator, name); - } - ~wxTreeCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = "wxTreeCtrl"); - - // accessors - // --------- - // - int GetCount() const; - - // indent - int GetIndent() const; - void SetIndent(int indent); - // image list - wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const; - void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL); - - // navigation inside the tree - long GetNextItem(long item, int code) const; - bool ItemHasChildren(long item) const; - long GetChild(long item) const; - long GetItemParent(long item) const; - long GetFirstVisibleItem() const; - long GetNextVisibleItem(long item) const; - long GetSelection() const; - long GetRootItem() const; - - // generic function for (g|s)etting item attributes - bool GetItem(wxTreeItem& info) const; - bool SetItem(wxTreeItem& info); - // item state - int GetItemState(long item, long stateMask) const; - bool SetItemState(long item, long state, long stateMask); - // item image - bool SetItemImage(long item, int image, int selImage); - // item text - wxString GetItemText(long item) const; - void SetItemText(long item, const wxString& str); - // custom data associated with the item - long GetItemData(long item) const; - bool SetItemData(long item, long data); - // convenience function - bool IsItemExpanded(long item) - { - return (GetItemState(item, wxTREE_STATE_EXPANDED) & - wxTREE_STATE_EXPANDED) != 0; - } - - // bounding rect - bool GetItemRect(long item, wxRect& rect, bool textOnly = FALSE) const; - // - wxTextCtrl* GetEditControl() const; - - // operations - // ---------- - // adding/deleting items - bool DeleteItem(long item); - long InsertItem(long parent, wxTreeItem& info, - long insertAfter = wxTREE_INSERT_LAST); - // If image > -1 and selImage == -1, the same image is used for - // both selected and unselected items. - long InsertItem(long parent, const wxString& label, - int image = -1, int selImage = -1, - long insertAfter = wxTREE_INSERT_LAST); - - // changing item state - bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); } - bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); } - bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); } - // common interface for {Expand|Collapse|Toggle}Item - bool ExpandItem(long item, int action); - - // - bool SelectItem(long item); - bool ScrollTo(long item); - bool DeleteAllItems(); - - // Edit the label (tree must have the focus) - wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - - // End label editing, optionally cancelling the edit - bool EndEditLabel(bool cancel); - - long HitTest(const wxPoint& point, int& flags); - // wxImageList *CreateDragImage(long item); - bool SortChildren(long item); - bool EnsureVisible(long item); - - void Command(wxCommandEvent& event) { ProcessCommand(event); }; - -protected: - wxTextCtrl* m_textCtrl; - wxImageList* m_imageListNormal; - wxImageList* m_imageListState; - - DECLARE_DYNAMIC_CLASS(wxTreeCtrl) -}; - -/* - wxEVT_COMMAND_TREE_BEGIN_DRAG, - wxEVT_COMMAND_TREE_BEGIN_RDRAG, - wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, - wxEVT_COMMAND_TREE_END_LABEL_EDIT, - wxEVT_COMMAND_TREE_DELETE_ITEM, - wxEVT_COMMAND_TREE_GET_INFO, - wxEVT_COMMAND_TREE_SET_INFO, - wxEVT_COMMAND_TREE_ITEM_EXPANDED, - wxEVT_COMMAND_TREE_ITEM_EXPANDING, - wxEVT_COMMAND_TREE_ITEM_COLLAPSED, - wxEVT_COMMAND_TREE_ITEM_COLLAPSING, - wxEVT_COMMAND_TREE_SEL_CHANGED, - wxEVT_COMMAND_TREE_SEL_CHANGING, - wxEVT_COMMAND_TREE_KEY_DOWN -*/ - -class WXDLLEXPORT wxTreeEvent: public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS(wxTreeEvent) - - public: - wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - - int m_code; - wxTreeItem m_item; - long m_oldItem; - wxPoint m_pointDrag; - - inline long GetOldItem() const { return m_oldItem; } - inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; } - inline wxPoint GetPoint() const { return m_pointDrag; } - inline int GetCode() const { return m_code; } -}; - -typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); - -#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -#endif - // _WX_TREECTRL_H_ diff --git a/include/wx/mac/classic/uma.h b/include/wx/mac/classic/uma.h deleted file mode 100644 index c862427f62..0000000000 --- a/include/wx/mac/classic/uma.h +++ /dev/null @@ -1,131 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uma.h -// Purpose: Universal MacOS API -// Author: Stefan Csomor -// Modified by: -// Created: 03/02/99 -// RCS-ID: $Id: -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef H_UMA -#define H_UMA - -#include "wx/mac/private.h" - -void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded) ; -void UMACleanupToolbox() ; -long UMAGetSystemVersion() ; -bool UMAHasAppearance() ; -long UMAGetAppearanceVersion() ; -bool UMAHasWindowManager() ; -long UMAGetWindowManagerAttr() ; -bool UMAHasAquaLayout() ; - -bool UMASystemIsInitialized() ; -void UMASetSystemIsInitialized(bool val); - -// process manager - -long UMAGetProcessMode() ; -bool UMAGetProcessModeDoesActivateOnFGSwitch() ; - -#if wxUSE_GUI - -// menu manager - -MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding) ; -void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding) ; -UInt32 UMAMenuEvent( EventRecord *inEvent ) ; -void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item , bool enable ) ; - -void UMAAppendSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , SInt16 submenuid ) ; -void UMAInsertSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , SInt16 submenuid ) ; -void UMAAppendMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , wxAcceleratorEntry *entry = NULL ) ; -void UMAInsertMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry = NULL ) ; -void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry ) ; - -void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding ) ; - -// quickdraw - -void UMAShowWatchCursor() ; -void UMAShowArrowCursor() ; - -#if !TARGET_CARBON -OSStatus UMAPrOpen() ; -OSStatus UMAPrClose() ; -#endif - -// window manager - -GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ; -void UMADisposeWindow( WindowRef inWindowRef ) ; -void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding) ; - -void UMADrawGrowIcon( WindowRef inWindowRef ) ; -void UMAShowHide( WindowRef inWindowRef , Boolean show) ; - -// appearance manager - -void UMADrawControl( ControlHandle inControl ) ; - -void UMAEnableControl( ControlHandle inControl ) ; -void UMADisableControl( ControlHandle inControl ) ; -void UMAActivateControl( ControlHandle inControl ) ; -void UMADeactivateControl( ControlHandle inControl ) ; -// ControlPartCode hiliteState) ; -void UMAShowControl (ControlHandle theControl) ; -void UMAHideControl (ControlHandle theControl); -void UMAActivateControl (ControlHandle inControl); -void UMADeactivateControl (ControlHandle inControl); -void UMASetControlTitle( ControlHandle inControl , const wxString& title , wxFontEncoding encoding) ; - -void UMAMoveControl( ControlHandle inControl , short x , short y ) ; -void UMASizeControl( ControlHandle inControl , short x , short y ) ; -// control hierarchy - -// keyboard focus -OSErr UMASetKeyboardFocus (WindowPtr inWindow, - ControlHandle inControl, - ControlFocusPart inPart) ; - -// events - -void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; -OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; - -// handling control data -bool UMAIsWindowFloating( WindowRef inWindow ) ; -bool UMAIsWindowModal( WindowRef inWindow ) ; - -void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; - -OSStatus UMAGetHelpMenu( - MenuRef * outHelpMenu, - MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */ - -// Appearance Drawing - -OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; - -// Clipboard support - -OSStatus UMAPutScrap( Size size , OSType type , void *data ) ; - -// accessor helpers - -#if !TARGET_CARBON -#define ClearCurrentScrap() ZeroScrap() ; -#define GetApplicationScript() smSystemScript -#else - -// calls not in carbon - -#endif -#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) - -#endif // wxUSE_GUI - -#endif diff --git a/include/wx/mac/classic/window.h b/include/wx/mac/classic/window.h deleted file mode 100644 index 807e261863..0000000000 --- a/include/wx/mac/classic/window.h +++ /dev/null @@ -1,269 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: window.h -// Purpose: wxWindowMac class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_ -#define _WX_WINDOW_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "window.h" -#endif - -#include "wx/brush.h" - -// --------------------------------------------------------------------------- -// forward declarations -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxButton; -class WXDLLEXPORT wxScrollBar; -class WXDLLEXPORT wxTopLevelWindowMac; - -// --------------------------------------------------------------------------- -// constants -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowMac: public wxWindowBase -{ - DECLARE_DYNAMIC_CLASS(wxWindowMac) - - friend class wxDC; - friend class wxPaintDC; - -public: - - wxWindowMac() - : m_macBackgroundBrush() - , m_macVisibleRegion() - , m_x(0), m_y(0), m_width(0), m_height(0) - , m_hScrollBar(NULL), m_vScrollBar(NULL) - , m_label(wxEmptyString) - { Init(); } - - wxWindowMac(wxWindowMac *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Init(); - Create(parent, id, pos, size, style, name); - } - - virtual ~wxWindowMac(); - - bool Create(wxWindowMac *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr); - - - // implement base class pure virtuals - virtual void SetTitle( const wxString& title); - virtual wxString GetTitle() const; - - virtual void Raise(); - virtual void Lower(); - - virtual bool Show( bool show = TRUE ); - virtual bool Enable( bool enable = TRUE ); - - virtual void SetFocus(); - - virtual void WarpPointer(int x, int y); - - virtual void Refresh( bool eraseBackground = TRUE, - const wxRect *rect = (const wxRect *) NULL ); - - virtual bool SetCursor( const wxCursor &cursor ); - virtual bool SetFont(const wxFont& font) - { return wxWindowBase::SetFont(font); } - virtual int GetCharHeight() const; - virtual int GetCharWidth() const; - virtual void GetTextExtent(const wxString& string, - int *x, int *y, - int *descent = (int *) NULL, - int *externalLeading = (int *) NULL, - const wxFont *theFont = (const wxFont *) NULL) - const; - - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); - - virtual void SetScrollbar( int orient, int pos, int thumbVisible, - int range, bool refresh = TRUE ); - virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ); - virtual int GetScrollPos( int orient ) const; - virtual int GetScrollThumb( int orient ) const; - virtual int GetScrollRange( int orient ) const; - virtual void ScrollWindow( int dx, int dy, - const wxRect* rect = (wxRect *) NULL ); - -#if wxUSE_DRAG_AND_DROP - virtual void SetDropTarget( wxDropTarget *dropTarget ); -#endif // wxUSE_DRAG_AND_DROP - - // Accept files for dragging - virtual void DragAcceptFiles(bool accept); - - // Native resource loading (implemented in src/msw/nativdlg.cpp) - // FIXME: should they really be all virtual? - wxWindowMac* GetWindowChild1(wxWindowID id); - wxWindowMac* GetWindowChild(wxWindowID id); - - // implementation from now on - // -------------------------- - - void MacClientToRootWindow( int *x , int *y ) const ; - void MacRootWindowToClient( int *x , int *y ) const ; - void MacWindowToRootWindow( int *x , int *y ) const ; - void MacRootWindowToWindow( int *x , int *y ) const ; - - virtual wxString MacGetToolTipString( wxPoint &where ) ; - - // simple accessors - // ---------------- - -// WXHWND GetHWND() const { return m_hWnd; } -// void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; } - virtual WXWidget GetHandle() const { return (WXWidget) NULL ; } - - bool GetTransparentBackground() const { return m_backgroundTransparent; } - void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; } - - // event handlers - // -------------- - void OnSetFocus(wxFocusEvent& event) ; - void OnNcPaint(wxNcPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); - void OnMouseEvent( wxMouseEvent &event ) ; - - void MacOnScroll(wxScrollEvent&event ) ; - - bool AcceptsFocus() const ; - -public: - void OnInternalIdle(); - - // For implementation purposes - sometimes decorations make the client area - // smaller - virtual wxPoint GetClientAreaOrigin() const; - - wxWindowMac *FindItem(long id) const; - wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const; - - // Make a Windows extended style from the given wxWindows window style - static WXDWORD MakeExtendedStyle(long style, - bool eliminateBorders = TRUE); - // Determine whether 3D effects are wanted - WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const; - - // MSW only: TRUE if this control is part of the main control - virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; }; - - // Setup background and foreground colours correctly - virtual void SetupColours(); - -public: - static bool MacGetWindowFromPoint( const wxPoint &point , wxWindowMac** outWin ) ; - virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ; - virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ; - virtual bool MacCanFocus() const { return true ; } - - virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ; - // this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren - virtual void RemoveChild( wxWindowBase *child ); - virtual void MacPaintBorders( int left , int top ) ; - WXWindow MacGetRootWindow() const ; - wxTopLevelWindowMac* MacGetTopLevelWindow() const ; - - virtual WXWidget MacGetContainerForEmbedding() ; - - virtual long MacGetLeftBorderSize() const ; - virtual long MacGetRightBorderSize() const ; - virtual long MacGetTopBorderSize() const ; - virtual long MacGetBottomBorderSize() const ; - - static long MacRemoveBordersFromStyle( long style ) ; - virtual void MacSuperChangedPosition() ; - // the absolute coordinates of this item within the toplevel window may have changed - virtual void MacUpdateDimensions() {} - // the absolute coortinates of this window's root have changed - virtual void MacTopLevelWindowChangedPosition() ; - virtual void MacSuperShown( bool show ) ; - virtual void MacSuperEnabled( bool enable ) ; - bool MacIsReallyShown() const ; - virtual void Update() ; - // for compatibility - void MacUpdateImmediately() { Update() ; } - virtual bool MacSetupCursor( const wxPoint& pt ) ; - -// virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ; -// virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ; -// virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ; - const wxBrush& MacGetBackgroundBrush() ; - const wxRegion& MacGetVisibleRegion( bool respectChildrenAndSiblings = true ) ; - bool MacIsWindowScrollbar( const wxScrollBar* sb ) - { return (m_hScrollBar == sb || m_vScrollBar == sb) ; } - static wxWindowMac* s_lastMouseWindow ; -private: -protected: - wxBrush m_macBackgroundBrush ; - wxRegion m_macVisibleRegion ; - int m_x ; - int m_y ; - int m_width ; - int m_height ; - - wxScrollBar* m_hScrollBar ; - wxScrollBar* m_vScrollBar ; - wxString m_label ; - - void MacCreateScrollBars( long style ) ; - void MacRepositionScrollBars() ; - - bool m_backgroundTransparent ; - - // implement the base class pure virtuals - virtual void DoClientToScreen( int *x, int *y ) const; - virtual void DoScreenToClient( int *x, int *y ) const; - virtual void DoGetPosition( int *x, int *y ) const; - virtual void DoGetSize( int *width, int *height ) const; - virtual void DoGetClientSize( int *width, int *height ) const; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - virtual void DoSetClientSize(int width, int height); - - virtual void DoCaptureMouse(); - virtual void DoReleaseMouse(); - - // move the window to the specified location and resize it: this is called - // from both DoSetSize() and DoSetClientSize() and would usually just call - // ::MoveWindow() except for composite controls which will want to arrange - // themselves inside the given rectangle - virtual void DoMoveWindow(int x, int y, int width, int height); - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif // wxUSE_TOOLTIPS - -private: - // common part of all ctors - void Init(); - - DECLARE_NO_COPY_CLASS(wxWindowMac) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_WINDOW_H_ diff --git a/include/wx/platform.h b/include/wx/platform.h index 2d9c7d6a3c..d1c131e03e 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -23,29 +23,6 @@ # include #endif -/* - WXMAC variants - __WXMAC_CLASSIC__ means ppc non-carbon builds, __WXMAC_CARBON__ means - carbon API available (mach or cfm builds) , __WXMAC_OSX__ means mach-o - builds, running under 10.2 + only -*/ -#ifdef __WXMAC__ - #if defined(__MACH__) - #define __WXMAC_OSX__ 1 - #define __WXMAC_CARBON__ 1 - #define __WXMAC_CLASSIC__ 0 - #else - #define __WXMAC_OSX__ 0 - #if TARGET_CARBON - #define __WXMAC_CARBON__ 1 - #define __WXMAC_CLASSIC__ 0 - #else - #define __WXMAC_CARBON__ 0 - #define __WXMAC_CLASSIC__ 1 - #endif - #endif -#endif - /* first define Windows symbols if they're not defined on the command line: we can autodetect everything we need if _WIN32 is defined diff --git a/lib/vms_gtk_univ.opt b/lib/vms_gtk_univ.opt new file mode 100644 index 0000000000..ec79fae109 --- /dev/null +++ b/lib/vms_gtk_univ.opt @@ -0,0 +1,14 @@ +wx_root:[wxwidgets.lib]libwx_gtk_univ.olb/lib +sys$library:gthread.obj +sys$library:libjpeg.olb/lib +sys$library:libpng.olb/lib +sys$library:libz.olb/lib +sys$library:tiff.olb/lib +X11:libxpm.olb/lib +sys$share:iodbc.exe/share +sys$share:libgtk.exe/share +sys$share:libgdk.exe/share +sys$share:libglib.exe/share +sys$share:vms_jackets.exe/share +sys$share:pthread$rtl.exe/share +sys$library:decw$xlibshr.exe/share diff --git a/samples/taskbar/mondrian.ico b/samples/taskbar/mondrian.ico new file mode 100644 index 0000000000000000000000000000000000000000..2310c5d275a87af295d5ea8dc79ea417a5e74c53 GIT binary patch literal 766 zcmZQzU<5)11px*Sc)`TLAO@s0fLH;D9e|jTfdxnc0Z c #006000", +", c #FFFF00", +"' c #00BF00", +".++.@@@@@@@@@@@#", +"+$$+%%%%%%%%%%%@", +"+$$+%%%%%%%%%%%@", +"+$$+%%%%%%%%%%%@", +"#@@#@@@@@@@@@&*&", +"@%%@%%%%%%%%%*=*", +"@%%@%%%%%%%%%*=*", +"@%%@%%%%%%%%%#@#", +"@%%@%%%%%%%%%@%@", +"@%%@%%%%%%%%%@%@", +"@%%@%%%%%%%%%@%@", +"@%%@%%%%%%%%%@%@", +"@%%@------;>>@%@", +"@%%@,,,,,,>''@%@", +"@%%@,,,,,,>''@%@", +"#@@#------;>>#@#"}; diff --git a/samples/taskbar/tbtest.rc b/samples/taskbar/tbtest.rc new file mode 100644 index 0000000000..7655c62a4c --- /dev/null +++ b/samples/taskbar/tbtest.rc @@ -0,0 +1,3 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + diff --git a/samples/treectrl/treetest.dsp b/samples/treectrl/treetest.dsp deleted file mode 100644 index f362ccfe96..0000000000 --- a/samples/treectrl/treetest.dsp +++ /dev/null @@ -1,155 +0,0 @@ -# Microsoft Developer Studio Project File - Name="treetest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=treetest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "treetest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "treetest.mak" CFG="treetest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "treetest - Win32 Release DLL" (based on "Win32 (x86) Application") -!MESSAGE "treetest - Win32 Debug DLL" (based on "Win32 (x86) Application") -!MESSAGE "treetest - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "treetest - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "treetest - Win32 Release DLL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseDll" -# PROP BASE Intermediate_Dir "ReleaseDll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseDll" -# PROP Intermediate_Dir "ReleaseDll" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W4 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c -# ADD CPP /nologo /MD /W4 /O2 /I "../../include" /I "..\..\lib\mswdll" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "WXUSINGDLL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /i "../../include" /d "NDEBUG" -# ADD RSC /l 0x409 /i "../../include" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib ..\..\lib\wxmsw250.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "treetest - Win32 Debug DLL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DebugDll" -# PROP BASE Intermediate_Dir "DebugDll" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DebugDll" -# PROP Intermediate_Dir "DebugDll" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W4 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c -# ADD CPP /nologo /MDd /W4 /Zi /Od /I "../../include" /I "..\..\lib\mswdlld" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "__WXDEBUG__" /D WXDEBUG=1 /D "WXUSINGDLL" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /i "../../include" /d "_DEBUG" -# ADD RSC /l 0x409 /i "../../include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib ..\..\lib\wxmsw250d.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "treetest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W4 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c -# ADD CPP /nologo /MD /W4 /O2 /I "../../include" /I "..\..\lib\msw" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /i "../../include" /d "NDEBUG" -# ADD RSC /l 0x409 /i "../../include" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib ..\..\lib\zlib.lib ..\..\lib\regex.lib ..\..\lib\png.lib ..\..\lib\jpeg.lib ..\..\lib\tiff.lib ..\..\lib\wxmsw.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "treetest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W4 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c -# ADD CPP /nologo /MDd /W4 /Zi /Od /I "../../include" /I "..\..\lib\mswd" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "__WXDEBUG__" /D WXDEBUG=1 /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /i "../../include" /d "_DEBUG" -# ADD RSC /l 0x409 /i "../../include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib ..\..\lib\zlibd.lib ..\..\lib\regexd.lib ..\..\lib\pngd.lib ..\..\lib\jpegd.lib ..\..\lib\tiffd.lib ..\..\lib\wxmswd.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "treetest - Win32 Release DLL" -# Name "treetest - Win32 Debug DLL" -# Name "treetest - Win32 Release" -# Name "treetest - Win32 Debug" -# Begin Source File - -SOURCE=.\treetest.cpp -# End Source File -# Begin Source File - -SOURCE=.\treetest.rc -# End Source File -# End Target -# End Project diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 6ff702eff3..aa0d96d70c 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -54,8 +54,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow) wxTopLevelWindowBase::wxTopLevelWindowBase() { - // Unlike windows, top level windows are created hidden by default. - m_isShown = false; } wxTopLevelWindowBase::~wxTopLevelWindowBase() diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index aa90c82cbd..1f80f28ee9 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -121,8 +121,8 @@ wxWindowBase::wxWindowBase() m_maxWidth = m_maxHeight = -1; - // window are created enabled and visible by default - m_isShown = + // window is created enabled but it's not visible yet + m_isShown = false; m_isEnabled = true; // the default event handler is just this window diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 01cd41e868..4767c02c68 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -3211,8 +3211,6 @@ void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc ) dc.SetFont(attr->GetFont()); else if ( item->IsBold() ) dc.SetFont(m_boldFont); - else - dc.SetFont(m_normalFont); dc.GetTextExtent( item->GetText(), &text_w, &text_h ); text_h+=2; diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index ac2b31819d..4acfbb9043 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -273,8 +273,8 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, wxMenu* helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _("&About...")); - menuBar->Append(fileMenu,_("File")); - menuBar->Append(helpMenu,_("Help")); + menuBar->Append(fileMenu,_("&File")); + menuBar->Append(helpMenu,_("&Help")); SetMenuBar(menuBar); #endif @@ -377,7 +377,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_ContentsBox->AssignImageList(ContentsImageList); topsizer->Add(m_ContentsBox, 1, - wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT | wxADJUST_MINSIZE, + wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 2); m_NavigNotebook->AddPage(dummy, _("Contents")); @@ -419,7 +419,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, topsizer->Add(btsizer, 0, wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10); topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2); - topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL | wxADJUST_MINSIZE, 2); + topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2); m_NavigNotebook->AddPage(dummy, _("Index")); m_IndexPage = notebook_page++; @@ -455,7 +455,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10); sizer->Add(m_SearchWholeWords, 0, wxLEFT | wxRIGHT, 10); sizer->Add(m_SearchButton, 0, wxALL | wxALIGN_RIGHT, 8); - sizer->Add(m_SearchList, 1, wxALL | wxEXPAND | wxADJUST_MINSIZE, 2); + sizer->Add(m_SearchList, 1, wxALL | wxEXPAND, 2); m_NavigNotebook->AddPage(dummy, _("Search")); m_SearchPage = notebook_page; diff --git a/src/html/htmlfilter.cpp b/src/html/htmlfilter.cpp deleted file mode 100644 index 57508b1069..0000000000 --- a/src/html/htmlfilter.cpp +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: filter.cpp -// Purpose: wxHtmlFilter - input filter for translating into HTML format -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - - -#ifdef __GNUG__ -#pragma implementation "htmlfilter.h" -#endif - -#include "wx/wxprec.h" - -#if wxUSE_HTML - -#ifdef __BORDLANDC__ -#pragma hdrstop -#endif - -#ifndef WXPRECOMP -#endif - -#include "wx/html/htmlfilter.h" -#include "wx/html/htmlwin.h" - - -/* - -There is code for several default filters: - -*/ - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlFilter, wxObject) - -//-------------------------------------------------------------------------------- -// wxHtmlFilterPlainText -// filter for text/plain or uknown -//-------------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterPlainText, wxHtmlFilter) - -bool wxHtmlFilterPlainText::CanRead(const wxFSFile& WXUNUSED(file)) const -{ - return TRUE; -} - - - -wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file) const -{ - wxInputStream *s = file.GetStream(); - char *src; - wxString doc, doc2; - - if (s == NULL) return wxEmptyString; - src = new char[s -> GetSize()+1]; - src[s -> GetSize()] = 0; - s -> Read(src, s -> GetSize()); - doc = src; - delete [] src; - - doc.Replace(_T("<"), _T("<"), TRUE); - doc.Replace(_T(">"), _T(">"), TRUE); - doc2 = _T("
\n") + doc + _T("\n
"); - return doc2; -} - - - - - -//-------------------------------------------------------------------------------- -// wxHtmlFilterImage -// filter for image/* -//-------------------------------------------------------------------------------- - -class wxHtmlFilterImage : public wxHtmlFilter -{ - DECLARE_DYNAMIC_CLASS(wxHtmlFilterImage) - - public: - virtual bool CanRead(const wxFSFile& file) const; - virtual wxString ReadFile(const wxFSFile& file) const; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterImage, wxHtmlFilter) - - - -bool wxHtmlFilterImage::CanRead(const wxFSFile& file) const -{ - return (file.GetMimeType().Left(6) == "image/"); -} - - - -wxString wxHtmlFilterImage::ReadFile(const wxFSFile& file) const -{ - return (""); -} - - - - -//-------------------------------------------------------------------------------- -// wxHtmlFilterPlainText -// filter for text/plain or uknown -//-------------------------------------------------------------------------------- - -class wxHtmlFilterHTML : public wxHtmlFilter -{ - DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML) - - public: - virtual bool CanRead(const wxFSFile& file) const; - virtual wxString ReadFile(const wxFSFile& file) const; -}; - - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterHTML, wxHtmlFilter) - -bool wxHtmlFilterHTML::CanRead(const wxFSFile& file) const -{ -// return (file.GetMimeType() == "text/html"); -// This is true in most case but some page can return: -// "text/html; char-encoding=...." -// So we use Find instead - return (file.GetMimeType().Find(_T("text/html")) == 0); -} - - - -wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const -{ - wxInputStream *s = file.GetStream(); - char *src; - wxString doc; - - if (s == NULL) return wxEmptyString; - src = new char[s -> GetSize() + 1]; - src[s -> GetSize()] = 0; - s -> Read(src, s -> GetSize()); - doc = src; - delete[] src; - - return doc; -} - - - - -///// Module: - -class wxHtmlFilterModule : public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxHtmlFilterModule) - - public: - virtual bool OnInit() - { - wxHtmlWindow::AddFilter(new wxHtmlFilterHTML); - wxHtmlWindow::AddFilter(new wxHtmlFilterImage); - return TRUE; - } - virtual void OnExit() {} -}; - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterModule, wxModule) - -#endif diff --git a/src/html/htmlhelp.cpp b/src/html/htmlhelp.cpp deleted file mode 100644 index 8ea6466640..0000000000 --- a/src/html/htmlhelp.cpp +++ /dev/null @@ -1,839 +0,0 @@ -// Name: htmlhelp.cpp -// Purpose: Help controller -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#error This file should not be compiled! Update your build system! \ -(configure users, rerun configure to get a new Makefile) \ -Instead of htmlhelp[_io], use helpdata, helpfrm and helpctrl. This \ -file is only left to point out the problem and will be removed r.s.n. - -#ifdef __GNUG__ -#pragma implementation "htmlhelp.h" -#endif - -#include "wx/wxprec.h" - -#if wxUSE_HTML - -#ifdef __BORDLANDC__ -#pragma hdrstop -#endif - -#ifndef WXPRECOMP -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#if !((wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7))) -#include -#endif - - -// Bitmaps: - -#ifndef __WXMSW__ - // XPM hack: make the arrays const - #define static static const - - #include "bitmaps/panel.xpm" - #include "bitmaps/back.xpm" - #include "bitmaps/forward.xpm" - #include "bitmaps/book.xpm" - #include "bitmaps/folder.xpm" - #include "bitmaps/page.xpm" - - #undef static -#endif - -#include "search.h" - - - - -#include -WX_DEFINE_OBJARRAY(HtmlBookRecArray) - - - - - - - - - -//----------------------------------------------------------------------------- -// wxHtmlHelpController -//----------------------------------------------------------------------------- - - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpController, wxEvtHandler) - - -wxHtmlHelpController::wxHtmlHelpController() : wxEvtHandler() -{ - m_Frame = NULL; - m_Config = NULL; - m_ConfigRoot = wxEmptyString; - m_TitleFormat = _("Help : %s"); - m_TempPath = wxEmptyString; - - m_Cfg.x = m_Cfg.y = 0; - m_Cfg.w = 700; m_Cfg.h = 480; - m_Cfg.sashpos = 240; - m_Cfg.navig_on = TRUE; - - m_ContentsImageList = new wxImageList(12, 12); - m_ContentsImageList -> Add(wxICON(book)); - m_ContentsImageList -> Add(wxICON(folder)); - m_ContentsImageList -> Add(wxICON(page)); - - m_Contents = NULL; - m_ContentsCnt = 0; - m_Index = NULL; - m_IndexCnt = 0; - - m_IndexBox = NULL; - m_ContentsBox = NULL; - m_SearchList = NULL; - m_SearchText = NULL; - m_SearchButton = NULL; - m_HtmlWin = NULL; - m_Splitter = NULL; - m_NavigPan = NULL; -} - - - -wxHtmlHelpController::~wxHtmlHelpController() -{ - int i; - - m_BookRecords.Empty(); - delete m_ContentsImageList; - if (m_Contents) { - for (i = 0; i < m_ContentsCnt; i++) { - delete[] m_Contents[i].m_Page; - delete[] m_Contents[i].m_Name; - } - free(m_Contents); - } - if (m_Index) { - for (i = 0; i < m_IndexCnt; i++) { - delete[] m_Index[i].m_Page; - delete[] m_Index[i].m_Name; - } - free(m_Index); - } -} - - - -void wxHtmlHelpController::SetTempDir(const wxString& path) -{ - if (path == wxEmptyString) m_TempPath = path; - else { - if (wxIsAbsolutePath(path)) m_TempPath = path; - else m_TempPath = wxGetCwd() + "/" + path; - - if (m_TempPath[m_TempPath.Length() - 1] != '/') - m_TempPath << "/"; - } -} - - - - -// Reads one line, stores it into buf and returns pointer to new line or NULL. -static char* ReadLine(char *line, char *buf) -{ - char *writeptr = buf, *readptr = line; - - while (*readptr != 0 && *readptr != '\r' && *readptr != '\n') *(writeptr++) = *(readptr++); - *writeptr = 0; - while (*readptr == '\r' || *readptr == '\n') readptr++; - if (*readptr == 0) return NULL; - else return readptr; -} - - -static wxString SafeFileName(const wxString& s) -{ - wxString res = s; - res.Replace(_T(":"), _T("_"), TRUE); - res.Replace(_T(" "), _T("_"), TRUE); - res.Replace(_T("/"), _T("_"), TRUE); - res.Replace(_T("\\"), _T("_"), TRUE); - res.Replace(_T("#"), _T("_"), TRUE); - res.Replace(_T("."), _T("_"), TRUE); - return res; -} - - -static int IndexCompareFunc(const void *a, const void *b) -{ - return strcmp(((HtmlContentsItem*)a) -> m_Name, ((HtmlContentsItem*)b) -> m_Name); -} - - - -bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) -{ - wxFSFile *fi; - wxFileSystem fsys; - wxInputStream *s; - HtmlBookRecord *bookr; - wxString bookFull; - - int sz; - char *buff, *lineptr; - char linebuf[300]; - - wxString title = _("noname"), - safetitle, - start = wxEmptyString, - contents = wxEmptyString, index = wxEmptyString; - - if (wxIsAbsolutePath(book)) bookFull = book; - else bookFull = wxGetCwd() + "/" + book; - - fi = fsys.OpenFile(bookFull); - if (fi == NULL) return FALSE; - fsys.ChangePathTo(bookFull); - s = fi -> GetStream(); - sz = s -> GetSize(); - buff = new char[sz+1]; - buff[sz] = 0; - s -> Read(buff, sz); - lineptr = buff; - delete fi; - - while ((lineptr = ReadLine(lineptr, linebuf)) != NULL) { - if (strstr(linebuf, "Title=") == linebuf) - title = linebuf + strlen("Title="); - if (strstr(linebuf, "Default topic=") == linebuf) - start = linebuf + strlen("Default topic="); - if (strstr(linebuf, "Index file=") == linebuf) - index = linebuf + strlen("Index file="); - if (strstr(linebuf, "Contents file=") == linebuf) - contents = linebuf + strlen("Contents file="); - } - delete[] buff; - - bookr = new HtmlBookRecord(fsys.GetPath(), title, start); - - if (m_ContentsCnt % HTML_REALLOC_STEP == 0) - m_Contents = (HtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + HTML_REALLOC_STEP) * sizeof(HtmlContentsItem)); - m_Contents[m_ContentsCnt].m_Level = 0; - m_Contents[m_ContentsCnt].m_ID = 0; - m_Contents[m_ContentsCnt].m_Page = new char[start.Length() + 1]; - strcpy(m_Contents[m_ContentsCnt].m_Page, start.c_str()); - m_Contents[m_ContentsCnt].m_Name = new char [title.Length() + 1]; - strcpy(m_Contents[m_ContentsCnt].m_Name, title.c_str()); - m_Contents[m_ContentsCnt].m_Book = bookr; - m_ContentsCnt++; - - // Try to find cached binary versions: - safetitle = SafeFileName(title); - fi = fsys.OpenFile(safetitle + ".cached"); - if (fi == NULL) fi = fsys.OpenFile(m_TempPath + safetitle + ".cached"); - if ((fi == NULL) || (m_TempPath == wxEmptyString)) { - LoadMSProject(bookr, fsys, index, contents, show_wait_msg); - if (m_TempPath != wxEmptyString) { - wxFileOutputStream *outs = new wxFileOutputStream(m_TempPath + safetitle + ".cached"); - SaveCachedBook(bookr, outs); - delete outs; - } - } - else { - LoadCachedBook(bookr, fi -> GetStream()); - delete fi; - } - - m_BookRecords.Add(bookr); - if (m_IndexCnt > 0) - qsort(m_Index, m_IndexCnt, sizeof(HtmlContentsItem), IndexCompareFunc); - - return TRUE; -} - - - - -void wxHtmlHelpController::Display(const wxString& x) -{ - int cnt; - int i; - wxFileSystem fsys; - wxFSFile *f; - - CreateHelpWindow(); - - /* 1. try to open given file: */ - - cnt = m_BookRecords.GetCount(); - for (i = 0; i < cnt; i++) { - f = fsys.OpenFile(m_BookRecords[i].GetBasePath() + x); - if (f) { - m_HtmlWin -> LoadPage(m_BookRecords[i].GetBasePath() + x); - delete f; - return; - } - } - - - /* 2. try to find a book: */ - - for (i = 0; i < cnt; i++) { - if (m_BookRecords[i].GetTitle() == x) { - m_HtmlWin -> LoadPage(m_BookRecords[i].GetBasePath() + m_BookRecords[i].GetStart()); - return; - } - } - - /* 3. try to find in contents: */ - - cnt = m_ContentsCnt; - for (i = 0; i < cnt; i++) { - if (strcmp(m_Contents[i].m_Name, x) == 0) { - m_HtmlWin -> LoadPage(m_Contents[i].m_Book -> GetBasePath() + m_Contents[i].m_Page); - return; - } - } - - - /* 4. try to find in index: */ - - cnt = m_IndexCnt; - for (i = 0; i < cnt; i++) { - if (strcmp(m_Index[i].m_Name, x) == 0) { - m_HtmlWin -> LoadPage(m_Index[i].m_Book -> GetBasePath() + m_Index[i].m_Page); - return; - } - } - - - /* 5. if everything failed, search the documents: */ - - KeywordSearch(x); -} - - - -void wxHtmlHelpController::Display(const int id) -{ - CreateHelpWindow(); - - for (int i = 0; i < m_ContentsCnt; i++) { - if (m_Contents[i].m_ID == id) { - m_HtmlWin -> LoadPage(m_Contents[i].m_Book -> GetBasePath() + m_Contents[i].m_Page); - return; - } - } -} - - - -void wxHtmlHelpController::DisplayContents() -{ - CreateHelpWindow(); - m_Frame -> Raise(); - if (!m_Splitter -> IsSplit()) { - m_NavigPan -> Show(TRUE); - m_HtmlWin -> Show(TRUE); - m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - m_NavigPan -> SetSelection(0); -} - - - -void wxHtmlHelpController::DisplayIndex() -{ - CreateHelpWindow(); - m_Frame -> Raise(); - if (!m_Splitter -> IsSplit()) { - m_NavigPan -> Show(TRUE); - m_HtmlWin -> Show(TRUE); - m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - m_NavigPan -> SetSelection(1); -} - - - - -#if (wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7)) - -class MyProgressDlg : public wxDialog -{ - public: - bool m_Canceled; - - MyProgressDlg(wxWindow *parent) : wxDialog(parent, -1, - _("Searching..."), - wxPoint(0, 0), -#ifdef __WXGTK__ - wxSize(300, 110) -#else - wxSize(300, 130) -#endif - ) - {m_Canceled = FALSE;} - void OnCancel(wxCommandEvent& event) {m_Canceled = TRUE;} - DECLARE_EVENT_TABLE() -}; -BEGIN_EVENT_TABLE(MyProgressDlg, wxDialog) - EVT_BUTTON(wxID_CANCEL, MyProgressDlg::OnCancel) -END_EVENT_TABLE() - -#endif - - -bool wxHtmlHelpController::KeywordSearch(const wxString& keyword) -{ - int foundcnt = 0; - CreateHelpWindow(); - // if these are not set, we can't continue - if (! (m_SearchList && m_HtmlWin)) - return FALSE; - m_Frame -> Raise(); - if (m_Splitter && m_NavigPan && m_SearchButton) { - if (!m_Splitter -> IsSplit()) { - m_NavigPan -> Show(TRUE); - m_HtmlWin -> Show(TRUE); - m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - m_NavigPan -> SetSelection(2); - m_SearchList -> Clear(); - m_SearchText -> SetValue(keyword); - m_SearchButton -> Enable(FALSE); - } - { - int cnt = m_ContentsCnt; - wxSearchEngine engine; - wxFileSystem fsys; - wxFSFile *file; - wxString lastpage = wxEmptyString; - wxString foundstr; - -#if (wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7)) - MyProgressDlg progress(m_Frame); - - wxStaticText *prompt = new wxStaticText(&progress, -1, "", wxPoint(20, 50), wxSize(260, 25), wxALIGN_CENTER); - wxGauge *gauge = new wxGauge(&progress, -1, cnt, wxPoint(20, 20), wxSize(260, 25)); - wxButton *btn = new wxButton(&progress, wxID_CANCEL, _("Cancel"), wxPoint(110, 70), wxSize(80, 25)); - btn = btn; /* fool compiler :-) */ - prompt -> SetLabel(_("No matching page found yet")); - - progress.Centre(wxBOTH); - progress.Show(TRUE); -#else - wxProgressDialog progress(_("Searching..."), _("No matching page found yet"), cnt, m_Frame, wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_AUTO_HIDE); -#endif - - engine.LookFor(keyword); - - for (int i = 0; i < cnt; i++) { -#if (wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7)) - gauge -> SetValue(i); - if (progress.m_Canceled) break; -#else - if (progress.Update(i) == FALSE) break; -#endif - wxYield(); - - file = fsys.OpenFile(m_Contents[i].m_Book -> GetBasePath() + m_Contents[i].m_Page); - if (file) { - if (lastpage != file -> GetLocation()) { - lastpage = file -> GetLocation(); - if (engine.Scan(file -> GetStream())) { - foundstr.Printf(_("Found %i matches"), ++foundcnt); -#if (wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7)) - prompt -> SetLabel(foundstr); -#else - progress.Update(i, foundstr); -#endif - wxYield(); - m_SearchList -> Append(m_Contents[i].m_Name, (char*)(m_Contents + i)); - } - } - delete file; - } - } - -#if (wxVERSION_NUMBER < 2100) || ((wxVERSION_NUMBER == 2100) && (wxBETA_NUMBER < 7)) - progress.Close(TRUE); -#endif - } - if (m_SearchButton) - m_SearchButton -> Enable(TRUE); - if (m_SearchText) { - m_SearchText -> SetSelection(0, keyword.Length()); - m_SearchText -> SetFocus(); - } - if (foundcnt) { - HtmlContentsItem *it = (HtmlContentsItem*) m_SearchList -> GetClientData(0); - if (it) m_HtmlWin -> LoadPage(it -> m_Book -> GetBasePath() + it -> m_Page); - } - return (foundcnt > 0); -} - - - - - - -void wxHtmlHelpController::CreateHelpWindow() -{ - wxBusyCursor cur; - wxString oldpath; - wxStatusBar *sbar; - - if (m_Frame) { - m_Frame -> Raise(); - m_Frame -> Show(TRUE); - return; - } - -#if wxUSE_BUSYINFO - wxBusyInfo busyinfo(_("Preparing help window...")); -#endif - - if (m_Config) ReadCustomization(m_Config, m_ConfigRoot); - - m_Frame = new wxFrame(NULL, -1, "", wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h)); - m_Frame -> PushEventHandler(this); - sbar = m_Frame -> CreateStatusBar(); - - { - wxToolBar *toolBar; - toolBar = m_Frame -> CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT | wxTB_DOCKABLE); - toolBar -> SetMargins(2, 2); - wxBitmap* toolBarBitmaps[3]; - -#ifdef __WXMSW__ - toolBarBitmaps[0] = new wxBitmap("panel"); - toolBarBitmaps[1] = new wxBitmap("back"); - toolBarBitmaps[2] = new wxBitmap("forward"); - int width = 24; -#else - toolBarBitmaps[0] = new wxBitmap(panel_xpm); - toolBarBitmaps[1] = new wxBitmap(back_xpm); - toolBarBitmaps[2] = new wxBitmap(forward_xpm); - int width = 16; -#endif - - int currentX = 5; - - toolBar -> AddTool(wxID_HTML_PANEL, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _("Show/hide navigation panel")); - currentX += width + 5; - toolBar -> AddSeparator(); - toolBar -> AddTool(wxID_HTML_BACK, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _("Go back to the previous HTML page")); - currentX += width + 5; - toolBar -> AddTool(wxID_HTML_FORWARD, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _("Go forward to the next HTML page")); - currentX += width + 5; - - toolBar -> Realize(); - - // Can delete the bitmaps since they're reference counted - for (int i = 0; i < 3; i++) delete toolBarBitmaps[i]; - } - - - { - m_Splitter = new wxSplitterWindow(m_Frame); - - m_HtmlWin = new wxHtmlWindow(m_Splitter); - m_HtmlWin -> SetRelatedFrame(m_Frame, m_TitleFormat); - m_HtmlWin -> SetRelatedStatusBar(0); - if (m_Config) m_HtmlWin -> ReadCustomization(m_Config, m_ConfigRoot); - - m_NavigPan = new wxNotebook(m_Splitter, wxID_HTML_NOTEBOOK, wxDefaultPosition, wxDefaultSize); - { - m_ContentsBox = new wxTreeCtrl(m_NavigPan, wxID_HTML_TREECTRL, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); - m_ContentsBox -> SetImageList(m_ContentsImageList); - m_NavigPan -> AddPage(m_ContentsBox, _("Contents")); - } - - { - wxWindow *dummy = new wxPanel(m_NavigPan, wxID_HTML_INDEXPAGE); - wxLayoutConstraints *b1 = new wxLayoutConstraints; - b1 -> top.SameAs (dummy, wxTop, 0); - b1 -> left.SameAs (dummy, wxLeft, 0); - b1 -> width.PercentOf (dummy, wxWidth, 100); - b1 -> bottom.SameAs (dummy, wxBottom, 0); - m_IndexBox = new wxListBox(dummy, wxID_HTML_INDEXLIST, wxDefaultPosition, wxDefaultSize, 0); - m_IndexBox -> SetConstraints(b1); - dummy -> SetAutoLayout(TRUE); - m_NavigPan -> AddPage(dummy, _("Index")); - } - - { - wxWindow *dummy = new wxPanel(m_NavigPan, wxID_HTML_SEARCHPAGE); - - wxLayoutConstraints *b1 = new wxLayoutConstraints; - m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT); - b1 -> top.SameAs (dummy, wxTop, 0); - b1 -> left.SameAs (dummy, wxLeft, 0); - b1 -> right.SameAs (dummy, wxRight, 0); - b1 -> height.AsIs(); - m_SearchText -> SetConstraints(b1); - - wxLayoutConstraints *b2 = new wxLayoutConstraints; - m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search!")); - b2 -> top.Below (m_SearchText, 10); - b2 -> right.SameAs (dummy, wxRight, 10); - b2 -> width.AsIs(); - b2 -> height.AsIs(); - m_SearchButton -> SetConstraints(b2); - - wxLayoutConstraints *b3 = new wxLayoutConstraints; - m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, wxDefaultPosition, wxDefaultSize, 0); - b3 -> top.Below (m_SearchButton, 10); - b3 -> left.SameAs (dummy, wxLeft, 0); - b3 -> right.SameAs (dummy, wxRight, 0); - b3 -> bottom.SameAs (dummy, wxBottom, 0); - m_SearchList -> SetConstraints(b3); - - dummy -> SetAutoLayout(TRUE); - dummy -> Layout(); - m_NavigPan -> AddPage(dummy, _("Search")); - } - - RefreshLists(); - m_NavigPan -> Show(TRUE); - m_HtmlWin -> Show(TRUE); - m_Splitter -> SetMinimumPaneSize(20); - m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - if (!m_Cfg.navig_on) m_Splitter -> Unsplit(m_NavigPan); - wxYield(); - } - - m_Frame -> Show(TRUE); - wxYield(); -} - - - -#define MAX_ROOTS 64 - -void wxHtmlHelpController::CreateContents() -{ - HtmlContentsItem *it; - wxTreeItemId roots[MAX_ROOTS]; - bool imaged[MAX_ROOTS]; - int count = m_ContentsCnt; - - m_ContentsBox -> DeleteAllItems(); - roots[0] = m_ContentsBox -> AddRoot(_("(Help)")); - imaged[0] = TRUE; - - for (int i = 0; i < count; i++) { - it = m_Contents + i; - roots[it -> m_Level + 1] = m_ContentsBox -> AppendItem(roots[it -> m_Level], it -> m_Name, IMG_Page, -1, new wxHtmlHelpTreeItemData(it)); - if (it -> m_Level == 0) { - m_ContentsBox -> SetItemBold(roots[1], TRUE); - m_ContentsBox -> SetItemImage(roots[1], IMG_Book); - m_ContentsBox -> SetItemSelectedImage(roots[1], IMG_Book); - imaged[1] = TRUE; - } - else imaged[it -> m_Level + 1] = FALSE; - - if (!imaged[it -> m_Level]) { - m_ContentsBox -> SetItemImage(roots[it -> m_Level], IMG_Folder); - m_ContentsBox -> SetItemSelectedImage(roots[it -> m_Level], IMG_Folder); - imaged[it -> m_Level] = TRUE; - } - } - - m_ContentsBox -> Expand(roots[0]); -} - - - - -void wxHtmlHelpController::CreateIndex() -{ - m_IndexBox -> Clear(); - - for (int i = 0; i < m_IndexCnt; i++) - m_IndexBox -> Append(m_Index[i].m_Name, (char*)(m_Index + i)); -} - - - -void wxHtmlHelpController::RefreshLists() -{ - if (m_Frame) { - CreateContents(); - CreateIndex(); - m_SearchList -> Clear(); - } -} - - - - - - - -void wxHtmlHelpController::ReadCustomization(wxConfigBase *cfg, wxString path) -{ - wxString oldpath; - wxString tmp; - - if (path != wxEmptyString) { - oldpath = cfg -> GetPath(); - cfg -> SetPath(path); - } - - m_Cfg.navig_on = cfg -> Read("hcNavigPanel", m_Cfg.navig_on) != 0; - m_Cfg.sashpos = cfg -> Read("hcSashPos", m_Cfg.sashpos); - m_Cfg.x = cfg -> Read("hcX", m_Cfg.x); - m_Cfg.y = cfg -> Read("hcY", m_Cfg.y); - m_Cfg.w = cfg -> Read("hcW", m_Cfg.w); - m_Cfg.h = cfg -> Read("hcH", m_Cfg.h); - - if (path != wxEmptyString) - cfg -> SetPath(oldpath); -} - - - -void wxHtmlHelpController::WriteCustomization(wxConfigBase *cfg, wxString path) -{ - wxString oldpath; - wxString tmp; - - if (path != wxEmptyString) { - oldpath = cfg -> GetPath(); - cfg -> SetPath(path); - } - - cfg -> Write("hcNavigPanel", m_Cfg.navig_on); - cfg -> Write("hcSashPos", (long)m_Cfg.sashpos); - cfg -> Write("hcX", (long)m_Cfg.x); - cfg -> Write("hcY", (long)m_Cfg.y); - cfg -> Write("hcW", (long)m_Cfg.w); - cfg -> Write("hcH", (long)m_Cfg.h); - - if (path != wxEmptyString) - cfg -> SetPath(oldpath); -} - - - - - -/* -EVENT HANDLING : -*/ - - -void wxHtmlHelpController::OnToolbar(wxCommandEvent& event) -{ - switch (event.GetId()) { - case wxID_HTML_BACK : - m_HtmlWin -> HistoryBack(); - break; - case wxID_HTML_FORWARD : - m_HtmlWin -> HistoryForward(); - break; - case wxID_HTML_PANEL : - if (m_Splitter -> IsSplit()) { - m_Cfg.sashpos = m_Splitter -> GetSashPosition(); - m_Splitter -> Unsplit(m_NavigPan); - } - else { - m_NavigPan -> Show(TRUE); - m_HtmlWin -> Show(TRUE); - m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - break; - } -} - - - -void wxHtmlHelpController::OnContentsSel(wxTreeEvent& event) -{ - wxHtmlHelpTreeItemData *pg; - - pg = (wxHtmlHelpTreeItemData*) m_ContentsBox -> GetItemData(event.GetItem()); - if (pg) m_HtmlWin -> LoadPage(pg -> GetPage()); -} - - - -void wxHtmlHelpController::OnIndexSel(wxCommandEvent& event) -{ - HtmlContentsItem *it = (HtmlContentsItem*) m_IndexBox -> GetClientData(m_IndexBox -> GetSelection()); - if (it) m_HtmlWin -> LoadPage(it -> m_Book -> GetBasePath() + it -> m_Page); -} - - - -void wxHtmlHelpController::OnSearchSel(wxCommandEvent& event) -{ - HtmlContentsItem *it = (HtmlContentsItem*) m_SearchList -> GetClientData(m_SearchList -> GetSelection()); - if (it) m_HtmlWin -> LoadPage(it -> m_Book -> GetBasePath() + it -> m_Page); -} - - - -void wxHtmlHelpController::OnCloseWindow(wxCloseEvent& event) -{ - int a, b; - - m_Cfg.navig_on = m_Splitter -> IsSplit(); - if (m_Cfg.navig_on) - m_Cfg.sashpos = m_Splitter -> GetSashPosition(); - m_Frame -> GetPosition(&a, &b); - m_Cfg.x = a, m_Cfg.y = b; - m_Frame -> GetSize(&a, &b); - m_Cfg.w = a, m_Cfg.h = b; - - if (m_Config) { - WriteCustomization(m_Config, m_ConfigRoot); - m_HtmlWin -> WriteCustomization(m_Config, m_ConfigRoot); - } - m_Frame = NULL; - - event.Skip(); -} - - - -void wxHtmlHelpController::OnSearch(wxCommandEvent& event) -{ - wxString sr = m_SearchText -> GetLineText(0); - - if (sr != wxEmptyString) KeywordSearch(sr); -} - - - -BEGIN_EVENT_TABLE(wxHtmlHelpController, wxEvtHandler) - EVT_TOOL_RANGE(wxID_HTML_PANEL, wxID_HTML_FORWARD, wxHtmlHelpController::OnToolbar) - EVT_TREE_SEL_CHANGED(wxID_HTML_TREECTRL, wxHtmlHelpController::OnContentsSel) - EVT_LISTBOX(wxID_HTML_INDEXLIST, wxHtmlHelpController::OnIndexSel) - EVT_LISTBOX(wxID_HTML_SEARCHLIST, wxHtmlHelpController::OnSearchSel) - EVT_CLOSE(wxHtmlHelpController::OnCloseWindow) - EVT_BUTTON(wxID_HTML_SEARCHBUTTON, wxHtmlHelpController::OnSearch) - EVT_TEXT_ENTER(wxID_HTML_SEARCHTEXT, wxHtmlHelpController::OnSearch) -END_EVENT_TABLE() - - - -#endif - diff --git a/src/html/search.cpp b/src/html/search.cpp deleted file mode 100644 index 85a59a2b2e..0000000000 --- a/src/html/search.cpp +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: search.cpp -// Purpose: search engine -// Author: Vaclav Slavik -// RCS-ID: $Id$ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - - - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "wx/wxprec.h" - -#include "wx/defs.h" -#if wxUSE_HTML - -#ifdef __BORDLANDC__ -#pragma hdrstop -#endif - -#ifndef WXPRECOMP -#endif - -#include "wx/html/helpdata.h" - - -//-------------------------------------------------------------------------------- -// wxSearchEngine -//-------------------------------------------------------------------------------- - -void wxSearchEngine::LookFor(const wxString& keyword) -{ - if (m_Keyword) delete[] m_Keyword; - m_Keyword = new wxChar[keyword.Length() + 1]; - wxStrcpy(m_Keyword, keyword.c_str()); - for (int i = wxStrlen(m_Keyword) - 1; i >= 0; i--) - if ((m_Keyword[i] >= wxT('A')) && (m_Keyword[i] <= wxT('Z'))) - m_Keyword[i] += wxT('a') - wxT('A'); -} - - - -bool wxSearchEngine::Scan(wxInputStream *stream) -{ - wxASSERT_MSG(m_Keyword != NULL, _("wxSearchEngine::LookFor must be called before scanning!")); - - int i, j; - int lng = stream ->GetSize(); - int wrd = wxStrlen(m_Keyword); - bool found = FALSE; - char *buf = new char[lng + 1]; - stream -> Read(buf, lng); - buf[lng] = 0; - - for (i = 0; i < lng; i++) - if ((buf[i] >= 'A') && (buf[i] <= 'Z')) buf[i] += 'a' - 'A'; - - for (i = 0; i < lng - wrd; i++) { - j = 0; - while ((j < wrd) && (buf[i + j] == m_Keyword[j])) j++; - if (j == wrd) {found = TRUE; break;} - } - - delete[] buf; - return found; -} - -#endif diff --git a/src/mac/carbon/Info.plist.in b/src/mac/carbon/Info.plist.in deleted file mode 100644 index 2be3d33364..0000000000 --- a/src/mac/carbon/Info.plist.in +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleIdentifier - org.wxwindows.IDENTIFIER - CFBundleDevelopmentRegion - English - CFBundleExecutable - EXECUTABLE - CFBundleIconFile - wxmac.icns - CFBundleName - EXECUTABLE - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - VERSION - CFBundleShortVersionString - VERSION - CFBundleGetInfoString - EXECUTABLE version VERSION, (c) 2002 wxWindows - CFBundleLongVersionString - VERSION, (c) 2002 wxWindows - NSHumanReadableCopyright - Copyright 2002 wxWindows - LSRequiresCarbon - - CSResourcesFileMapped - - - diff --git a/src/mac/carbon/accel.cpp b/src/mac/carbon/accel.cpp deleted file mode 100644 index 14aa88e53a..0000000000 --- a/src/mac/carbon/accel.cpp +++ /dev/null @@ -1,108 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: accel.cpp -// Purpose: wxAcceleratorTable -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "accel.h" -#endif - -#include "wx/setup.h" -#include "wx/accel.h" -#include "wx/string.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) -#endif - -// ---------------------------------------------------------------------------- -// wxAccelList: a list of wxAcceleratorEntries -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST(wxAcceleratorEntry, wxAccelList); -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxAccelList); - -// ---------------------------------------------------------------------------- -// wxAccelRefData: the data used by wxAcceleratorTable -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData -{ - friend class WXDLLEXPORT wxAcceleratorTable; -public: - wxAcceleratorRefData(); - ~wxAcceleratorRefData(); - - wxAccelList m_accels; -}; - -#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) - -wxAcceleratorRefData::wxAcceleratorRefData() - : m_accels() -{ -} - -wxAcceleratorRefData::~wxAcceleratorRefData() -{ - m_accels.DeleteContents( TRUE ); -} - -wxAcceleratorTable::wxAcceleratorTable() -{ - m_refData = NULL; -} - -wxAcceleratorTable::~wxAcceleratorTable() -{ -} - -// Create from an array -wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) -{ - m_refData = new wxAcceleratorRefData; - - for (int i = 0; i < n; i++) - { - int flag = entries[i].GetFlags(); - int keycode = entries[i].GetKeyCode(); - int command = entries[i].GetCommand(); - if ((keycode >= (int)'a') && (keycode <= (int)'z')) keycode = (int)toupper( (char)keycode ); - M_ACCELDATA->m_accels.Append( new wxAcceleratorEntry( flag, keycode, command ) ); - } -} - -bool wxAcceleratorTable::Ok() const -{ - return (m_refData != NULL); -} - -int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) -{ - if (!Ok()) return -1; - - wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); - while (node) - { - wxAcceleratorEntry *entry = (wxAcceleratorEntry*)node->GetData(); - if ((event.m_keyCode == entry->GetKeyCode()) && - (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && - (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && - (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) - { - return entry->GetCommand(); - } - node = node->GetNext(); - } - - return -1; -} - - diff --git a/src/mac/carbon/aga.cpp b/src/mac/carbon/aga.cpp deleted file mode 100644 index 543fc10137..0000000000 --- a/src/mac/carbon/aga.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// NOT NEEDED ANYMORE - diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp deleted file mode 100644 index 613c323b92..0000000000 --- a/src/mac/carbon/app.cpp +++ /dev/null @@ -1,2439 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp -// Purpose: wxApp -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "app.h" -#endif - -#include "wx/defs.h" - -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/button.h" -#include "wx/app.h" -#include "wx/utils.h" -#include "wx/gdicmn.h" -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/cursor.h" -#include "wx/intl.h" -#include "wx/icon.h" -#include "wx/palette.h" -#include "wx/dc.h" -#include "wx/dialog.h" -#include "wx/msgdlg.h" -#include "wx/log.h" -#include "wx/module.h" -#include "wx/memory.h" -#include "wx/tooltip.h" -#include "wx/textctrl.h" -#include "wx/menu.h" -#include "wx/docview.h" -#include "wx/filename.h" - -#include - -// mac - -#ifndef __DARWIN__ - #if __option(profile) - #include - #endif -#endif - -#include "apprsrc.h" - -#include "wx/mac/uma.h" -#include "wx/mac/macnotfy.h" - -#ifdef __DARWIN__ -# include -# if defined(WXMAKINGDLL_CORE) -# include -# endif -#else -# include -# include -# include -# include -# include -#endif - -extern wxList wxPendingDelete; -extern wxList *wxWinMacWindowList; -extern wxList *wxWinMacControlList; -#if wxUSE_THREADS -extern size_t g_numberOfThreads; -#endif // wxUSE_THREADS - -// statics for implementation - -static bool s_inYield = FALSE; - -#if TARGET_CARBON -static bool s_inReceiveEvent = FALSE ; -static EventTime sleepTime = kEventDurationNoWait ; -#else -static long sleepTime = 0 ; -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) -BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) - EVT_END_SESSION(wxApp::OnEndSession) - EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession) -END_EVENT_TABLE() -#endif - - -const short kMacMinHeap = (29 * 1024) ; -// platform specific static variables - -const short kwxMacMenuBarResource = 1 ; -const short kwxMacAppleMenuId = 1 ; - -WXHRGN wxApp::s_macCursorRgn = NULL; -wxWindow* wxApp::s_captureWindow = NULL ; -int wxApp::s_lastMouseDown = 0 ; -long wxApp::sm_lastMessageTime = 0; -long wxApp::s_lastModifiers = 0 ; - - -bool wxApp::s_macSupportPCMenuShortcuts = true ; -long wxApp::s_macAboutMenuItemId = wxID_ABOUT ; -long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ; -long wxApp::s_macExitMenuItemId = wxID_EXIT ; -wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ; - -// Normally we're not a plugin -bool wxApp::sm_isEmbedded = false; -//---------------------------------------------------------------------- -// Core Apple Event Support -//---------------------------------------------------------------------- - -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleRApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ; - -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ; -} - -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ; -} - -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ; -} - -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ; -} - -pascal OSErr AEHandleRApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAERApp( (AppleEvent*) event , reply) ; -} - -// AEODoc Calls MacOpenFile on each of the files passed - -short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) -{ - AEDescList docList; - AEKeyword keywd; - DescType returnedType; - Size actualSize; - long itemsInList; - FSSpec theSpec; - OSErr err; - short i; - err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); - if (err != noErr) - return err; - - err = AECountItems(&docList, &itemsInList); - if (err != noErr) - return err; - - ProcessSerialNumber PSN ; - PSN.highLongOfPSN = 0 ; - PSN.lowLongOfPSN = kCurrentProcess ; - SetFrontProcess( &PSN ) ; - - for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); - MacOpenFile(fName); - } - return noErr; -} - -// AEPDoc Calls MacPrintFile on each of the files passed - -short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply)) -{ - AEDescList docList; - AEKeyword keywd; - DescType returnedType; - Size actualSize; - long itemsInList; - FSSpec theSpec; - OSErr err; - short i; - err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); - if (err != noErr) - return err; - - err = AECountItems(&docList, &itemsInList); - if (err != noErr) - return err; - - ProcessSerialNumber PSN ; - PSN.highLongOfPSN = 0 ; - PSN.lowLongOfPSN = kCurrentProcess ; - SetFrontProcess( &PSN ) ; - - for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); - MacPrintFile(fName); - } - return noErr; -} - -// AEOApp calls MacNewFile - -short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - MacNewFile() ; - return noErr ; -} - -// AEQuit attempts to quit the application - -short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - wxWindow* win = GetTopWindow() ; - if ( win ) - { - wxCommandEvent exitEvent(wxEVT_COMMAND_MENU_SELECTED, s_macExitMenuItemId); - if (!win->ProcessEvent(exitEvent)) - win->Close(TRUE ) ; - } - else - { - ExitMainLoop() ; - } - return noErr ; -} - -// AEROApp calls MacReopenApp - -short wxApp::MacHandleAERApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - MacReopenApp() ; - return noErr ; -} - - -//---------------------------------------------------------------------- -// Support Routines linking the Mac...File Calls to the Document Manager -//---------------------------------------------------------------------- - -void wxApp::MacOpenFile(const wxString & fileName ) -{ - wxDocManager* dm = wxDocManager::GetDocumentManager() ; - if ( dm ) - dm->CreateDocument(fileName , wxDOC_SILENT ) ; -} - -void wxApp::MacPrintFile(const wxString & fileName ) -{ - wxDocManager* dm = wxDocManager::GetDocumentManager() ; - if ( dm ) - { - wxDocument *doc = dm->CreateDocument(fileName , wxDOC_SILENT ) ; - if ( doc ) - { - wxView* view = doc->GetFirstView() ; - if( view ) - { - wxPrintout *printout = view->OnCreatePrintout(); - if (printout) - { - wxPrinter printer; - printer.Print(view->GetFrame(), printout, TRUE); - delete printout; - } - } - if (doc->Close()) - { - doc->DeleteAllViews(); - dm->RemoveDocument(doc) ; - } - } - } -} - -void wxApp::MacNewFile() -{ -} - -void wxApp::MacReopenApp() -{ - // eventually check for open docs, if none, call MacNewFile -} - -//---------------------------------------------------------------------- -// Carbon Event Handler -//---------------------------------------------------------------------- - -#if TARGET_CARBON - - static const EventTypeSpec eventList[] = - { - { kEventClassCommand, kEventProcessCommand } , - { kEventClassCommand, kEventCommandUpdateStatus } , - - { kEventClassMenu, kEventMenuOpening }, - { kEventClassMenu, kEventMenuClosed }, - { kEventClassMenu, kEventMenuTargetItem }, - - { kEventClassApplication , kEventAppActivated } , - { kEventClassApplication , kEventAppDeactivated } , - // handling the quit event is not recommended by apple - // rather using the quit apple event - which we do - - { kEventClassAppleEvent , kEventAppleEvent } , - - { kEventClassMouse , kEventMouseDown } , - { kEventClassMouse , kEventMouseMoved } , - { kEventClassMouse , kEventMouseUp } , - { kEventClassMouse , kEventMouseDragged } , - { 'WXMC' , 'WXMC' } - } ; - -static pascal OSStatus -MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar(); - - if ( mbar ) - { - wxFrame* win = mbar->GetFrame(); - if ( win ) - { - - // VZ: we could find the menu from its handle here by examining all - // the menus in the menu bar recursively but knowing that neither - // wxMSW nor wxGTK do it why bother... - #if 0 - MenuRef menuRef; - - GetEventParameter(event, - kEventParamDirectObject, - typeMenuRef, NULL, - sizeof(menuRef), NULL, - &menuRef); - #endif // 0 - - wxEventType type=0; - MenuCommand cmd=0; - switch (GetEventKind(event)) - { - case kEventMenuOpening: - type = wxEVT_MENU_OPEN; - break; - case kEventMenuClosed: - type = wxEVT_MENU_CLOSE; - break; - case kEventMenuTargetItem: - type = wxEVT_MENU_HIGHLIGHT; - GetEventParameter(event, kEventParamMenuCommand, - typeMenuCommand, NULL, - sizeof(cmd), NULL, &cmd); - if (cmd == 0) return eventNotHandledErr; - break; - default: - wxFAIL_MSG(wxT("Unexpected menu event kind")); - break; - } - - wxMenuEvent wxevent(type, cmd); - wxevent.SetEventObject(win); - - (void)win->GetEventHandler()->ProcessEvent(wxevent); - } - } - - return eventNotHandledErr; -} - -// due to the rather low-level event API of wxWindows, we cannot use RunApplicationEventLoop -// but have to use ReceiveNextEvent dealing with events manually, therefore we also have -// deal with clicks in the menu bar explicitely - -pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ; - -static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - Point point ; - UInt32 modifiers = 0; - EventMouseButton button = 0 ; - UInt32 click = 0 ; - - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &modifiers ); - GetEventParameter( event, kEventParamMouseButton, typeMouseButton, NULL, - sizeof( EventMouseButton ), NULL, &button ); - GetEventParameter( event, kEventParamClickCount, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &click ); - - if ( button == 0 || GetEventKind( event ) == kEventMouseUp ) - modifiers += btnState ; - - - switch( GetEventKind(event) ) - { - case kEventMouseDown : - { - WindowRef window ; - - short windowPart = ::FindWindow(point, &window); - - if ( windowPart == inMenuBar ) - { - MenuSelect( point ) ; - result = noErr ; - } - } - break ; - case kEventMouseDragged : - case kEventMouseUp : - { - if ( wxTheApp->s_captureWindow ) - wxMacWindowEventHandler( handler , event , (void*) wxTheApp->s_captureWindow->MacGetTopLevelWindow() ) ; - } - break ; - case kEventMouseMoved : - { - wxTheApp->MacHandleMouseMovedEvent( point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - } - break ; - } - - return result ; -} - -static pascal OSStatus CommandEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - HICommand command ; - - GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, - sizeof( HICommand ), NULL, &command ); - - MenuCommand id = command.commandID ; - if ( id == kHICommandPreferences ) - id = wxApp::s_macPreferencesMenuItemId ; - - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; - wxMenu* menu = NULL ; - wxMenuItem* item = NULL ; - - if ( mbar ) - { - item = mbar->FindItem( id , &menu ) ; - // it is not 100 % sure that an menu of id 0 is really ours, safety check - if ( id == 0 && menu != NULL && menu->GetHMenu() != command.menu.menuRef ) - { - item = NULL ; - menu = NULL ; - } - } - - if ( item == NULL || menu == NULL || mbar == NULL ) - return result ; - - switch( GetEventKind( event ) ) - { - case kEventProcessCommand : - { - if (item->IsCheckable()) - { - item->Check( !item->IsChecked() ) ; - } - - menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; - result = noErr ; - } - break ; - case kEventCommandUpdateStatus: - // eventually trigger an updateui round - result = noErr ; - break ; - default : - break ; - } - - return result ; -} - -static pascal OSStatus ApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - switch ( GetEventKind( event ) ) - { - case kEventAppActivated : - { - if ( wxTheApp ) - wxTheApp->MacResume( true ) ; - result = noErr ; - } - break ; - case kEventAppDeactivated : - { - if ( wxTheApp ) - wxTheApp->MacSuspend( true ) ; - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} - -pascal OSStatus wxAppEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - switch( GetEventClass( event ) ) - { - case kEventClassCommand : - result = CommandEventHandler( handler , event , data ) ; - break ; - case kEventClassApplication : - result = ApplicationEventHandler( handler , event , data ) ; - break ; - case kEventClassMenu : - result = MenuEventHandler( handler , event , data ) ; - break ; - case kEventClassMouse : - result = MouseEventHandler( handler , event , data ) ; - break ; - case kEventClassAppleEvent : - { - EventRecord rec ; - wxMacConvertEventToRecord( event , &rec ) ; - result = AEProcessAppleEvent( &rec ) ; - } - break ; - default : - break ; - } - - return result ; -} - -DEFINE_ONE_SHOT_HANDLER_GETTER( wxAppEventHandler ) - -#endif - -#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__) -// we know it's there ;-) -WXIMPORT char std::__throws_bad_alloc ; -#endif - -bool wxApp::Initialize(int& argc, wxChar **argv) -{ - int error = 0 ; - - // Mac-specific - - UMAInitToolbox( 4, sm_isEmbedded ) ; - SetEventMask( everyEvent ) ; - UMAShowWatchCursor() ; - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // open shared library resources from here since we don't have - // __wxinitialize in Mach-O shared libraries - wxStAppResource::OpenSharedLibraryResource(NULL); -#endif - -#ifndef __DARWIN__ - // test the minimal configuration necessary - -# if !TARGET_CARBON - long theSystem ; - long theMachine; - - if (Gestalt(gestaltMachineType, &theMachine) != noErr) - { - error = kMacSTRWrongMachine; - } - else if (theMachine < gestaltMacPlus) - { - error = kMacSTRWrongMachine; - } - else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr ) - { - error = kMacSTROldSystem ; - } - else if ( theSystem < 0x0860 ) - { - error = kMacSTROldSystem ; - } - else if ((long)GetApplLimit() - (long)ApplicationZone() < kMacMinHeap) - { - error = kMacSTRSmallSize; - } -# endif - /* - else - { - if ( !UMAHasAppearance() ) - { - error = kMacSTRNoPre8Yet ; - } - } - */ -#endif - - // if we encountered any problems so far, give the error code and exit immediately - - if ( error ) - { - wxStAppResource resload ; - short itemHit; - Str255 message; - - GetIndString(message, 128, error); - UMAShowArrowCursor() ; - ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p"); - itemHit = Alert(128, nil); - return FALSE ; - } - -#ifndef __DARWIN__ -# if __option(profile) - ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ; -# endif -#endif - -#ifndef __DARWIN__ - // now avoid exceptions thrown for new (bad_alloc) - // FIXME CS for some changes outside wxMac does not compile anymore -#if 0 - std::__throws_bad_alloc = 0 ; -#endif - -#endif - - s_macCursorRgn = ::NewRgn() ; - - // Mac OS X passes a process serial number command line argument when - // the application is launched from the Finder. This argument must be - // removed from the command line arguments before being handled by the - // application (otherwise applications would need to handle it) - if ( argc > 1 ) - { - static const wxChar *ARG_PSN = _T("-psn_"); - if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) - { - // remove this argument - --argc; - memmove(argv + 1, argv + 2, argc * sizeof(char *)); - } - } - - if ( !wxAppBase::Initialize(argc, argv) ) - return false; - -#if wxUSE_INTL - wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); -#endif - - - wxWinMacWindowList = new wxList(wxKEY_INTEGER); - wxWinMacControlList = new wxList(wxKEY_INTEGER); - - wxMacCreateNotifierTable() ; - - UMAShowArrowCursor() ; - - return true; -} - -bool wxApp::OnInitGui() -{ - if( !wxAppBase::OnInitGui() ) - return false ; - -#if TARGET_CARBON - InstallStandardEventHandler( GetApplicationEventTarget() ) ; - - if (!sm_isEmbedded) - { - InstallApplicationEventHandler( - GetwxAppEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, wxTheApp, (EventHandlerRef *)&(wxTheApp->m_macEventHandler)); - } -#endif - - if (!sm_isEmbedded) - { -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , - NewAEEventHandlerUPP(AEHandleODoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , - NewAEEventHandlerUPP(AEHandleOApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , - NewAEEventHandlerUPP(AEHandlePDoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEReopenApplication , - NewAEEventHandlerUPP(AEHandleRApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , - NewAEEventHandlerUPP(AEHandleQuit) , - 0 , FALSE ) ; -#else - AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , - NewAEEventHandlerProc(AEHandleODoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , - NewAEEventHandlerProc(AEHandleOApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , - NewAEEventHandlerProc(AEHandlePDoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEReopenApplication , - NewAEEventHandlerProc(AEHandleRApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , - NewAEEventHandlerProc(AEHandleQuit) , - 0 , FALSE ) ; -#endif - } - - return TRUE ; -} - -void wxApp::CleanUp() -{ - wxToolTip::RemoveToolTips() ; - - // One last chance for pending objects to be cleaned up - wxTheApp->DeletePendingObjects(); - - wxMacDestroyNotifierTable() ; - - delete wxWinMacWindowList ; - wxWinMacWindowList = NULL; - - delete wxWinMacControlList ; - wxWinMacControlList = NULL; - -#ifndef __DARWIN__ -# if __option(profile) - ProfilerDump( (StringPtr)"\papp.prof" ) ; - ProfilerTerm() ; -# endif -#endif - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // close shared library resources from here since we don't have - // __wxterminate in Mach-O shared libraries - wxStAppResource::CloseSharedLibraryResource(); -#endif - - UMACleanupToolbox() ; - if (s_macCursorRgn) { - ::DisposeRgn((RgnHandle)s_macCursorRgn); - } - - #if 0 - TerminateAE() ; - #endif - - wxAppBase::CleanUp(); -} - -//---------------------------------------------------------------------- -// misc initialization stuff -//---------------------------------------------------------------------- - -// extern variable for shared library resource id -// need to be able to find it with NSLookupAndBindSymbol -short gSharedLibraryResource = kResFileNotOpened ; - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) -CFBundleRef gSharedLibraryBundle = NULL; -#endif /* WXMAKINGDLL_CORE && __DARWIN__ */ - -wxStAppResource::wxStAppResource() -{ - m_currentRefNum = CurResFile() ; - if ( gSharedLibraryResource != kResFileNotOpened ) - { - UseResFile( gSharedLibraryResource ) ; - } -} - -wxStAppResource::~wxStAppResource() -{ - if ( m_currentRefNum != kResFileNotOpened ) - { - UseResFile( m_currentRefNum ) ; - } -} - -void wxStAppResource::OpenSharedLibraryResource(const void *initBlock) -{ - gSharedLibraryResource = kResFileNotOpened; - -#ifdef WXMAKINGDLL_CORE - if ( initBlock != NULL ) { - const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock; - FSSpec *fileSpec = NULL; - - if (theInitBlock->fragLocator.where == kDataForkCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec; - } - else if (theInitBlock->fragLocator.where == kResourceCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec; - } - - if (fileSpec != NULL) { - gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm); - } - } - else { -#ifdef __DARWIN__ - // Open the shared library resource file if it is not yet open - NSSymbol theSymbol; - NSModule theModule; - const char *theLibPath; - - gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows")); - if (gSharedLibraryBundle != NULL) { - // wxWindows has been bundled into a framework - // load the framework resources - - gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle); - } - else { - // wxWindows is a simple dynamic shared library - // load the resources from the data fork of a separate resource file - wxString theResPath; - wxString theName; - FSRef theResRef; - OSErr theErr = noErr; - - // get the library path - theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource"); - theModule = NSModuleForSymbol(theSymbol); - theLibPath = NSLibraryNameForModule(theModule); - - // if we call wxLogDebug from here then, as wxTheApp hasn't been - // created yet when we're called from wxApp::Initialize(), wxLog - // is going to create a default stderr-based log target instead of - // the expected normal GUI one -- don't do it, if we really want - // to see this message just use fprintf() here -#if 0 - wxLogDebug( wxT("wxMac library installation name is '%s'"), - theLibPath ); -#endif - - // allocate copy to replace .dylib.* extension with .rsrc - if (theLibPath != NULL) { -#if wxUSE_UNICODE - theResPath = wxString(theLibPath, wxConvLocal); -#else - theResPath = wxString(theLibPath); -#endif - // replace '_core' with '' in case of multi-lib build - theResPath.Replace(wxT("_core"), wxEmptyString); - // replace ".dylib" shared library extension with ".rsrc" - theResPath.Replace(wxT(".dylib"), wxT(".rsrc")); - // Find the begining of the filename - theName = theResPath.AfterLast('/'); - -#if 0 - wxLogDebug( wxT("wxMac resources file name is '%s'"), - theResPath.mb_str() ); -#endif - - theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false); - if (theErr != noErr) { - // try in current directory (using name only) - theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false); - } - - // open the resource file - if (theErr == noErr) { - theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm, - &gSharedLibraryResource); - } - if (theErr != noErr) { -#ifdef __WXDEBUG__ - wxLogDebug( wxT("unable to open wxMac resource file '%s'\n"), - theResPath.mb_str() ); -#endif // __WXDEBUG__ - } - - } - } -#endif /* __DARWIN__ */ - } -#endif /* WXMAKINGDLL_CORE */ -} - -void wxStAppResource::CloseSharedLibraryResource() -{ -#ifdef WXMAKINGDLL_CORE - // Close the shared library resource file - if (gSharedLibraryResource != kResFileNotOpened) { -#ifdef __DARWIN__ - if (gSharedLibraryBundle != NULL) { - CFBundleCloseBundleResourceMap(gSharedLibraryBundle, - gSharedLibraryResource); - gSharedLibraryBundle = NULL; - } - else -#endif /* __DARWIN__ */ - { - CloseResFile(gSharedLibraryResource); - } - gSharedLibraryResource = kResFileNotOpened; - } -#endif /* WXMAKINGDLL_CORE */ -} - -#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__) - -// for shared libraries we have to manually get the correct resource -// ref num upon initializing and releasing when terminating, therefore -// the __wxinitialize and __wxterminate must be used - -extern "C" { - void __sinit(void); /* (generated by linker) */ - pascal OSErr __initialize(const CFragInitBlock *theInitBlock); - pascal void __terminate(void); -} - -pascal OSErr __wxinitialize(const CFragInitBlock *theInitBlock) -{ - wxStAppResource::OpenSharedLibraryResource( theInitBlock ) ; - return __initialize( theInitBlock ) ; -} - -pascal void __wxterminate(void) -{ - wxStAppResource::CloseSharedLibraryResource() ; - __terminate() ; -} - -#endif /* WXMAKINGDLL_CORE && !__DARWIN__ */ - -#if TARGET_CARBON - -bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec) -{ - bool converted = ConvertEventRefToEventRecord( event,rec) ; - OSStatus err = noErr ; - if ( !converted ) - { - switch( GetEventClass( event ) ) - { - case kEventClassKeyboard : - { - converted = true ; - switch( GetEventKind(event) ) - { - case kEventRawKeyDown : - rec->what = keyDown ; - break ; - case kEventRawKeyRepeat : - rec->what = autoKey ; - break ; - case kEventRawKeyUp : - rec->what = keyUp ; - break ; - case kEventRawKeyModifiersChanged : - rec->what = nullEvent ; - break ; - default : - converted = false ; - break ; - } - if ( converted ) - { - UInt32 keyCode ; - unsigned char charCode ; - UInt32 modifiers ; - GetMouse( &rec->where) ; - - err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers); - err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode); - err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode); - rec->modifiers = modifiers ; - rec->message = (keyCode << 8 ) + charCode ; - } - } - break ; - case kEventClassTextInput : - { - switch( GetEventKind( event ) ) - { - case kEventTextInputUnicodeForKeyEvent : - { - EventRef rawEvent ; - err = GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ; - converted = true ; - { - UInt32 keyCode ; - unsigned char charCode ; - UInt32 modifiers ; - GetMouse( &rec->where) ; - rec->what = keyDown ; - err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers); - err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode); - err = GetEventParameter(rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode); - rec->modifiers = modifiers ; - rec->message = (keyCode << 8 ) + charCode ; - } - } - break ; - default : - break ; - } - } - break ; - } - } - - return converted ; -} - -/* -pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - EventRecord rec ; - switch ( GetEventClass( event ) ) - { - case kEventClassKeyboard : - if ( wxMacConvertEventToRecord( event , &rec ) ) - { - wxTheApp->MacHandleModifierEvents( &rec ) ; - wxTheApp->MacHandleOneEvent( &rec ) ; - result = noErr ; - } - break ; - case kEventClassTextInput : - if ( wxMacConvertEventToRecord( event , &rec ) ) - { - wxTheApp->MacHandleModifierEvents( &rec ) ; - wxTheApp->MacHandleOneEvent( &rec ) ; - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} -*/ -#endif - -wxApp::wxApp() -{ - m_printMode = wxPRINT_WINDOWS; - m_auto3D = TRUE; - - m_macCurrentEvent = NULL ; -#if TARGET_CARBON - m_macCurrentEventHandlerCallRef = NULL ; -#endif -} - -int wxApp::MainLoop() -{ - m_keepGoing = TRUE; - - while (m_keepGoing) - { - MacDoOneEvent() ; - } - - return 0; -} - -void wxApp::ExitMainLoop() -{ - m_keepGoing = FALSE; -} - -// Is a message/event pending? -bool wxApp::Pending() -{ -#if TARGET_CARBON - // without the receive event (with pull param = false ) nothing is ever reported - EventRef theEvent; - ReceiveNextEvent (0, NULL, kEventDurationNoWait, false, &theEvent); - return GetNumEventsInQueue( GetMainEventQueue() ) > 0 ; -#else - EventRecord event ; - - return EventAvail( everyEvent , &event ) ; -#endif -} - -// Dispatch a message. -bool wxApp::Dispatch() -{ - MacDoOneEvent() ; - - return true; -} - -void wxApp::OnIdle(wxIdleEvent& event) -{ - wxAppBase::OnIdle(event); - - // If they are pending events, we must process them: pending events are - // either events to the threads other than main or events posted with - // wxPostEvent() functions - wxMacProcessNotifierAndPendingEvents(); - - if(!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar()) - wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar(); -} - -void wxApp::WakeUpIdle() -{ - wxMacWakeUp() ; -} - -void wxApp::Exit() -{ - wxApp::CleanUp(); - ::ExitToShell() ; -} - -void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event)) -{ - if (GetTopWindow()) - GetTopWindow()->Close(TRUE); -} - -// Default behaviour: close the application with prompts. The -// user can veto the close, and therefore the end session. -void wxApp::OnQueryEndSession(wxCloseEvent& event) -{ - if (GetTopWindow()) - { - if (!GetTopWindow()->Close(!event.CanVeto())) - event.Veto(TRUE); - } -} - -extern "C" void wxCYield() ; -void wxCYield() -{ - wxYield() ; -} - -// Yield to other processes - -bool wxApp::Yield(bool onlyIfNeeded) -{ - if (s_inYield) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } - - return FALSE; - } - - s_inYield = TRUE; - -#if wxUSE_THREADS - YieldToAnyThread() ; -#endif - // by definition yield should handle all non-processed events -#if TARGET_CARBON - EventRef theEvent; - - OSStatus status = noErr ; - do - { - s_inReceiveEvent = true ; - status = ReceiveNextEvent(0, NULL,kEventDurationNoWait,true,&theEvent) ; - s_inReceiveEvent = false ; - - if ( status == eventLoopTimedOutErr ) - { - // make sure next time the event loop will trigger idle events - sleepTime = kEventDurationNoWait ; - } - else if ( status == eventLoopQuitErr ) - { - // according to QA1061 this may also occur when a WakeUp Process - // is executed - } - else - { - MacHandleOneEvent( theEvent ) ; - ReleaseEvent(theEvent); - } - } while( status == noErr ) ; -#else - EventRecord event ; - - // having a larger value here leads to large performance slowdowns - // so we cannot give background apps more processor time here - // we do so however having a large sleep value in the main event loop - sleepTime = 0 ; - - while ( !IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, (RgnHandle) wxApp::s_macCursorRgn)) - { - MacHandleModifierEvents( &event ) ; - MacHandleOneEvent( &event ); - if ( event.what != kHighLevelEvent ) - SetRectRgn( (RgnHandle) wxApp::s_macCursorRgn , event.where.h , event.where.v , event.where.h + 1 , event.where.v + 1 ) ; - } - MacHandleModifierEvents( &event ) ; -#endif - - wxMacProcessNotifierAndPendingEvents() ; - s_inYield = FALSE; - - return TRUE; -} - -// platform specifics - -void wxApp::MacSuspend( bool convertClipboard ) -{ -#if !TARGET_CARBON - // we have to deactive the top level windows manually - - wxWindowListNode* node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data(); -#if TARGET_CARBON -#if 0 // having problems right now with that - if (!win->HasFlag(wxSTAY_ON_TOP)) -#endif -#endif - win->MacActivate( ((EventRecord*) MacGetCurrentEvent())->when , false ) ; - - node = node->GetNext(); - } - - ::HideFloatingWindows() ; -#endif - s_lastMouseDown = 0 ; - - if( convertClipboard ) - { - MacConvertPrivateToPublicScrap() ; - } -} - -extern wxList wxModalDialogs; - -void wxApp::MacResume( bool convertClipboard ) -{ - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPublicToPrivateScrap() ; - } - -#if !TARGET_CARBON - ::ShowFloatingWindows() ; - // raise modal dialogs in case a non modal window was selected to activate the app - - wxNode* node = wxModalDialogs.GetFirst(); - while (node) - { - wxDialog* dialog = (wxDialog *) node->GetData(); - dialog->Raise(); - - node = node->GetNext(); - } -#endif -} - -void wxApp::MacConvertPrivateToPublicScrap() -{ -} - -void wxApp::MacConvertPublicToPrivateScrap() -{ -} - -void wxApp::MacDoOneEvent() -{ -#if TARGET_CARBON - EventRef theEvent; - - s_inReceiveEvent = true ; - OSStatus status = ReceiveNextEvent(0, NULL,sleepTime,true,&theEvent) ; - s_inReceiveEvent = false ; - if ( status == eventLoopTimedOutErr ) - { - if ( wxTheApp->ProcessIdle() ) - sleepTime = kEventDurationNoWait ; - else - { -#if wxUSE_THREADS - if (g_numberOfThreads) - { - sleepTime = kEventDurationNoWait; - } - else -#endif // wxUSE_THREADS - { - sleepTime = kEventDurationSecond; - } - } - } - else if ( status == eventLoopQuitErr ) - { - // according to QA1061 this may also occur when a WakeUp Process - // is executed - } - else - { - MacHandleOneEvent( theEvent ) ; - ReleaseEvent(theEvent); - sleepTime = kEventDurationNoWait ; - } -#else - EventRecord event ; - - EventMask eventMask = everyEvent ; - - if (WaitNextEvent(eventMask, &event, sleepTime, (RgnHandle) s_macCursorRgn)) - { - MacHandleModifierEvents( &event ) ; - MacHandleOneEvent( &event ); - } - else - { - MacHandleModifierEvents( &event ) ; - // idlers - WindowPtr window = ::FrontWindow() ; - if ( window ) - ::IdleControls( window ) ; - - if ( wxTheApp->ProcessIdle() ) - sleepTime = kEventDurationNoWait; - else - { -#if wxUSE_THREADS - if (g_numberOfThreads) - { - sleepTime = kEventDurationNoWait; - } - else -#endif // wxUSE_THREADS - { - sleepTime = kEventDurationSecond; - } - } - } - if ( event.what != kHighLevelEvent ) - SetRectRgn( (RgnHandle) s_macCursorRgn , event.where.h , event.where.v , event.where.h + 1 , event.where.v + 1 ) ; -#endif - // repeaters - - DeletePendingObjects() ; - wxMacProcessNotifierAndPendingEvents() ; -} - -/*virtual*/ void wxApp::MacHandleUnhandledEvent( WXEVENTREF evr ) -{ - // Override to process unhandled events as you please -} - -void wxApp::MacHandleOneEvent( WXEVENTREF evr ) -{ -#if TARGET_CARBON - EventTargetRef theTarget; - theTarget = GetEventDispatcherTarget(); - m_macCurrentEvent = evr ; - OSStatus status = SendEventToEventTarget ((EventRef) evr , theTarget); - if(status == eventNotHandledErr) - { - MacHandleUnhandledEvent(evr); - } -#else - EventRecord* ev = (EventRecord*) evr ; - m_macCurrentEvent = ev ; - - wxApp::sm_lastMessageTime = ev->when ; - - switch (ev->what) - { - case mouseDown: - MacHandleMouseDownEvent( ev ) ; - if ( ev->modifiers & controlKey ) - s_lastMouseDown = 2; - else - s_lastMouseDown = 1; - break; - case mouseUp: - if ( s_lastMouseDown == 2 ) - { - ev->modifiers |= controlKey ; - } - else - { - ev->modifiers &= ~controlKey ; - } - MacHandleMouseUpEvent( ev ) ; - s_lastMouseDown = 0; - break; - case activateEvt: - MacHandleActivateEvent( ev ) ; - break; - case updateEvt: - // In embedded mode we first let the UnhandledEvent function - // try to handle the update event. If we handle it ourselves - // first and then pass it on, the host's windows won't update. - MacHandleUnhandledEvent(ev); - MacHandleUpdateEvent( ev ) ; - break; - case keyDown: - case autoKey: - MacHandleKeyDownEvent( ev ) ; - break; - case keyUp: - MacHandleKeyUpEvent( ev ) ; - break; - case diskEvt: - MacHandleDiskEvent( ev ) ; - break; - case osEvt: - MacHandleOSEvent( ev ) ; - break; - case kHighLevelEvent: - MacHandleHighLevelEvent( ev ) ; - break; - default: - break; - } -#endif - wxMacProcessNotifierAndPendingEvents() ; -} - -#if !TARGET_CARBON -bool s_macIsInModalLoop = false ; - -void wxApp::MacHandleModifierEvents( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - if ( ev->modifiers != s_lastModifiers && wxWindow::FindFocus() != NULL ) - { - wxKeyEvent event(wxEVT_KEY_DOWN); - - event.m_shiftDown = ev->modifiers & shiftKey; - event.m_controlDown = ev->modifiers & controlKey; - event.m_altDown = ev->modifiers & optionKey; - event.m_metaDown = ev->modifiers & cmdKey; - - event.m_x = ev->where.h; - event.m_y = ev->where.v; - event.m_timeStamp = ev->when; - wxWindow* focus = wxWindow::FindFocus() ; - event.SetEventObject(focus); - - if ( (ev->modifiers ^ s_lastModifiers ) & controlKey ) - { - event.m_keyCode = WXK_CONTROL ; - event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey ) - { - event.m_keyCode = WXK_SHIFT ; - event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( (ev->modifiers ^ s_lastModifiers ) & optionKey ) - { - event.m_keyCode = WXK_ALT ; - event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( ( ev->modifiers ^ s_lastModifiers ) & cmdKey ) - { - event.m_keyCode = WXK_COMMAND ; - event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - s_lastModifiers = ev->modifiers ; - } -} - -void wxApp::MacHandleHighLevelEvent( WXEVENTREF evr ) -{ - // we must avoid reentrancy problems when processing high level events eg printing - bool former = s_inYield ; - s_inYield = TRUE ; - EventRecord* ev = (EventRecord*) evr ; - ::AEProcessAppleEvent( ev ) ; - s_inYield = former ; -} - -void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - WindowRef window; - WindowRef frontWindow = ::FrontNonFloatingWindow() ; - WindowAttributes frontWindowAttributes = NULL ; - if ( frontWindow ) - ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ; - - short windowPart = ::FindWindow(ev->where, &window); - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( wxPendingDelete.Member(win) ) - return ; - - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - switch (windowPart) - { - case inMenuBar : - if ( s_macIsInModalLoop ) - { - SysBeep ( 30 ) ; - } - else - { - UInt32 menuresult = MenuSelect(ev->where) ; - MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ); - s_lastMouseDown = 0; - } - break ; - case inSysWindow : - SystemClick( ev , window ) ; - s_lastMouseDown = 0; - break ; - case inDrag : - if ( window != frontWindow && s_macIsInModalLoop && !(ev->modifiers & cmdKey ) ) - { - SysBeep ( 30 ) ; - } - else - { - DragWindow(window, ev->where, &screenBits.bounds); - if (win) - { - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort(window) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - win->SetSize( pt.h , pt.v , -1 , - -1 , wxSIZE_USE_EXISTING); - } - s_lastMouseDown = 0; - } - break ; - case inGoAway: - if (TrackGoAway(window, ev->where)) - { - if ( win ) - win->Close() ; - } - s_lastMouseDown = 0; - break; - case inGrow: - { - Rect newContentRect ; - Rect constraintRect ; - constraintRect.top = win->GetMinHeight() ; - if ( constraintRect.top == -1 ) - constraintRect.top = 0 ; - constraintRect.left = win->GetMinWidth() ; - if ( constraintRect.left == -1 ) - constraintRect.left = 0 ; - constraintRect.right = win->GetMaxWidth() ; - if ( constraintRect.right == -1 ) - constraintRect.right = 32000 ; - constraintRect.bottom = win->GetMaxHeight() ; - if ( constraintRect.bottom == -1 ) - constraintRect.bottom = 32000 ; - - Boolean growResult = ResizeWindow( window , ev->where , - &constraintRect , &newContentRect ) ; - if ( growResult ) - { - win->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - } - s_lastMouseDown = 0; - } - break; - case inZoomIn: - case inZoomOut: - if (TrackBox(window, ev->where, windowPart)) - { - // TODO setup size event - ZoomWindow( window , windowPart , false ) ; - if (win) - { - Rect tempRect ; - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort(window) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - - GetWindowPortBounds(window, &tempRect ) ; - win->SetSize( pt.h , pt.v , tempRect.right-tempRect.left , - tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); - } - } - s_lastMouseDown = 0; - break; - case inCollapseBox : - // TODO setup size event - s_lastMouseDown = 0; - break ; - - case inContent : - { - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort(window) ; - SetPort( port ) ; - } - if ( window != frontWindow && wxTheApp->s_captureWindow == NULL ) - { - if ( s_macIsInModalLoop ) - { - SysBeep ( 30 ) ; - } - else if ( UMAIsWindowFloating( window ) ) - { - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - else - { - // Activate window first - ::SelectWindow( window ) ; - - // Send event later - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - } - else - { - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - break ; - default: - break; - } -} - -void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window; - - short windowPart = inNoWindow ; - if ( wxTheApp->s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - windowPart = ::FindWindow(ev->where, &window) ; - } - - switch (windowPart) - { - case inMenuBar : - break ; - case inSysWindow : - break ; - default: - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacMouseUp( ev , windowPart ) ; - } - break; - } -} - -#endif - -long wxMacTranslateKey(unsigned char key, unsigned char code) ; -long wxMacTranslateKey(unsigned char key, unsigned char code) -{ - long retval = key ; - switch (key) - { - case kHomeCharCode : - retval = WXK_HOME; - break; - case kEnterCharCode : - retval = WXK_RETURN; - break; - case kEndCharCode : - retval = WXK_END; - break; - case kHelpCharCode : - retval = WXK_HELP; - break; - case kBackspaceCharCode : - retval = WXK_BACK; - break; - case kTabCharCode : - retval = WXK_TAB; - break; - case kPageUpCharCode : - retval = WXK_PAGEUP; - break; - case kPageDownCharCode : - retval = WXK_PAGEDOWN; - break; - case kReturnCharCode : - retval = WXK_RETURN; - break; - case kFunctionKeyCharCode : - { - switch( code ) - { - case 0x7a : - retval = WXK_F1 ; - break; - case 0x78 : - retval = WXK_F2 ; - break; - case 0x63 : - retval = WXK_F3 ; - break; - case 0x76 : - retval = WXK_F4 ; - break; - case 0x60 : - retval = WXK_F5 ; - break; - case 0x61 : - retval = WXK_F6 ; - break; - case 0x62: - retval = WXK_F7 ; - break; - case 0x64 : - retval = WXK_F8 ; - break; - case 0x65 : - retval = WXK_F9 ; - break; - case 0x6D : - retval = WXK_F10 ; - break; - case 0x67 : - retval = WXK_F11 ; - break; - case 0x6F : - retval = WXK_F12 ; - break; - case 0x69 : - retval = WXK_F13 ; - break; - case 0x6B : - retval = WXK_F14 ; - break; - case 0x71 : - retval = WXK_F15 ; - break; - } - } - break ; - case kEscapeCharCode : - retval = WXK_ESCAPE ; - break ; - case kLeftArrowCharCode : - retval = WXK_LEFT ; - break ; - case kRightArrowCharCode : - retval = WXK_RIGHT ; - break ; - case kUpArrowCharCode : - retval = WXK_UP ; - break ; - case kDownArrowCharCode : - retval = WXK_DOWN ; - break ; - case kDeleteCharCode : - retval = WXK_DELETE ; - default: - break ; - } // end switch - - return retval; -} - -int wxKeyCodeToMacModifier(wxKeyCode key) -{ - switch (key) - { - case WXK_START: - case WXK_MENU: - return cmdKey; - - case WXK_SHIFT: - return shiftKey; - - case WXK_CAPITAL: - return alphaLock; - - case WXK_ALT: - return optionKey; - - case WXK_CONTROL: - return controlKey; - - default: - return 0; - } -} - -bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below -{ -//#ifdef __DARWIN__ -// wxHIDKeyboard keyboard; -// return keyboard.IsActive(key); -//#else -// TODO: Have it use HID Manager on OSX... -//if OS X > 10.2 (i.e. 10.2.x) -//a known apple bug prevents the system from determining led -//states with GetKeys... can only determine caps lock led - return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); -//else -// KeyMapByteArray keymap; -// GetKeys((BigEndianLong*)keymap); -// return !!(BitTst(keymap, (sizeof(KeyMapByteArray)*8) - iKey)); -//#endif -} - -#if !TARGET_CARBON -void wxApp::MacHandleKeyDownEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - UInt32 menuresult = UMAMenuEvent(ev) ; - if ( HiWord( menuresult ) ) - { - if ( !s_macIsInModalLoop ) - MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ; - } - else - { - wxWindow* focus = wxWindow::FindFocus() ; - - if ( MacSendKeyDownEvent( focus , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) == false ) - { -#if 0 - // we must handle control keys the other way round, otherwise text content is updated too late - // has not been handled -> perform default - wxControl* control = wxDynamicCast( focus , wxControl ) ; - if ( control && control->GetMacControl() != NULL ) - { - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - ::HandleControlKey( (ControlHandle) control->GetMacControl() , keycode , keychar , ev->modifiers ) ; - } -#endif - } - } -} - -void wxApp::MacHandleKeyUpEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - UInt32 menuresult = UMAMenuEvent(ev) ; - if ( HiWord( menuresult ) ) - { - } - else - { - MacSendKeyUpEvent( wxWindow::FindFocus() , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) ; - } -} - -#endif - -bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey ) -{ - if ( !focus ) - return false ; - - short keycode ; - short keychar ; - keychar = short(keymessage & charCodeMask); - keycode = short(keymessage & keyCodeMask) >> 8 ; - - if ( modifiers & ( controlKey|shiftKey|optionKey ) ) - { - // control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier - // and look at the character after - UInt32 state = 0; - UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey|shiftKey|optionKey))) | keycode, &state); - keychar = short(keyInfo & charCodeMask); - keycode = short(keyInfo & keyCodeMask) >> 8 ; - } - long keyval = wxMacTranslateKey(keychar, keycode) ; - long realkeyval = keyval ; - if ( keyval == keychar ) - { - // we are not on a special character combo -> pass the real os event-value to EVT_CHAR, but not to EVT_KEY (make upper first) - realkeyval = short(keymessage & charCodeMask) ; - keyval = wxToupper( keyval ) ; - } - - wxKeyEvent event(wxEVT_KEY_DOWN); - bool handled = false ; - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - event.m_keyCode = keyval ; - - event.m_x = wherex; - event.m_y = wherey; - event.m_timeStamp = when; - event.SetEventObject(focus); - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - if ( handled && event.GetSkipped() ) - handled = false ; - if ( !handled ) - { -#if wxUSE_ACCEL - if (!handled) - { - wxWindow *ancestor = focus; - while (ancestor) - { - int command = ancestor->GetAcceleratorTable()->GetCommand( event ); - if (command != -1) - { - wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); - handled = ancestor->GetEventHandler()->ProcessEvent( command_event ); - break; - } - if (ancestor->IsTopLevel()) - break; - ancestor = ancestor->GetParent(); - } - } -#endif // wxUSE_ACCEL - } - if (!handled) - { - event.Skip( FALSE ) ; - event.SetEventType( wxEVT_CHAR ) ; - // raw value again - event.m_keyCode = realkeyval ; - - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - if ( handled && event.GetSkipped() ) - handled = false ; - } - if ( !handled && - (keyval == WXK_TAB) && -// CS: copied the change below from wxGTK -// VZ: testing for wxTE_PROCESS_TAB shouldn't be done here the control may -// have this style, yet choose not to process this particular TAB in which -// case TAB must still work as a navigational character -#if 0 - (!focus->HasFlag(wxTE_PROCESS_TAB)) && -#endif - (focus->GetParent()) && - (focus->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) - { - wxNavigationKeyEvent new_event; - new_event.SetEventObject( focus ); - new_event.SetDirection( !event.ShiftDown() ); - /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - new_event.SetWindowChange( event.ControlDown() ); - new_event.SetCurrentFocus( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); - if ( handled && new_event.GetSkipped() ) - handled = false ; - } - // backdoor handler for default return and command escape - if ( !handled && (!focus->IsKindOf(CLASSINFO(wxControl) ) || !focus->MacCanFocus() ) ) - { - // if window is not having a focus still testing for default enter or cancel - // TODO add the UMA version for ActiveNonFloatingWindow - wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ; - if ( focus ) - { - if ( keyval == WXK_RETURN ) - { - wxButton *def = wxDynamicCast(focus->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return true ; - } - } - /* generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) */ - else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) ) - { - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); - new_event.SetEventObject( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); - } - } - } - return handled ; -} - -bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey ) -{ - if ( !focus ) - return false ; - - short keycode ; - short keychar ; - keychar = short(keymessage & charCodeMask); - keycode = short(keymessage & keyCodeMask) >> 8 ; - if ( modifiers & ( controlKey|shiftKey|optionKey ) ) - { - // control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier - // and look at the character after - UInt32 state = 0; - UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey|shiftKey|optionKey))) | keycode, &state); - keychar = short(keyInfo & charCodeMask); - keycode = short(keyInfo & keyCodeMask) >> 8 ; - } - long keyval = wxMacTranslateKey(keychar, keycode) ; - - if ( keyval == keychar ) - { - keyval = wxToupper( keyval ) ; - } - bool handled = false ; - - wxKeyEvent event(wxEVT_KEY_UP); - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - event.m_keyCode = keyval ; - - event.m_x = wherex; - event.m_y = wherey; - event.m_timeStamp = when; - event.SetEventObject(focus); - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - - return handled ; -} - -#if !TARGET_CARBON -void wxApp::MacHandleActivateEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window = (WindowRef) ev->message ; - if ( window ) - { - bool activate = (ev->modifiers & activeFlag ) ; - WindowClass wclass ; - ::GetWindowClass ( window , &wclass ) ; - if ( wclass == kFloatingWindowClass ) - { - // if it is a floater we activate/deactivate the front non-floating window instead - window = ::FrontNonFloatingWindow() ; - } - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacActivate( ev->when , activate ) ; - } -} - -void wxApp::MacHandleUpdateEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window = (WindowRef) ev->message ; - wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ; - if ( win ) - { - if ( !wxPendingDelete.Member(win) ) - win->MacUpdate( ev->when ) ; - } - else - { - // since there is no way of telling this foreign window to update itself - // we have to invalidate the update region otherwise we keep getting the same - // event over and over again - BeginUpdate( window ) ; - EndUpdate( window ) ; - } -} - -void wxApp::MacHandleDiskEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - if ( HiWord( ev->message ) != noErr ) - { - OSErr err ; - Point point ; - SetPt( &point , 100 , 100 ) ; - - err = DIBadMount( point , ev->message ) ; - wxASSERT( err == noErr ) ; - } -} - -void wxApp::MacHandleOSEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - switch( ( ev->message & osEvtMessageMask ) >> 24 ) - { - case suspendResumeMessage : - { - bool isResuming = ev->message & resumeFlag ; - bool convertClipboard = ev->message & convertClipboardFlag ; - - bool doesActivate = UMAGetProcessModeDoesActivateOnFGSwitch() ; - if ( isResuming ) - { - WindowRef oldFrontWindow = NULL ; - WindowRef newFrontWindow = NULL ; - - // in case we don't take care of activating ourselves, we have to synchronize - // our idea of the active window with the process manager's - which it already activated - - if ( !doesActivate ) - oldFrontWindow = ::FrontNonFloatingWindow() ; - - MacResume( convertClipboard ) ; - - newFrontWindow = ::FrontNonFloatingWindow() ; - - if ( oldFrontWindow ) - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ; - if ( win ) - win->MacActivate( ev->when , false ) ; - } - if ( newFrontWindow ) - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( newFrontWindow ) ; - if ( win ) - win->MacActivate( ev->when , true ) ; - } - } - else - { - MacSuspend( convertClipboard ) ; - } - } - break ; - case mouseMovedMessage : - { - WindowRef window; - - wxWindow* currentMouseWindow = NULL ; - - if (s_captureWindow ) - { - currentMouseWindow = s_captureWindow ; - } - else - { - wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , - ¤tMouseWindow ) ; - } - - if ( currentMouseWindow != wxWindow::s_lastMouseWindow ) - { - wxMouseEvent event ; - - bool isDown = !(ev->modifiers & btnState) ; // 1 is for up - bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - event.m_shiftDown = ev->modifiers & shiftKey; - event.m_controlDown = ev->modifiers & controlKey; - event.m_altDown = ev->modifiers & optionKey; - event.m_metaDown = ev->modifiers & cmdKey; - event.m_x = ev->where.h; - event.m_y = ev->where.v; - event.m_timeStamp = ev->when; - event.SetEventObject(this); - - if ( wxWindow::s_lastMouseWindow ) - { - wxMouseEvent eventleave(event); - eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); - wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); - eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; - - wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); - } - if ( currentMouseWindow ) - { - wxMouseEvent evententer(event); - evententer.SetEventType( wxEVT_ENTER_WINDOW ); - currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y ); - evententer.SetEventObject( currentMouseWindow ) ; - currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); - } - wxWindow::s_lastMouseWindow = currentMouseWindow ; - } - - short windowPart = inNoWindow ; - - if ( s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - windowPart = ::FindWindow(ev->where, &window); - } - - switch (windowPart) - { - case inContent : - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacMouseMoved( ev , windowPart ) ; - else - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - } - break; - default : - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - break ; - } - } - break ; - - } -} -#else - -void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp) -{ - WindowRef window; - - wxWindow* currentMouseWindow = NULL ; - - if (s_captureWindow ) - { - currentMouseWindow = s_captureWindow ; - } - else - { - wxWindow::MacGetWindowFromPoint( wxPoint( x, y ) , ¤tMouseWindow ) ; - } - - if ( currentMouseWindow != wxWindow::s_lastMouseWindow ) - { - wxMouseEvent event ; - - bool isDown = !(modifiers & btnState) ; // 1 is for up - bool controlDown = modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - event.m_x = x; - event.m_y = y; - event.m_timeStamp = timestamp; - - if ( wxWindow::s_lastMouseWindow ) - { - wxMouseEvent eventleave(event); - eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); - wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); - eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; - -#if wxUSE_TOOLTIPS - wxToolTip::RelayEvent( wxWindow::s_lastMouseWindow , eventleave); -#endif // wxUSE_TOOLTIPS - wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); - } - if ( currentMouseWindow ) - { - wxMouseEvent evententer(event); - evententer.SetEventType( wxEVT_ENTER_WINDOW ); - currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y ); - evententer.SetEventObject( currentMouseWindow ) ; -#if wxUSE_TOOLTIPS - wxToolTip::RelayEvent( currentMouseWindow , evententer); -#endif // wxUSE_TOOLTIPS - currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); - } - wxWindow::s_lastMouseWindow = currentMouseWindow ; - } - - short windowPart = inNoWindow ; - - if ( s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - Point pt= { y , x } ; - windowPart = ::FindWindow(pt , &window); - } - - switch (windowPart) - { - case inContent : - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacFireMouseEvent( nullEvent , x , y , modifiers , timestamp ) ; - else - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - } - break; - default : - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - break ; - } -} -#endif - -void wxApp::MacHandleMenuCommand( wxUint32 id ) -{ - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; - wxFrame* frame = mbar->GetFrame(); - wxCHECK_RET( mbar != NULL && frame != NULL, wxT("error in menu item callback") ); - if ( frame ) - { - frame->ProcessCommand(id); - } -} - -#if !TARGET_CARBON -void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum ) -{ - if (macMenuId == 0) - return; // no menu item selected - - if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1) - { - #if ! TARGET_CARBON - Str255 deskAccessoryName ; - GrafPtr savedPort ; - - GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName); - GetPort(&savedPort); - OpenDeskAcc(deskAccessoryName); - SetPort(savedPort); - #endif - } - else - { - MenuCommand id ; - GetMenuItemCommandID( GetMenuHandle(macMenuId) , macMenuItemNum , &id ) ; - MacHandleMenuCommand( id ) ; - } - HiliteMenu(0); -} -#endif diff --git a/src/mac/carbon/apprsrc.h b/src/mac/carbon/apprsrc.h deleted file mode 100644 index c887ac2d5b..0000000000 --- a/src/mac/carbon/apprsrc.h +++ /dev/null @@ -1,6 +0,0 @@ -#define kMacSTRWrongMachine 1 -#define kMacSTRSmallSize 2 -#define kMacSTRNoMemory 3 -#define kMacSTROldSystem 4 -#define kMacSTRGenericAbout 5 -#define kMacSTRNoPre8Yet 6 diff --git a/src/mac/carbon/apprsrc.r b/src/mac/carbon/apprsrc.r deleted file mode 100644 index 020b34f73a..0000000000 --- a/src/mac/carbon/apprsrc.r +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef __UNIX__ -# include -#else -# include -#endif -#include "apprsrc.h" - -resource 'STR#' ( 128 , "Simple Alert Messages" ) -{ - { - "This application needs at least a MacPlus" , - "This application needs more memory" , - "This application is out of memory" , - "This application needs at least System 8.6" , - "About this wxWindows Application" , - "This application needs Appearance extension (built in with System 8) - this restriction will be relieved in the final release" - } -} ; - -resource 'MENU' (1, preload) -{ - 1, textMenuProc, 0b11111111111111111111111111111110 , enabled, apple , - { - "AboutÉ" , noicon, nokey,nomark,plain , - "-" , noicon, nokey,nomark,plain - } -} ; - -resource 'MBAR' (1,preload) -{ - { 1 } ; -} ; diff --git a/src/mac/carbon/bitmap.cpp b/src/mac/carbon/bitmap.cpp deleted file mode 100644 index 6cbaa9d9b7..0000000000 --- a/src/mac/carbon/bitmap.cpp +++ /dev/null @@ -1,1436 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp -// Purpose: wxBitmap -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "bitmap.h" -#endif - -#include "wx/defs.h" - -#include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/log.h" -#include "wx/image.h" -#include "wx/xpmdecod.h" - -#include "wx/rawbmp.h" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject ) - -#ifdef __DARWIN__ - #include -#else - #include -#endif - -#include "wx/mac/uma.h" - -CTabHandle wxMacCreateColorTable( int numColors ) -{ - CTabHandle newColors; /* Handle to the new color table */ - - /* Allocate memory for the color table */ - newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) + - sizeof (ColorSpec) * (numColors - 1) ); - if (newColors != nil) - { - /* Initialize the fields */ - (**newColors).ctSeed = GetCTSeed(); - (**newColors).ctFlags = 0; - (**newColors).ctSize = numColors - 1; - /* Initialize the table of colors */ - } - return newColors ; -} - -void wxMacDestroyColorTable( CTabHandle colors ) -{ - DisposeHandle( (Handle) colors ) ; -} - -void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) -{ - (**newColors).ctTable[index].value = index; - (**newColors).ctTable[index].rgb.red = red ; // someRedValue; - (**newColors).ctTable[index].rgb.green = green ; // someGreenValue; - (**newColors).ctTable[index].rgb.blue = blue ; // someBlueValue; -} - -GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) -{ - OSErr err = noErr ; - GWorldPtr port ; - Rect rect = { 0 , 0 , height , width } ; - - if ( depth < 0 ) - { - depth = wxDisplayDepth() ; - } - - err = NewGWorld( &port , depth , &rect , NULL , NULL , 0 ) ; - if ( err == noErr ) - { - return port ; - } - return NULL ; -} - -void wxMacDestroyGWorld( GWorldPtr gw ) -{ - if ( gw ) - DisposeGWorld( gw ) ; -} - -#define kDefaultRes 0x00480000 /* Default resolution is 72 DPI; Fixed type */ - -OSErr SetupCIconHandlePixMap( CIconHandle icon , short depth , Rect *bounds , CTabHandle colors ) -{ - CTabHandle newColors; /* Color table used for the off-screen PixMap */ - Ptr offBaseAddr; /* Pointer to the off-screen pixel image */ - OSErr error; /* Returns error code */ - short bytesPerRow; /* Number of bytes per row in the PixMap */ - - - error = noErr; - newColors = nil; - offBaseAddr = nil; - - bytesPerRow = ((depth * (bounds->right - bounds->left) + 31) / 32) * 4; - - /* Clone the clut if indexed color; allocate a dummy clut if direct color*/ - if (depth <= 8) - { - newColors = colors; - error = HandToHand((Handle *) &newColors); - } - else - { - newColors = (CTabHandle) NewHandle(sizeof(ColorTable) - - sizeof(CSpecArray)); - error = MemError(); - } - if (error == noErr) - { - /* Allocate pixel image; long integer multiplication avoids overflow */ - (**icon).iconData = NewHandle((unsigned long) bytesPerRow * (bounds->bottom - - bounds->top)); - if ((**icon).iconData != nil) - { - /* Initialize fields common to indexed and direct PixMaps */ - (**icon).iconPMap.baseAddr = 0; /* Point to image */ - (**icon).iconPMap.rowBytes = bytesPerRow | /* MSB set for PixMap */ - 0x8000; - (**icon).iconPMap.bounds = *bounds; /* Use given bounds */ - (**icon).iconPMap.pmVersion = 0; /* No special stuff */ - (**icon).iconPMap.packType = 0; /* Default PICT pack */ - (**icon).iconPMap.packSize = 0; /* Always zero in mem */ - (**icon).iconPMap.hRes = kDefaultRes; /* 72 DPI default res */ - (**icon).iconPMap.vRes = kDefaultRes; /* 72 DPI default res */ - (**icon).iconPMap.pixelSize = depth; /* Set # bits/pixel */ - - /* Initialize fields specific to indexed and direct PixMaps */ - if (depth <= 8) - { - /* PixMap is indexed */ - (**icon).iconPMap.pixelType = 0; /* Indicates indexed */ - (**icon).iconPMap.cmpCount = 1; /* Have 1 component */ - (**icon).iconPMap.cmpSize = depth; /* Component size=depth */ - (**icon).iconPMap.pmTable = newColors; /* Handle to CLUT */ - } - else - { - /* PixMap is direct */ - (**icon).iconPMap.pixelType = RGBDirect; /* Indicates direct */ - (**icon).iconPMap.cmpCount = 3; /* Have 3 components */ - if (depth == 16) - (**icon).iconPMap.cmpSize = 5; /* 5 bits/component */ - else - (**icon).iconPMap.cmpSize = 8; /* 8 bits/component */ - (**newColors).ctSeed = 3 * (**icon).iconPMap.cmpSize; - (**newColors).ctFlags = 0; - (**newColors).ctSize = 0; - (**icon).iconPMap.pmTable = newColors; - } - } - else - error = MemError(); - } - else - newColors = nil; - - /* If no errors occured, return a handle to the new off-screen PixMap */ - if (error != noErr) - { - if (newColors != nil) - DisposeCTable(newColors); - } - - /* Return the error code */ - return error; -} - -CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) -{ - GWorldPtr saveWorld; - GDHandle saveHandle; - - GetGWorld(&saveWorld,&saveHandle); // save Graphics env state - SetGWorld(image,nil); - - Rect frame = { 0 , 0 , iconSize , iconSize } ; - Rect imageBounds = frame ; - GetPortBounds( image , &imageBounds ) ; - - int bwSize = iconSize / 8 * iconSize ; - CIconHandle icon = (CIconHandle) NewHandleClear( sizeof ( CIcon ) + 2 * bwSize) ; - HLock((Handle)icon) ; - SetupCIconHandlePixMap( icon , dstDepth , &frame,GetCTable(dstDepth)) ; - HLock( (**icon).iconData ) ; - (**icon).iconPMap.baseAddr = *(**icon).iconData ; - - LockPixels(GetGWorldPixMap(image)); - - CopyBits(GetPortBitMapForCopyBits(image), - (BitMapPtr)&((**icon).iconPMap), - &imageBounds, - &imageBounds, - srcCopy | ditherCopy, nil); - - - UnlockPixels(GetGWorldPixMap(image)); - HUnlock( (**icon).iconData ) ; - - (**icon).iconMask.rowBytes = iconSize / 8 ; - (**icon).iconMask.bounds = frame ; - - (**icon).iconBMap.rowBytes = iconSize / 8 ; - (**icon).iconBMap.bounds = frame ; - (**icon).iconMask.baseAddr = (char*) &(**icon).iconMaskData ; - (**icon).iconBMap.baseAddr = (char*) &(**icon).iconMaskData + bwSize ; - - if ( mask ) - { - Rect r ; - GetPortBounds( image , &r ) ; - LockPixels(GetGWorldPixMap(mask) ) ; - CopyBits(GetPortBitMapForCopyBits(mask) , - &(**icon).iconBMap , &r , &r, srcCopy , nil ) ; - CopyBits(GetPortBitMapForCopyBits(mask) , - &(**icon).iconMask , &r , &r, srcCopy , nil ) ; - UnlockPixels(GetGWorldPixMap( mask ) ) ; - } - else - { - Rect r ; - GetPortBounds( image , &r ) ; - LockPixels(GetGWorldPixMap(image)); - CopyBits(GetPortBitMapForCopyBits(image) , - &(**icon).iconBMap , &r , &r, srcCopy , nil ) ; - CopyBits(GetPortBitMapForCopyBits(image) , - &(**icon).iconMask , &r , &r, srcCopy , nil ) ; - UnlockPixels(GetGWorldPixMap(image)); - } - - (**icon).iconMask.baseAddr = NULL ; - (**icon).iconBMap.baseAddr = NULL ; - (**icon).iconPMap.baseAddr = NULL ; - HUnlock((Handle)icon) ; - SetGWorld(saveWorld,saveHandle); - - return icon; -} - -PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask) -{ - CGrafPtr origPort ; - GDHandle origDev ; - - PicHandle pict; - - RGBColor white = { 0xffff ,0xffff , 0xffff } ; - RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ; - - GetGWorld( &origPort , &origDev ) ; - - RgnHandle clipRgn = NULL ; - - if ( mask ) - { - clipRgn = NewRgn() ; - LockPixels( GetGWorldPixMap( mask ) ) ; - BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( mask ) ) ; - UnlockPixels( GetGWorldPixMap( mask ) ) ; - } - - SetGWorld( wp , NULL ) ; - Rect portRect ; - if ( clipRgn ) - GetRegionBounds( clipRgn , &portRect ) ; - else - GetPortBounds( wp , &portRect ) ; - pict = OpenPicture(&portRect); - if(pict) - { - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - - if ( clipRgn ) - SetClip( clipRgn ) ; - - LockPixels( GetGWorldPixMap( wp ) ) ; - CopyBits(GetPortBitMapForCopyBits(wp), - GetPortBitMapForCopyBits(wp), - &portRect, - &portRect, - srcCopy,clipRgn); - UnlockPixels( GetGWorldPixMap( wp ) ) ; - ClosePicture(); - } - SetGWorld( origPort , origDev ) ; - if ( clipRgn ) - DisposeRgn( clipRgn ) ; - return pict; -} - -void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType ) -{ - memset( info , 0 , sizeof(ControlButtonContentInfo) ) ; - if ( bitmap.Ok() ) - { - wxBitmapRefData * bmap = (wxBitmapRefData*) ( bitmap.GetRefData()) ; - if ( bmap == NULL ) - return ; - - if ( bmap->m_bitmapType == kMacBitmapTypePict ) - { - info->contentType = kControlContentPictHandle ; - info->u.picture = MAC_WXHMETAFILE(bmap->m_hPict) ; - } - else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld ) - { - if ( (forceType == kControlContentCIconHandle || ( bmap->m_width == bmap->m_height && forceType != kControlContentPictHandle ) ) && ((bmap->m_width & 0x3) == 0) ) - { - info->contentType = kControlContentCIconHandle ; - if ( bitmap.GetMask() ) - { - info->u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , MAC_WXHBITMAP(bitmap.GetMask()->GetMaskBitmap()) , - 8 , bmap->m_width ) ; - } - else - { - info->u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , NULL , - 8 , bmap->m_width ) ; - } - } - else - { - info->contentType = kControlContentPictHandle ; - if ( bitmap.GetMask() ) - { - info->u.picture = wxMacCreatePict( MAC_WXHBITMAP(bmap->m_hBitmap) , MAC_WXHBITMAP(bitmap.GetMask()->GetMaskBitmap() ) ) ; - } - else - { - info->u.picture = wxMacCreatePict( MAC_WXHBITMAP(bmap->m_hBitmap) , NULL ) ; - } - } - } - else if ( bmap->m_bitmapType == kMacBitmapTypeIcon ) - { - info->contentType = kControlContentCIconHandle ; - info->u.cIconHandle = MAC_WXHICON(bmap->m_hIcon) ; - } - } -} - -wxBitmapRefData::wxBitmapRefData() - : m_width(0) - , m_height(0) - , m_depth(0) - , m_ok(FALSE) - , m_numColors(0) - , m_quality(0) -{ - m_bitmapMask = NULL; - m_hBitmap = NULL ; - m_hPict = NULL ; - m_hIcon = NULL ; - m_bitmapType = kMacBitmapTypeUnknownType ; - m_hasAlpha = false; -} - -// TODO move this to a public function of Bitmap Ref -static void DisposeBitmapRefData(wxBitmapRefData *data) -{ - if ( !data ) - return ; - - switch (data->m_bitmapType) - { - case kMacBitmapTypePict : - { - if ( data->m_hPict ) - { - KillPicture( MAC_WXHMETAFILE( data->m_hPict ) ) ; - data->m_hPict = NULL ; - } - } - break ; - case kMacBitmapTypeGrafWorld : - { - if ( data->m_hBitmap ) - { - wxMacDestroyGWorld( MAC_WXHBITMAP(data->m_hBitmap) ) ; - data->m_hBitmap = NULL ; - } - } - break ; - case kMacBitmapTypeIcon : - if ( data->m_hIcon ) - { - DisposeCIcon( MAC_WXHICON(data->m_hIcon) ) ; - data->m_hIcon = NULL ; - } - - default : - // unkown type ? - break ; - } - - if (data->m_bitmapMask) - { - delete data->m_bitmapMask; - data->m_bitmapMask = NULL; - } -} - -wxBitmapRefData::~wxBitmapRefData() -{ - DisposeBitmapRefData( this ) ; -} - -bool wxBitmap::CopyFromIcon(const wxIcon& icon) -{ - Ref(icon) ; - return true; -} - -wxBitmap::wxBitmap() -{ - m_refData = NULL; -} - -wxBitmap::~wxBitmap() -{ -} - -wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits) -{ - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = the_width ; - M_BITMAPDATA->m_height = the_height ; - M_BITMAPDATA->m_depth = no_bits ; - M_BITMAPDATA->m_numColors = 0; - if ( no_bits == 1 ) - { - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ; - M_BITMAPDATA->m_ok = (MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) != NULL ) ; - - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , NULL ) ; - LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) ) ) ; - - // bits is a char array - - unsigned char* linestart = (unsigned char*) bits ; - int linesize = ( the_width / (sizeof(unsigned char) * 8)) ; - if ( the_width % (sizeof(unsigned char) * 8) ) { - linesize += sizeof(unsigned char); - } - - RGBColor colors[2] = { - { 0xFFFF , 0xFFFF , 0xFFFF } , - { 0, 0 , 0 } - } ; - - for ( int y = 0 ; y < the_height ; ++y , linestart += linesize ) - { - for ( int x = 0 ; x < the_width ; ++x ) - { - int index = x / 8 ; - int bit = x % 8 ; - int mask = 1 << bit ; - if ( linestart[index] & mask ) - { - SetCPixel( x , y , &colors[1] ) ; - } - else - { - SetCPixel( x , y , &colors[0] ) ; - } - } - } - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) ) ) ; - - SetGWorld( origPort , origDevice ) ; - } - else - { - wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented")); - } -} - -wxBitmap::wxBitmap(int w, int h, int d) -{ - (void)Create(w, h, d); -} - -wxBitmap::wxBitmap(void *data, wxBitmapType type, int width, int height, int depth) -{ - (void) Create(data, type, width, height, depth); -} - -wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) -{ - LoadFile(filename, type); -} - -bool wxBitmap::CreateFromXpm(const char **bits) -{ - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) - wxXPMDecoder decoder; - wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ) - *this = wxBitmap(img); - return TRUE; -} - -wxBitmap::wxBitmap(const char **bits) -{ - (void) CreateFromXpm(bits); -} - -wxBitmap::wxBitmap(char **bits) -{ - (void) CreateFromXpm((const char **)bits); -} - -wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const -{ - wxCHECK_MSG( Ok() && - (rect.x >= 0) && (rect.y >= 0) && - (rect.x+rect.width <= GetWidth()) && - (rect.y+rect.height <= GetHeight()), - wxNullBitmap, wxT("invalid bitmap or bitmap region") ); - - - wxBitmap ret( rect.width, rect.height, GetDepth() ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); - - GWorldPtr origPort; - GDHandle origDevice; - - GetGWorld( &origPort, &origDevice ); - - // Update the subbitmaps reference data - wxBitmapRefData *ref = (wxBitmapRefData *)ret.GetRefData(); - - ref->m_numColors = M_BITMAPDATA->m_numColors; -#if wxUSE_PALETTE - ref->m_bitmapPalette = M_BITMAPDATA->m_bitmapPalette; -#endif // wxUSE_PALETTE - ref->m_bitmapType = M_BITMAPDATA->m_bitmapType; - - // Copy sub region of this bitmap - if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypePict) - { - printf("GetSubBitmap: Copy a region of a Pict structure - TODO\n"); - } - else if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypeGrafWorld) - { - // Copy mask - if(GetMask()) - { - GWorldPtr submask, mask; - RGBColor color; - - mask = (GWorldPtr) GetMask()->GetMaskBitmap(); - submask = wxMacCreateGWorld(rect.width, rect.height, GetMask()->GetDepth() ); - LockPixels(GetGWorldPixMap(mask)); - LockPixels(GetGWorldPixMap(submask)); - - for(int yy = 0; yy < rect.height; yy++) - { - for(int xx = 0; xx < rect.width; xx++) - { - SetGWorld(mask, NULL); - GetCPixel(rect.x + xx, rect.y + yy, &color); - SetGWorld(submask, NULL); - SetCPixel(xx,yy, &color); - } - } - UnlockPixels(GetGWorldPixMap(mask)); - UnlockPixels(GetGWorldPixMap(submask)); - ref->m_bitmapMask = new wxMask; - ref->m_bitmapMask->SetMaskBitmap(submask); - } - - // Copy bitmap - if(GetHBITMAP()) - { - GWorldPtr subbitmap, bitmap; - RGBColor color; - - bitmap = (GWorldPtr) GetHBITMAP(); - subbitmap = (GWorldPtr) ref->m_hBitmap ; - LockPixels(GetGWorldPixMap(bitmap)); - LockPixels(GetGWorldPixMap(subbitmap)); - - for(int yy = 0; yy < rect.height; yy++) - { - for(int xx = 0; xx < rect.width; xx++) - { - SetGWorld(bitmap, NULL); - GetCPixel(rect.x + xx, rect.y + yy, &color); - SetGWorld(subbitmap, NULL); - SetCPixel(xx, yy, &color); - } - } - UnlockPixels(GetGWorldPixMap(bitmap)); - UnlockPixels(GetGWorldPixMap(subbitmap)); - } - } - SetGWorld( origPort, origDevice ); - - return ret; -} - -bool wxBitmap::Create(int w, int h, int d) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = w; - M_BITMAPDATA->m_height = h; - M_BITMAPDATA->m_depth = d; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( w , h , d ) ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hBitmap != NULL ) ; - return M_BITMAPDATA->m_ok; -} - -int wxBitmap::GetBitmapType() const -{ - wxCHECK_MSG( Ok(), kMacBitmapTypeUnknownType, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_bitmapType; -} - -void wxBitmap::SetHBITMAP(WXHBITMAP bmp) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = bmp ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hBitmap != NULL ) ; -} - -void wxBitmap::SetHICON(WXHICON ico) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeIcon ; - M_BITMAPDATA->m_hIcon = ico ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hIcon != NULL ) ; -} - -void wxBitmap::SetPict(WXHMETAFILE pict) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypePict ; - M_BITMAPDATA->m_hPict = pict ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hPict != NULL ) ; -} - -bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) -{ - UnRef(); - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - { - m_refData = new wxBitmapRefData; - - return handler->LoadFile(this, filename, type, -1, -1); - } - else - { - wxImage loadimage(filename, type); - if (loadimage.Ok()) { - *this = loadimage; - return true; - } - } - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - return false; -} - -bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler == NULL ) { - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - - return FALSE; - } - - return handler->Create(this, data, type, width, height, depth); -} - -wxBitmap::wxBitmap(const wxImage& image, int depth) -{ - wxCHECK_RET( image.Ok(), wxT("invalid image") ) - wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ) - - m_refData = new wxBitmapRefData(); - - // width and height of the device-dependent bitmap - int width = image.GetWidth(); - int height = image.GetHeight(); - - // Create picture - - Create( width , height , 32 ) ; - - CGrafPtr origPort ; - GDHandle origDevice ; - - PixMapHandle pixMap = GetGWorldPixMap((GWorldPtr)GetHBITMAP()) ; - LockPixels( pixMap ); - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( (GWorldPtr) GetHBITMAP() , NULL ) ; - - // Render image - register unsigned char* data = image.GetData(); - char* destinationBase = GetPixBaseAddr( pixMap ); - register unsigned char* destination = (unsigned char*) destinationBase ; - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - *destination++ = 0 ; - *destination++ = *data++ ; - *destination++ = *data++ ; - *destination++ = *data++ ; - } - destinationBase += ((**pixMap).rowBytes & 0x7fff); - destination = (unsigned char*) destinationBase ; - } - if ( image.HasAlpha() ) - { - unsigned char *alpha = image.GetAlpha(); - - wxColour maskcolor(image.GetMaskRed(), image.GetMaskGreen(), image.GetMaskBlue()); - RGBColor color ; - wxBitmap maskBitmap ; - - maskBitmap.Create( width, height, 24); - LockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - SetGWorld( (GWorldPtr) maskBitmap.GetHBITMAP(), NULL); - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - memset( &color , 255 - *alpha , sizeof( color ) ); - SetCPixel(x,y, &color); - - alpha += 1 ; - } - } // for height - SetGWorld( (GWorldPtr) GetHBITMAP(), NULL); - SetMask(new wxMask( maskBitmap )); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - } - else if ( image.HasMask() ) - { - data = image.GetData(); - - wxColour maskcolor(image.GetMaskRed(), image.GetMaskGreen(), image.GetMaskBlue()); - RGBColor white = { 0xffff, 0xffff, 0xffff }; - RGBColor black = { 0 , 0 , 0 }; - wxBitmap maskBitmap ; - - maskBitmap.Create( width, height, 1); - LockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - SetGWorld( (GWorldPtr) maskBitmap.GetHBITMAP(), NULL); - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - if ( data[0] == image.GetMaskRed() && data[1] == image.GetMaskGreen() && data[2] == image.GetMaskBlue() ) - { - SetCPixel(x,y, &white); - } - else { - SetCPixel(x,y, &black); - } - data += 3 ; - } - } // for height - SetGWorld( (GWorldPtr) GetHBITMAP(), NULL); - SetMask(new wxMask( maskBitmap )); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - } - - UnlockPixels( GetGWorldPixMap( (GWorldPtr) GetHBITMAP()) ); - SetGWorld( origPort, origDevice ); -} - -wxImage wxBitmap::ConvertToImage() const -{ - wxImage image; - - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); - - // create an wxImage object - int width = GetWidth(); - int height = GetHeight(); - image.Create( width, height ); - - unsigned char *data = image.GetData(); - - wxCHECK_MSG( data, wxNullImage, wxT("Could not allocate data for image") ); - - GWorldPtr origPort; - GDHandle origDevice; - RgnHandle maskRgn = NULL ; - GWorldPtr tempPort = NULL ; - int index; - RGBColor color; - // background color set to RGB(16,16,16) in consistent with wxGTK - unsigned char mask_r=16, mask_g=16, mask_b=16; - SInt16 r,g,b; - wxMask *mask = GetMask(); - - GetGWorld( &origPort, &origDevice ); - if ( GetBitmapType() != kMacBitmapTypeGrafWorld ) - { - tempPort = wxMacCreateGWorld( width , height , -1) ; - } - else - { - tempPort = (GWorldPtr) GetHBITMAP() ; - } - LockPixels(GetGWorldPixMap(tempPort)); - SetGWorld( tempPort, NULL); - if ( GetBitmapType() == kMacBitmapTypePict || GetBitmapType() == kMacBitmapTypeIcon ) - { - Rect bitmaprect = { 0 , 0 , height, width }; - if ( GetBitmapType() == kMacBitmapTypeIcon ) - { - ::PlotCIconHandle( &bitmaprect , atNone , ttNone , MAC_WXHICON(GetHICON()) ) ; - maskRgn = NewRgn() ; - BitMapToRegion( maskRgn , &(**(MAC_WXHICON(GetHICON()))).iconMask ) ; - } - else - ::DrawPicture( (PicHandle) GetPict(), &bitmaprect ) ; - } - // Copy data into image - index = 0; - for (int yy = 0; yy < height; yy++) - { - for (int xx = 0; xx < width; xx++) - { - GetCPixel(xx,yy, &color); - r = ((color.red ) >> 8); - g = ((color.green ) >> 8); - b = ((color.blue ) >> 8); - data[index ] = r; - data[index + 1] = g; - data[index + 2] = b; - if ( maskRgn ) - { - Point pt ; - pt.h = xx ; - pt.v = yy ; - if ( !PtInRgn( pt , maskRgn ) ) - { - data[index ] = mask_r; - data[index + 1] = mask_g; - data[index + 2] = mask_b; - } - } - else - { - if (mask) - { - if (mask->PointMasked(xx,yy)) - { - data[index ] = mask_r; - data[index + 1] = mask_g; - data[index + 2] = mask_b; - } - } - } - index += 3; - } - } - if (mask || maskRgn ) - { - image.SetMaskColour( mask_r, mask_g, mask_b ); - image.SetMask( true ); - } - - // Free resources - UnlockPixels(GetGWorldPixMap( tempPort )); - SetGWorld(origPort, origDevice); - if ( GetBitmapType() != kMacBitmapTypeGrafWorld ) - { - wxMacDestroyGWorld( tempPort ) ; - } - if ( maskRgn ) - { - DisposeRgn( maskRgn ) ; - } - - return image; -} - - -bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, - const wxPalette *palette) const -{ - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - { - return handler->SaveFile(this, filename, type, palette); - } - else - { - wxImage image = ConvertToImage(); - - return image.SaveFile(filename, type); - } - - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - return false; -} - -bool wxBitmap::Ok() const -{ - return (M_BITMAPDATA && M_BITMAPDATA->m_ok); -} - -int wxBitmap::GetHeight() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_height; -} - -int wxBitmap::GetWidth() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_width; -} - -int wxBitmap::GetDepth() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_depth; -} - -int wxBitmap::GetQuality() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_quality; -} - -wxMask *wxBitmap::GetMask() const -{ - wxCHECK_MSG( Ok(), (wxMask *) NULL, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_bitmapMask; -} - -void wxBitmap::SetWidth(int w) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = w; -} - -void wxBitmap::SetHeight(int h) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_height = h; -} - -void wxBitmap::SetDepth(int d) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_depth = d; -} - -void wxBitmap::SetQuality(int q) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_quality = q; -} - -void wxBitmap::SetOk(bool isOk) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_ok = isOk; -} - -#if wxUSE_PALETTE -wxPalette *wxBitmap::GetPalette() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("Invalid bitmap GetPalette()") ); - - return &M_BITMAPDATA->m_bitmapPalette; -} - -void wxBitmap::SetPalette(const wxPalette& palette) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_bitmapPalette = palette ; -} -#endif // wxUSE_PALETTE - -void wxBitmap::SetMask(wxMask *mask) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - // Remove existing mask if there is one. - delete M_BITMAPDATA->m_bitmapMask; - - M_BITMAPDATA->m_bitmapMask = mask ; -} - -WXHBITMAP wxBitmap::GetHBITMAP() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); - - return MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); -} - -WXHMETAFILE wxBitmap::GetPict( bool *created ) const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); - - PicHandle picture = NULL ; // This is the returned picture - if ( created ) - (*created) = false ; - // If bitmap already in Pict format return pointer - if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypePict) { - return M_BITMAPDATA->m_hPict; - } - else if(M_BITMAPDATA->m_bitmapType != kMacBitmapTypeGrafWorld) { - // Invalid bitmap - return NULL; - } - else - { - if ( GetMask() ) - { - picture = wxMacCreatePict( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , MAC_WXHBITMAP(GetMask()->GetMaskBitmap() ) ) ; - } - else - { - picture = wxMacCreatePict( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , NULL ) ; - } - if ( created && picture ) - (*created) = true ; - } - return picture ; -} - -/* - * wxMask - */ - -wxMask::wxMask() - : m_maskBitmap(NULL) -{ -} - -// Construct a mask from a bitmap and a colour indicating -// the transparent area -wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour) - : m_maskBitmap(NULL) -{ - Create(bitmap, colour); -} - -// Construct a mask from a bitmap and a palette index indicating -// the transparent area -wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex) - : m_maskBitmap(NULL) -{ - Create(bitmap, paletteIndex); -} - -// Construct a mask from a mono bitmap (copies the bitmap). -wxMask::wxMask(const wxBitmap& bitmap) - : m_maskBitmap(NULL) -{ - Create(bitmap); -} - -wxMask::~wxMask() -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } -} - -// Create a mask from a mono bitmap (copies the bitmap). -bool wxMask::Create(const wxBitmap& bitmap) -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } - wxCHECK_MSG( bitmap.GetBitmapType() == kMacBitmapTypeGrafWorld, false, - wxT("Cannot create mask from this bitmap type (TODO)")); - // other types would require a temporary bitmap. not yet implemented - - wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap")); - - m_depth = bitmap.GetDepth() ; - m_maskBitmap = wxMacCreateGWorld(bitmap.GetWidth(), bitmap.GetHeight(), bitmap.GetDepth() ); - Rect rect = { 0,0, bitmap.GetHeight(), bitmap.GetWidth() }; - - LockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap) ); - LockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP()) ); - CopyBits(GetPortBitMapForCopyBits( (GWorldPtr) bitmap.GetHBITMAP()), - GetPortBitMapForCopyBits( (GWorldPtr) m_maskBitmap), - &rect, &rect, srcCopy, 0); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap) ); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP()) ); - - return FALSE; -} - -// Create a mask from a bitmap and a palette index indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) -{ - // TODO - wxCHECK_MSG( 0, false, wxT("wxMask::Create not yet implemented")); - return FALSE; -} - -// Create a mask from a bitmap and a colour indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } - wxCHECK_MSG( bitmap.GetBitmapType() == kMacBitmapTypeGrafWorld, false, - wxT("Cannot create mask from this bitmap type (TODO)")); - // other types would require a temporary bitmap. not yet implemented - - wxCHECK_MSG( bitmap.Ok(), false, wxT("Illigal bitmap")); - - m_maskBitmap = wxMacCreateGWorld( bitmap.GetWidth() , bitmap.GetHeight() , 1 ); - m_depth = 1 ; - LockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap ) ); - LockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP() ) ); - RGBColor maskColor = MAC_WXCOLORREF(colour.GetPixel()); - - // this is not very efficient, but I can't think - // of a better way of doing it - CGrafPtr origPort ; - GDHandle origDevice ; - RGBColor col; - RGBColor colors[2] = { - { 0xFFFF, 0xFFFF, 0xFFFF }, - { 0, 0, 0 }}; - - GetGWorld( &origPort , &origDevice ) ; - for (int w = 0; w < bitmap.GetWidth(); w++) - { - for (int h = 0; h < bitmap.GetHeight(); h++) - { - SetGWorld( (GWorldPtr) bitmap.GetHBITMAP(), NULL ) ; - GetCPixel( w , h , &col ) ; - SetGWorld( (GWorldPtr) m_maskBitmap , NULL ) ; - if (col.red == maskColor.red && col.green == maskColor.green && col.blue == maskColor.blue) - { - SetCPixel( w , h , &colors[0] ) ; - } - else - { - SetCPixel( w , h , &colors[1] ) ; - } - } - } - UnlockPixels( GetGWorldPixMap( (CGrafPtr) m_maskBitmap ) ) ; - UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP() ) ) ; - SetGWorld( origPort , origDevice ) ; - - return TRUE; -} - -bool wxMask::PointMasked(int x, int y) -{ - GWorldPtr origPort; - GDHandle origDevice; - RGBColor color; - bool masked = true; - - GetGWorld( &origPort, &origDevice); - - //Set port to mask and see if it masked (1) or not ( 0 ) - SetGWorld( (GWorldPtr) m_maskBitmap, NULL); - LockPixels(GetGWorldPixMap( (GWorldPtr) m_maskBitmap)); - GetCPixel(x,y, &color); - masked = !(color.red == 0 && color.green == 0 && color.blue == 0); - UnlockPixels(GetGWorldPixMap( (GWorldPtr) m_maskBitmap)); - - SetGWorld( origPort, origDevice); - - return masked; -} - -/* - * wxBitmapHandler - */ - -wxBitmapHandler::~wxBitmapHandler() -{ -} - -bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth) -{ - return FALSE; -} - -bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - return FALSE; -} - -bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette) -{ - return FALSE; -} - -/* - * Standard handlers - */ - -class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxPICTResourceHandler) -public: - inline wxPICTResourceHandler() - { - m_name = wxT("Macintosh Pict resource"); - m_extension = wxEmptyString; - m_type = wxBITMAP_TYPE_PICT_RESOURCE; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); -}; -IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) - -bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - Str255 theName ; - wxMacStringToPascal( name , theName ) ; - - PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ; - if ( thePict ) - { - PictInfo theInfo ; - - GetPictInfo( thePict , &theInfo , 0 , 0 , systemMethod , 0 ) ; - DetachResource( (Handle) thePict ) ; - M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypePict ; - M_BITMAPHANDLERDATA->m_hPict = thePict ; - M_BITMAPHANDLERDATA->m_width = theInfo.sourceRect.right - theInfo.sourceRect.left ; - M_BITMAPHANDLERDATA->m_height = theInfo.sourceRect.bottom - theInfo.sourceRect.top ; - - M_BITMAPHANDLERDATA->m_depth = theInfo.depth ; - M_BITMAPHANDLERDATA->m_ok = true ; - M_BITMAPHANDLERDATA->m_numColors = theInfo.uniqueColors ; -// M_BITMAPHANDLERDATA->m_bitmapPalette; -// M_BITMAPHANDLERDATA->m_quality; - return TRUE ; - } - return FALSE ; -} - -void wxBitmap::InitStandardHandlers() -{ - AddHandler(new wxPICTResourceHandler) ; - AddHandler(new wxICONResourceHandler) ; -} - -// ---------------------------------------------------------------------------- -// raw bitmap access support -// ---------------------------------------------------------------------------- - -void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) -{ - if ( !Ok() ) - { - // no bitmap, no data (raw or otherwise) - return NULL; - } - - if ( M_BITMAPDATA->m_bitmapType != kMacBitmapTypeGrafWorld ) - { - wxFAIL_MSG( _T("GetRawData() only supported for GWorlds") ); - - return NULL; - } - - GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); - PixMapHandle hPixMap = GetGWorldPixMap(gworld); - wxCHECK_MSG( hPixMap && *hPixMap, NULL, - _T("GetRawData(): failed to get PixMap from GWorld?") ); - - wxCHECK_MSG( (*hPixMap)->pixelSize == bpp, NULL, - _T("GetRawData(): pixel format mismatch") ); - - if ( !LockPixels(hPixMap) ) - { - wxFAIL_MSG( _T("failed to lock PixMap in GetRawData()") ); - - return NULL; - } - - data.m_width = GetWidth(); - data.m_height = GetHeight(); - data.m_stride = (*hPixMap)->rowBytes & 0x7fff; - - M_BITMAPDATA->m_hasAlpha = false; - - return GetPixBaseAddr(hPixMap); -} - -void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) -{ - if ( !Ok() ) - return; - - if ( M_BITMAPDATA->m_hasAlpha ) - { - wxAlphaPixelData& data = (wxAlphaPixelData&)dataBase; - - int w = data.GetWidth(), - h = data.GetHeight(); - - wxBitmap bmpMask(GetWidth(), GetHeight(), 32); - wxAlphaPixelData dataMask(bmpMask, data.GetOrigin(), wxSize(w, h)); - wxAlphaPixelData::Iterator pMask(dataMask), - p(data); - for ( int y = 0; y < h; y++ ) - { - wxAlphaPixelData::Iterator rowStartMask = pMask, - rowStart = p; - - for ( int x = 0; x < w; x++ ) - { - const wxAlphaPixelData::Iterator::ChannelType - alpha = p.Alpha(); - - pMask.Red() = alpha; - pMask.Green() = alpha; - pMask.Blue() = alpha; - - ++p; - ++pMask; - } - - p = rowStart; - p.OffsetY(data, 1); - - pMask = rowStartMask; - pMask.OffsetY(dataMask, 1); - } - - SetMask(new wxMask(bmpMask)); - } - - GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); - PixMapHandle hPixMap = GetGWorldPixMap(gworld); - if ( hPixMap ) - { - UnlockPixels(hPixMap); - } -} - -void wxBitmap::UseAlpha() -{ - // remember that we are using alpha channel, we'll need to create a proper - // mask in UngetRawData() - M_BITMAPDATA->m_hasAlpha = true; -} - diff --git a/src/mac/carbon/bmpbuttn.cpp b/src/mac/carbon/bmpbuttn.cpp deleted file mode 100644 index f6ce4dd00c..0000000000 --- a/src/mac/carbon/bmpbuttn.cpp +++ /dev/null @@ -1,113 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.cpp -// Purpose: wxBitmapButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "bmpbuttn.h" -#endif - -#include "wx/window.h" -#include "wx/bmpbuttn.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) -#endif - -#include "wx/mac/uma.h" -#include "wx/bitmap.h" - -bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - // since bitmapbuttonbase is subclass of button calling wxBitmapButtonBase::Create - // essentially creates an additional button - if ( !wxControl::Create(parent, id, pos, size, - style, validator, name) ) - return false; - - m_bmpNormal = bitmap; - - if (style & wxBU_AUTODRAW) - { - m_marginX = wxDEFAULT_BUTTON_MARGIN; - m_marginY = wxDEFAULT_BUTTON_MARGIN; - } - else - { - m_marginX = 0; - m_marginY = 0; - } - - int width = size.x; - int height = size.y; - - if ( bitmap.Ok() ) - { - wxSize newSize = DoGetBestSize(); - if ( width == -1 ) - width = newSize.x; - if ( height == -1 ) - height = newSize.y; - } - - Rect bounds ; - Str255 title ; - m_bmpNormal = bitmap; - wxBitmapRefData * bmap = NULL ; - - if ( m_bmpNormal.Ok() ) - bmap = (wxBitmapRefData*) ( m_bmpNormal.GetRefData()) ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , - kControlBehaviorOffsetContents + - ( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ? - kControlContentCIconHandle : kControlContentPictHandle ) , 0, - (( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bmpNormal ) ; - if ( info.contentType != kControlNoContent ) - { - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } - MacPostControlCreate() ; - - return TRUE; -} - -void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap) -{ - m_bmpNormal = bitmap; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bmpNormal ) ; - if ( info.contentType != kControlNoContent ) - { - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } -} - - -wxSize wxBitmapButton::DoGetBestSize() const -{ - wxSize best; - if (m_bmpNormal.Ok()) - { - best.x = m_bmpNormal.GetWidth() + 2*m_marginX; - best.y = m_bmpNormal.GetHeight() + 2*m_marginY; - } - return best; -} diff --git a/src/mac/carbon/brush.cpp b/src/mac/carbon/brush.cpp deleted file mode 100644 index d484314a2c..0000000000 --- a/src/mac/carbon/brush.cpp +++ /dev/null @@ -1,229 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp -// Purpose: wxBrush -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "brush.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/brush.h" - -#include "wx/mac/private.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) -#endif - -class WXDLLEXPORT wxBrushRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxBrush; -public: - wxBrushRefData(); - wxBrushRefData(const wxBrushRefData& data); - ~wxBrushRefData(); - -protected: - wxMacBrushKind m_macBrushKind ; - int m_style; - wxBitmap m_stipple ; - wxColour m_colour; - - ThemeBrush m_macThemeBrush ; - - ThemeBackgroundKind m_macThemeBackground ; - Rect m_macThemeBackgroundExtent ; -}; - -#define M_BRUSHDATA ((wxBrushRefData *)m_refData) - -wxBrushRefData::wxBrushRefData() - : m_style(wxSOLID) -{ - m_macBrushKind = kwxMacBrushColour ; -} - -wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) - : wxGDIRefData() - , m_style(data.m_style) -{ - m_stipple = data.m_stipple; - m_colour = data.m_colour; - m_macBrushKind = data.m_macBrushKind ; - m_macThemeBrush = data.m_macThemeBrush ; - m_macThemeBackground = data.m_macThemeBackground ; - m_macThemeBackgroundExtent = data.m_macThemeBackgroundExtent ; -} - -wxBrushRefData::~wxBrushRefData() -{ -} - -// Brushes -wxBrush::wxBrush() -{ -} - -wxBrush::~wxBrush() -{ -} - -wxBrush::wxBrush(const wxColour& col, int Style) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_colour = col; - M_BRUSHDATA->m_style = Style; - - RealizeResource(); -} - -wxBrush::wxBrush(const wxBitmap& stipple) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_colour = *wxBLACK; - M_BRUSHDATA->m_stipple = stipple; - - if (M_BRUSHDATA->m_stipple.GetMask()) - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; - else - M_BRUSHDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -wxBrush::wxBrush(ThemeBrush macThemeBrush ) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme; - M_BRUSHDATA->m_macThemeBrush = macThemeBrush; - - RealizeResource(); -} -void wxBrush::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxBrushRefData(); - } - else - { - wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxBrush::SetColour(const wxColour& col) -{ - Unshare(); - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_colour = col; - - RealizeResource(); -} - -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxBrush::SetStyle(int Style) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_style = Style; - - RealizeResource(); -} - -void wxBrush::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_stipple = Stipple; - - RealizeResource(); -} - -void wxBrush::SetMacTheme(ThemeBrush macThemeBrush) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme; - M_BRUSHDATA->m_macThemeBrush = macThemeBrush; - - RealizeResource(); -} - -void wxBrush::SetMacThemeBackground(unsigned long macThemeBackground, const WXRECTPTR extent) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushThemeBackground; - M_BRUSHDATA->m_macThemeBackground = macThemeBackground; - M_BRUSHDATA->m_macThemeBackgroundExtent = *(Rect*)extent ; - RealizeResource(); -} - -bool wxBrush::RealizeResource() -{ - return TRUE; -} - -unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const -{ - if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) - { - if ( extent ) - *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; - return M_BRUSHDATA->m_macThemeBackground ; - } - else - { - return 0 ; - } -} - -short wxBrush::GetMacTheme() const -{ - return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); -} - -wxColour& wxBrush::GetColour() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); -} - -int wxBrush::GetStyle() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); -} - -wxBitmap *wxBrush::GetStipple() const -{ - return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); -} - -wxMacBrushKind wxBrush::MacGetBrushKind() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); -} \ No newline at end of file diff --git a/src/mac/carbon/button.cpp b/src/mac/carbon/button.cpp deleted file mode 100644 index 82e4e34c5f..0000000000 --- a/src/mac/carbon/button.cpp +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp -// Purpose: wxButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "button.h" -#endif - -#include "wx/defs.h" - -#include "wx/button.h" -#include "wx/panel.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) -#endif - -#include "wx/mac/uma.h" -// Button - -static const int kMacOSXHorizontalBorder = 2 ; -static const int kMacOSXVerticalBorder = 4 ; - -bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - if ( UMAHasAquaLayout() ) - { - m_macHorizontalBorder = kMacOSXHorizontalBorder; - m_macVerticalBorder = kMacOSXVerticalBorder; - } - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlPushButtonProc , (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxButton::SetDefault() -{ - wxWindow *parent = GetParent(); - wxButton *btnOldDefault = NULL; - if ( parent ) - { - btnOldDefault = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - parent->SetDefaultItem(this); - } - - Boolean inData; - if ( btnOldDefault && btnOldDefault->m_macControl ) - { - inData = 0; - ::SetControlData( (ControlHandle) btnOldDefault->m_macControl , kControlButtonPart , - kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ; - } - if ( (ControlHandle) m_macControl ) - { - inData = 1; - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , - kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ; - } -} - -wxSize wxButton::DoGetBestSize() const -{ - wxSize sz = GetDefaultSize() ; - - int wBtn = m_label.Length() * 8 + 12 + 2 * kMacOSXHorizontalBorder ; - - if (wBtn > sz.x) sz.x = wBtn; - - return sz ; -} - -wxSize wxButton::GetDefaultSize() -{ - int wBtn = 70 ; - int hBtn = 20 ; - - if ( UMAHasAquaLayout() ) - { - wBtn += 2 * kMacOSXHorizontalBorder ; - hBtn += 2 * kMacOSXVerticalBorder ; - } - - return wxSize(wBtn, hBtn); -} - -void wxButton::Command (wxCommandEvent & event) -{ - if ( (ControlHandle) m_macControl ) - { - HiliteControl( (ControlHandle) m_macControl , kControlButtonPart ) ; - unsigned long finalTicks ; - Delay( 8 , &finalTicks ) ; - HiliteControl( (ControlHandle) m_macControl , 0 ) ; - } - ProcessCommand (event); -} - -void wxButton::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 controlpart , bool WXUNUSED(mouseStillDown) ) -{ - if ( controlpart != kControlNoPart ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId ); - event.SetEventObject(this); - ProcessCommand(event); - } -} - diff --git a/src/mac/carbon/carbrsrc.r b/src/mac/carbon/carbrsrc.r deleted file mode 100644 index 9326cc3b56..0000000000 --- a/src/mac/carbon/carbrsrc.r +++ /dev/null @@ -1,7 +0,0 @@ -// carbon for 9 -data 'carb' (0) { - $"0000" /* .. */ -}; - -// the plist resource should only be included in the application -// since it contains the bundle information and should not be duplicated diff --git a/src/mac/carbon/checkbox.cpp b/src/mac/carbon/checkbox.cpp deleted file mode 100644 index 6e6aa299b2..0000000000 --- a/src/mac/carbon/checkbox.cpp +++ /dev/null @@ -1,179 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.cpp -// Purpose: wxCheckBox -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "checkbox.h" -#endif - -#include "wx/defs.h" - -#include "wx/checkbox.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) -#endif - -#include "wx/mac/uma.h" - -// Single check box item -bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - SInt16 maxValue = 1 /* kControlCheckboxCheckedValue */; - if (style & wxCHK_3STATE) - { - maxValue = 2 /* kControlCheckboxMixedValue */; - } - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue, - kControlCheckBoxProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxCheckBox::SetValue(bool val) -{ - if (val) - { - Set3StateValue(wxCHK_CHECKED); - } - else - { - Set3StateValue(wxCHK_UNCHECKED); - } -} - -bool wxCheckBox::GetValue() const -{ - return (DoGet3StateValue() != 0); -} - -void wxCheckBox::Command (wxCommandEvent & event) -{ - int state = event.GetInt(); - - wxCHECK_RET( (state == wxCHK_UNCHECKED) || (state == wxCHK_CHECKED) - || (state == wxCHK_UNDETERMINED), - wxT("event.GetInt() returned an invalid checkbox state") ); - - Set3StateValue((wxCheckBoxState) state); - - ProcessCommand(event); -} - -wxCheckBoxState wxCheckBox::DoGet3StateValue() const -{ - return (wxCheckBoxState) ::GetControl32BitValue( (ControlHandle) m_macControl ); -} - -void wxCheckBox::DoSet3StateValue(wxCheckBoxState val) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , (int) val) ; - MacRedrawControl() ; -} - -void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) , bool WXUNUSED(mouseStillDown) ) -{ - wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); - wxCheckBoxState state = Get3StateValue(); - - if (state == wxCHK_UNCHECKED) - { - state = wxCHK_CHECKED; - } - else if (state == wxCHK_CHECKED) - { - // If the style flag to allow the user setting the undetermined state - // is set, then set the state to undetermined. Otherwise set state to - // unchecked. - if ( Is3rdStateAllowedForUser() ) - { - state = wxCHK_UNDETERMINED; - } - else - { - state = wxCHK_UNCHECKED; - } - } - else if (state == wxCHK_UNDETERMINED) - { - state = wxCHK_UNCHECKED; - } - Set3StateValue(state); - - event.SetInt(state); - event.SetEventObject(this); - ProcessCommand(event); -} - -// Bitmap checkbox -bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = NewControlId(); - else - m_windowId = id; - - // TODO: Create the bitmap checkbox - - return FALSE; -} - -void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap) -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::SetLabel() not yet implemented")); -} - -void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - wxControl::SetSize( x , y , width , height , sizeFlags ) ; -} - -void wxBitmapCheckBox::SetValue(bool val) -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::SetValue() not yet implemented")); -} - -bool wxBitmapCheckBox::GetValue() const -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::GetValue() not yet implemented")); - return FALSE; -} - - diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp deleted file mode 100644 index c442bbdfcb..0000000000 --- a/src/mac/carbon/checklst.cpp +++ /dev/null @@ -1,453 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: checklst.cpp -// Purpose: implementation of wxCheckListBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers & declarations -// ============================================================================ - -#ifdef __GNUG__ -#pragma implementation "checklst.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_CHECKLISTBOX - -#include "wx/checklst.h" -#include "wx/arrstr.h" - -#include "wx/mac/uma.h" -#include - -// ============================================================================ -// implementation of wxCheckListBox -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) - -const short kwxMacListWithVerticalScrollbar = 128 ; -const short kwxMacListItemHeight = 14 ; -const short kwxMacListCheckboxWidth = 14 ; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} ldefRec, *ldefPtr, **ldefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -extern "C" -{ -static pascal void wxMacCheckListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) ; -} - -static pascal void wxMacCheckListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) -{ - wxCheckListBox* list; - list = (wxCheckListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); - if ( list == NULL ) - return ; - - GrafPtr savePort; - GrafPtr grafPtr; - RgnHandle savedClipRegion; - SInt32 savedPenMode; - GetPort(&savePort); - SetPort((**listHandle).port); - grafPtr = (**listHandle).port ; - // typecast our refCon - - // Calculate the cell rect. - - switch( message ) { - case lInitMsg: - break; - - case lCloseMsg: - break; - - case lDrawMsg: - { - const wxString text = list->m_stringArray[cell.v] ; - int checked = list->m_checks[cell.v] ; - - // Save the current clip region, and set the clip region to the area we are about - // to draw. - - savedClipRegion = NewRgn(); - GetClip( savedClipRegion ); - - ClipRect( drawRect ); - EraseRect( drawRect ); - - const wxFont& font = list->GetFont(); - if ( font.Ok() ) - { - ::TextFont( font.GetMacFontNum() ) ; - ::TextSize( font.GetMacFontSize()) ; - ::TextFace( font.GetMacFontStyle() ) ; - } - - ThemeButtonDrawInfo info ; - info.state = kThemeStateActive ; - info.value = checked ? kThemeButtonOn : kThemeButtonOff ; - info.adornment = kThemeAdornmentNone ; - Rect checkRect = *drawRect ; - - - checkRect.left +=0 ; - checkRect.top +=0 ; - checkRect.right = checkRect.left + list->m_checkBoxWidth ; - checkRect.bottom = checkRect.top + list->m_checkBoxHeight ; - DrawThemeButton(&checkRect,kThemeCheckBox, - &info,NULL,NULL, NULL,0); - - MoveTo(drawRect->left + 2 + list->m_checkBoxWidth+2, drawRect->top + list->m_TextBaseLineOffset ); - - DrawText(text, 0 , text.Length()); - // If the cell is hilited, do the hilite now. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - if( isSelected ) { - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr) grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr) grafPtr, savedPenMode ); - } - - // Restore the saved clip region. - - SetClip( savedClipRegion ); - DisposeRgn( savedClipRegion ); - } - break; - case lHiliteMsg: - - // Hilite or unhilite the cell. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - GetPort( &grafPtr ); - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr) grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr) grafPtr, savedPenMode ); - break; - default : - break ; - } - SetPort(savePort); -} - -extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ; - -static ListDefUPP macCheckListDefUPP = NULL ; - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Init() -{ -} - -bool wxCheckListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString &name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxCheckListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - int n, - const wxString choices[], - long style, - const wxValidator& validator, - const wxString &name) -{ - if ( !wxCheckListBoxBase::Create(parent, id, pos, size, - n, choices, style, validator, name) ) - return false; - - m_noItems = 0 ; // this will be increased by our append command - m_selected = 0; - - m_checkBoxWidth = 12; - m_checkBoxHeight= 10; - - long h = m_checkBoxHeight ; -#if TARGET_CARBON - GetThemeMetric(kThemeMetricCheckBoxWidth,(long *)&m_checkBoxWidth); - GetThemeMetric(kThemeMetricCheckBoxHeight,&h); -#endif - - const wxFont& font = GetFont(); - - FontInfo finfo; - FetchFontInfo(font.GetMacFontNum(),font.GetMacFontSize(),font.GetMacFontStyle(),&finfo); - - m_TextBaseLineOffset= finfo.leading+finfo.ascent; - m_checkBoxHeight= finfo.leading+finfo.ascent+finfo.descent; - - if (m_checkBoxHeightMacGetRootWindow()), &bounds, false, 0, 1, false, true, - m_checkBoxHeight+2, 14, false, &listDef, (ControlRef *)&m_macControl ); - - GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, - sizeof(ListHandle), (Ptr) &m_macList, &asize); - - SetControlReference( (ControlHandle) m_macControl, (long) this); - SetControlVisibility( (ControlHandle) m_macControl, false, false); - -#else - - long result ; - - wxStAppResource resload ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , - kwxMacListWithVerticalScrollbar , 0 , 0, - kControlListBoxProc , (long) this ) ; - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , - sizeof( ListHandle ) , (char*) &m_macList , &result ) ; - - HLock( (Handle) m_macList ) ; - ldefHandle ldef ; - ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ; - if ( (**(ListHandle)m_macList).listDefProc != NULL ) - { - (**ldef).instruction = 0x4EF9; /* JMP instruction */ - (**ldef).function = (void(*)()) listDef.u.userProc; - (**(ListHandle)m_macList).listDefProc = (Handle) ldef ; - } - - Point pt = (**(ListHandle)m_macList).cellSize ; - pt.v = 14 ; - LCellSize( pt , (ListHandle)m_macList ) ; - LAddColumn( 1 , 0 , (ListHandle)m_macList ) ; -#endif - OptionBits options = 0; - if ( style & wxLB_MULTIPLE ) - { - options += lNoExtend ; - } - else if ( style & wxLB_EXTENDED ) - { - options += lExtendDrag ; - } - else - { - options = (OptionBits) lOnlyOne ; - } - SetListSelectionFlags((ListHandle)m_macList, options); - - MacPostControlCreate() ; - - for ( int i = 0 ; i < n ; i++ ) - { - Append( choices[i] ) ; - } - - LSetDrawingMode( true , (ListHandle) m_macList ) ; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxCheckListBox functions -// ---------------------------------------------------------------------------- - -bool wxCheckListBox::IsChecked(size_t item) const -{ - wxCHECK_MSG( item < m_checks.GetCount(), FALSE, - _T("invalid index in wxCheckListBox::IsChecked") ); - - return m_checks[item] != 0; -} - -void wxCheckListBox::Check(size_t item, bool check) -{ - wxCHECK_RET( item < m_checks.GetCount(), - _T("invalid index in wxCheckListBox::Check") ); - - // intermediate var is needed to avoid compiler warning with VC++ - bool isChecked = m_checks[item] != 0; - if ( check != isChecked ) - { - m_checks[item] = check; - - MacRedrawControl() ; - } -} - -// ---------------------------------------------------------------------------- -// methods forwarded to wxListBox -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Delete(int n) -{ - wxCHECK_RET( n < GetCount(), _T("invalid index in wxListBox::Delete") ); - - wxListBox::Delete(n); - - m_checks.RemoveAt(n); -} - -int wxCheckListBox::DoAppend(const wxString& item) -{ - LSetDrawingMode( false , (ListHandle) m_macList ) ; - int pos = wxListBox::DoAppend(item); - - // the item is initially unchecked - m_checks.Insert(FALSE, pos); - LSetDrawingMode( true , (ListHandle) m_macList ) ; - - return pos; -} - -void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos) -{ - wxListBox::DoInsertItems(items, pos); - - size_t count = items.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - m_checks.Insert(FALSE, pos + n); - } -} - -void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData) -{ - // call it first as it does DoClear() - wxListBox::DoSetItems(items, clientData); - - size_t count = items.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - m_checks.Add(FALSE); - } -} - -void wxCheckListBox::DoClear() -{ - m_checks.Empty(); -} - -BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox) - EVT_CHAR(wxCheckListBox::OnChar) - EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick) -END_EVENT_TABLE() - -// this will only work as soon as - -void wxCheckListBox::OnChar(wxKeyEvent& event) -{ - if ( event.GetKeyCode() == WXK_SPACE ) - { - int index = GetSelection() ; - if ( index >= 0 ) - { - Check(index, !IsChecked(index) ) ; - wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId()); - event.SetInt(index); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - else - event.Skip(); -} - -void wxCheckListBox::OnLeftClick(wxMouseEvent& event) -{ - // clicking on the item selects it, clicking on the checkmark toggles - if ( event.GetX() <= 20 /*check width*/ ) { - int lineheight ; - int topcell ; -#if TARGET_CARBON - Point pt ; - GetListCellSize( (ListHandle)m_macList , &pt ) ; - lineheight = pt.v ; - ListBounds visible ; - GetListVisibleCells( (ListHandle)m_macList , &visible ) ; - topcell = visible.top ; -#else - lineheight = (**(ListHandle)m_macList).cellSize.v ; - topcell = (**(ListHandle)m_macList).visible.top ; -#endif - size_t nItem = ((size_t)event.GetY()) / lineheight + topcell ; - - if ( nItem < (size_t)m_noItems ) - { - Check(nItem, !IsChecked(nItem) ) ; - wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId()); - event.SetInt(nItem); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - //else: it's not an error, just click outside of client zone - } - else { - // implement default behaviour: clicking on the item selects it - event.Skip(); - } -} - -#endif // wxUSE_CHECKLISTBOX diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp deleted file mode 100644 index 9f8494db9a..0000000000 --- a/src/mac/carbon/choice.cpp +++ /dev/null @@ -1,300 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: choice.cpp -// Purpose: wxChoice -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "choice.h" -#endif - -#include "wx/defs.h" -#include "wx/choice.h" -#include "wx/menu.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) -#endif - -extern MenuHandle NewUniqueMenu() ; - -wxChoice::~wxChoice() -{ - if ( HasClientObjectData() ) - { - size_t i, max = GetCount(); - - for ( i = 0; i < max; ++i ) - delete GetClientObject(i); - } - - // DeleteMenu( m_macPopUpMenuId ) ; - // DisposeMenu( m_macPopUpMenuHandle ) ; -} - -bool wxChoice::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxChoice::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 , - kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; - - m_macPopUpMenuHandle = NewUniqueMenu() ; - SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; - SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ; - if ( n > 0 ) - SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ; - MacPostControlCreate() ; - // TODO wxCB_SORT - for ( int i = 0; i < n; i++ ) - { - Append(choices[i]); - } - return TRUE; -} - -// ---------------------------------------------------------------------------- -// adding/deleting items to/from the list -// ---------------------------------------------------------------------------- -int wxChoice::DoAppend(const wxString& item) -{ - UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() ); - m_strings.Add( item ) ; - m_datas.Add( NULL ) ; - int index = m_strings.GetCount() - 1 ; - DoSetItemClientData( index , NULL ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ; - return index ; -} - -int wxChoice::DoInsert(const wxString& item, int pos) -{ - wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); - - if (pos == GetCount()) - return DoAppend(item); - - UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() ); - m_strings.Insert( item, pos ) ; - m_datas.Insert( NULL, pos ) ; - DoSetItemClientData( pos , NULL ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , pos) ; - return pos ; -} - -void wxChoice::Delete(int n) -{ - wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") ); - if ( HasClientObjectData() ) - { - delete GetClientObject(n); - } - ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ; - m_strings.RemoveAt( n ) ; - m_datas.RemoveAt( n ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ; -} - -void wxChoice::Clear() -{ - FreeData(); - for ( int i = 0 ; i < GetCount() ; i++ ) - { - ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ; - } - m_strings.Empty() ; - m_datas.Empty() ; - SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ; -} - -void wxChoice::FreeData() -{ - if ( HasClientObjectData() ) - { - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - delete GetClientObject(n); - } - } -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- -int wxChoice::GetSelection() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ; -} - -void wxChoice::SetSelection(int n) -{ - SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ; -} - -// ---------------------------------------------------------------------------- -// string list functions -// ---------------------------------------------------------------------------- - -int wxChoice::GetCount() const -{ - return m_strings.GetCount() ; -} - -int wxChoice::FindString(const wxString& s) const -{ - for( int i = 0 ; i < GetCount() ; i++ ) - { - if ( GetString( i ).IsSameAs(s, FALSE) ) - return i ; - } - return wxNOT_FOUND ; -} - -void wxChoice::SetString(int n, const wxString& s) -{ - wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented")); -#if 0 // should do this, but no Insert() so far - Delete(n); - Insert(n + 1, s); -#endif -} - -wxString wxChoice::GetString(int n) const -{ - wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""), - _T("wxChoice::GetString(): invalid index") ); - - return m_strings[n] ; -} - -// ---------------------------------------------------------------------------- -// client data -// ---------------------------------------------------------------------------- -void wxChoice::DoSetItemClientData( int n, void* clientData ) -{ - wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(), - wxT("invalid index in wxChoice::SetClientData") ); - - m_datas[n] = (char*) clientData ; -} - -void *wxChoice::DoGetItemClientData(int n) const -{ - wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL, - wxT("invalid index in wxChoice::GetClientData") ); - return (void *)m_datas[n]; -} - -void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) -{ - DoSetItemClientData(n, clientData); -} - -wxClientData* wxChoice::DoGetItemClientObject( int n ) const -{ - return (wxClientData *)DoGetItemClientData(n); -} - -void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); - int n = GetSelection(); - // actually n should be made sure by the os to be a valid selection, but ... - if ( n > -1 ) - { - event.SetInt( n ); - event.SetString(GetStringSelection()); - event.SetEventObject(this); - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - ProcessCommand(event); - } -} - -wxSize wxChoice::DoGetBestSize() const -{ - int lbWidth = GetCount() > 0 ? 20 : 100; // some defaults - int lbHeight = 20; - int wLine; -#if TARGET_CARBON - long metric ; - GetThemeMetric(kThemeMetricPopupButtonHeight , &metric ); - lbHeight = metric ; -#endif - { - wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( m_font.GetMacFontSize() ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - // Find the widest line - for(int i = 0; i < GetCount(); i++) { - wxString str(GetString(i)); - #if wxUSE_UNICODE - Point bounds={0,0} ; - SInt16 baseline ; - ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) , - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - wLine = bounds.h ; - #else - wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ; - #endif - lbWidth = wxMax(lbWidth, wLine); - } - // Add room for the popup arrow - lbWidth += 2 * lbHeight ; - // And just a bit more - int cx = ::TextWidth( "X" , 0 , 1 ) ; - lbWidth += cx ; - - } - return wxSize(lbWidth, lbHeight); -} diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp deleted file mode 100644 index e331d80f8e..0000000000 --- a/src/mac/carbon/clipbrd.cpp +++ /dev/null @@ -1,406 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: clipbrd.cpp -// Purpose: Clipboard functionality -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "clipbrd.h" -#endif - -#include "wx/app.h" -#include "wx/frame.h" -#include "wx/bitmap.h" -#include "wx/utils.h" -#include "wx/metafile.h" -#include "wx/clipbrd.h" -#include "wx/intl.h" -#include "wx/log.h" - -#ifndef __DARWIN__ -#include -#endif -#include "wx/mac/uma.h" - -#define wxUSE_DATAOBJ 1 - -#include - -// the trace mask we use with wxLogTrace() - call -// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here -// (there will be a *lot* of them!) -static const wxChar *TRACE_CLIPBOARD = _T("clipboard"); - -void *wxGetClipboardData(wxDataFormat dataFormat, long *len) -{ -#if !TARGET_CARBON - OSErr err = noErr ; -#else - OSStatus err = noErr ; -#endif - void * data = NULL ; - Size byteCount; - - switch (dataFormat.GetType()) - { - case wxDF_OEMTEXT: - dataFormat = wxDF_TEXT; - // fall through - - case wxDF_TEXT: - break; - case wxDF_UNICODETEXT: - break; - case wxDF_BITMAP : - case wxDF_METAFILE : - break ; - default: - { - wxLogError(_("Unsupported clipboard format.")); - return NULL; - } - } - -#if TARGET_CARBON - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - - if (( err = GetScrapFlavorFlags( scrapRef, dataFormat.GetFormatId(), &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) - { - Size allocSize = byteCount ; - if ( dataFormat.GetType() == wxDF_TEXT ) - allocSize += 1 ; - else if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - allocSize += 2 ; - - data = new char[ allocSize ] ; - - if (( err = GetScrapFlavorData( scrapRef, dataFormat.GetFormatId(), &byteCount , data )) == noErr ) - { - *len = allocSize ; - if ( dataFormat.GetType() == wxDF_TEXT ) - ((char*)data)[byteCount] = 0 ; - if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - ((wxChar*)data)[byteCount/2] = 0 ; - } - else - { - delete[] ((char *)data) ; - data = NULL ; - } - } - } - } - -#else - long offset ; - Handle datahandle = NewHandle(0) ; - HLock( datahandle ) ; - GetScrap( datahandle , dataFormat.GetFormatId() , &offset ) ; - HUnlock( datahandle ) ; - if ( GetHandleSize( datahandle ) > 0 ) - { - byteCount = GetHandleSize( datahandle ) ; - Size allocSize = byteCount ; - if ( dataFormat.GetType() == wxDF_TEXT ) - allocSize += 1 ; - else if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - allocSize += 2 ; - - data = new char[ allocSize ] ; - - memcpy( (char*) data , (char*) *datahandle , byteCount ) ; - if ( dataFormat.GetType() == wxDF_TEXT ) - ((char*)data)[byteCount] = 0 ; - if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - ((wxChar*)data)[byteCount/2] = 0 ; - *len = byteCount ; - } - DisposeHandle( datahandle ) ; -#endif - if ( err ) - { - wxLogSysError(_("Failed to get clipboard data.")); - - return NULL ; - } - - if ( dataFormat.GetType() == wxDF_TEXT ) - { - wxMacConvertNewlines10To13( (char*) data ) ; - } - - return data; -} - - -/* - * Generalized clipboard implementation by Matthew Flatt - */ - -IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) - -wxClipboard::wxClipboard() -{ - m_open = false ; - m_data = NULL ; -} - -wxClipboard::~wxClipboard() -{ - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } -} - -void wxClipboard::Clear() -{ - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } -#if TARGET_CARBON - OSStatus err ; - err = ClearCurrentScrap( ); -#else - OSErr err ; - err = ZeroScrap( ); -#endif - if ( err ) - { - wxLogSysError(_("Failed to empty the clipboard.")); - } -} - -bool wxClipboard::Flush() -{ - return FALSE; -} - -bool wxClipboard::Open() -{ - wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") ); - m_open = true ; - return true ; -} - -bool wxClipboard::IsOpened() const -{ - return m_open; -} - -bool wxClipboard::SetData( wxDataObject *data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - - Clear(); - // as we can only store one wxDataObject, this is the same in this - // implementation - return AddData( data ); -} - -bool wxClipboard::AddData( wxDataObject *data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - - /* we can only store one wxDataObject */ - Clear(); - - m_data = data; - - /* get formats from wxDataObjects */ - wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ]; - m_data->GetAllFormats( array ); - - for (size_t i = 0; i < m_data->GetFormatCount(); i++) - { - wxLogTrace( TRACE_CLIPBOARD, - wxT("wxClipboard now supports atom %s"), - array[i].GetId().c_str() ); - -#if !TARGET_CARBON - OSErr err = noErr ; -#else - OSStatus err = noErr ; -#endif - size_t sz = data->GetDataSize( array[i] ) ; - void* buf = malloc( sz + 1 ) ; - if ( buf ) - { - data->GetDataHere( array[i] , buf ) ; - OSType mactype = 0 ; - switch ( array[i].GetType() ) - { - case wxDF_TEXT: - case wxDF_OEMTEXT: - mactype = kScrapFlavorTypeText ; - break ; - #if wxUSE_UNICODE - case wxDF_UNICODETEXT : - mactype = kScrapFlavorTypeUnicode ; - break ; - #endif - #if wxUSE_DRAG_AND_DROP - case wxDF_METAFILE: - mactype = kScrapFlavorTypePicture ; - break ; - #endif - case wxDF_BITMAP: - case wxDF_DIB: - mactype = kScrapFlavorTypePicture ; - break ; - default: - break ; - } - UMAPutScrap( sz , mactype , buf ) ; - free( buf ) ; - } - } - - delete[] array; - - return true ; -} - -void wxClipboard::Close() -{ - wxCHECK_RET( m_open, wxT("clipboard not open") ); - - m_open = false ; - - // Get rid of cached object. If this is not done copying from another application will - // only work once - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } - -} - -bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) -{ - if ( m_data ) - { - return m_data->IsSupported( dataFormat ) ; - } -#if TARGET_CARBON - OSStatus err = noErr; - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - Size byteCount; - - if (( err = GetScrapFlavorFlags( scrapRef, dataFormat.GetFormatId(), &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) - { - return TRUE ; - } - } - } - return FALSE; - -#else - long offset ; - Handle datahandle = NewHandle(0) ; - HLock( datahandle ) ; - GetScrap( datahandle , dataFormat.GetFormatId() , &offset ) ; - HUnlock( datahandle ) ; - bool hasData = GetHandleSize( datahandle ) > 0 ; - DisposeHandle( datahandle ) ; - return hasData ; -#endif -} - -bool wxClipboard::GetData( wxDataObject& data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - size_t formatcount = data.GetFormatCount() + 1 ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - array[0] = data.GetPreferredFormat(); - data.GetAllFormats( &array[1] ); - - bool transferred = false ; - - if ( m_data ) - { - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_data->IsSupported( format ) ) - { - int size = m_data->GetDataSize( format ); - transferred = true ; - - if (size == 0) - { - data.SetData(format , 0 , 0 ) ; - } - else - { - char *d = new char[size]; - m_data->GetDataHere( format , (void*) d ); - data.SetData( format , size , d ) ; - delete[] d ; - } - } - } - } - /* get formats from wxDataObjects */ - if ( !transferred ) - { - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - - switch ( format.GetType() ) - { - case wxDF_TEXT : - case wxDF_OEMTEXT : - case wxDF_BITMAP : - case wxDF_METAFILE : - { - long len ; - char* s = (char*)wxGetClipboardData(format, &len ); - if ( s ) - { - data.SetData( format , len , s ) ; - delete [] s; - - transferred = true ; - } - } - break ; - - default : - break ; - } - } - } - - delete[] array ; - return transferred ; -} diff --git a/src/mac/carbon/colordlg.cpp b/src/mac/carbon/colordlg.cpp deleted file mode 100644 index 3c8411319b..0000000000 --- a/src/mac/carbon/colordlg.cpp +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colordlg.cpp -// Purpose: wxColourDialog class. NOTE: you can use the generic class -// if you wish, instead of implementing this. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "colordlg.h" -#endif - -#include "wx/mac/colordlg.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) -#endif - -#include "wx/mac/private.h" -#ifndef __DARWIN__ -#include -#endif - -/* - * wxColourDialog - */ - -wxColourDialog::wxColourDialog() -{ - m_dialogParent = NULL; -} - -wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data) -{ - Create(parent, data); -} - -bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) -{ - m_dialogParent = parent; - - if (data) - m_colourData = *data; - return TRUE; -} - -int wxColourDialog::ShowModal() -{ - Point where ; - RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ; - - where.h = where.v = -1; - - if (GetColor( where, "\pSelect a new palette color.", ¤tColor, &newColor )) - { - m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ; - return wxID_OK; - } - else - { - return wxID_CANCEL; - } - - return wxID_CANCEL; -} - diff --git a/src/mac/carbon/colour.cpp b/src/mac/carbon/colour.cpp deleted file mode 100644 index 86487f7a35..0000000000 --- a/src/mac/carbon/colour.cpp +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colour.cpp -// Purpose: wxColour class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "colour.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/colour.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) -#endif - -// Colour - -#include "wx/mac/private.h" - -static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green ) ; -static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green ) -{ - RGBColor* col = (RGBColor*) color ; - col->red = (red << 8) + red; - col->blue = (blue << 8) + blue; - col->green = (green << 8) + green; -} - -void wxColour::Init() -{ - m_isInit = false; - m_red = - m_blue = - m_green = 0; - - wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ; -} - -wxColour::wxColour (const wxColour& col) - : wxObject() -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel , &col.m_pixel , 6 ) ; -} - -wxColour::wxColour (const wxColour* col) -{ - m_red = col->m_red; - m_green = col->m_green; - m_blue = col->m_blue; - m_isInit = col->m_isInit; - - memcpy( &m_pixel , &col->m_pixel , 6 ) ; -} - -wxColour& wxColour::operator =(const wxColour& col) -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel , &col.m_pixel , 6 ) ; - - return *this; -} - -void wxColour::InitFromName(const wxString& name) -{ - if ( wxTheColourDatabase ) - { - wxColour col = wxTheColourDatabase->Find(name); - if ( col.Ok() ) - { - *this = col; - return; - } - } - - // leave invalid - Init(); -} - -wxColour::~wxColour () -{ -} - -void wxColour::Set (unsigned char r, unsigned char g, unsigned char b) -{ - m_red = r; - m_green = g; - m_blue = b; - m_isInit = true; - - wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ; -} - -void wxColour::Set( const WXCOLORREF* color ) -{ - RGBColor* col = (RGBColor*) color ; - memcpy( &m_pixel , color , 6 ) ; - m_red = col->red>>8 ; - m_blue = col->blue>>8 ; - m_green = col->green>>8 ; -} diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp deleted file mode 100644 index 27aa1a58de..0000000000 --- a/src/mac/carbon/combobox.cpp +++ /dev/null @@ -1,540 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: combobox.cpp -// Purpose: wxComboBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "combobox.h" -#endif - -#include "wx/combobox.h" -#include "wx/button.h" -#include "wx/menu.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) -#endif - -// composite combobox implementation by Dan "Bud" Keith bud@otsys.com - - -static int nextPopUpMenuId = 1000 ; -MenuHandle NewUniqueMenu() -{ - MenuHandle handle = NewMenu( nextPopUpMenuId , "\pMenu" ) ; - nextPopUpMenuId++ ; - return handle ; -} - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the text control and the choice -static const wxCoord MARGIN = 2; -static const int POPUPWIDTH = 18; -static const int POPUPHEIGHT = 23; - - -// ---------------------------------------------------------------------------- -// wxComboBoxText: text control forwards events to combobox -// ---------------------------------------------------------------------------- - -class wxComboBoxText : public wxTextCtrl -{ -public: - wxComboBoxText( wxComboBox * cb ) - : wxTextCtrl( cb , 1 ) - { - m_cb = cb; - } - -protected: - void OnChar( wxKeyEvent& event ) - { - if ( event.GetKeyCode() == WXK_RETURN ) - { - wxString value = GetValue(); - - if ( m_cb->GetCount() == 0 ) - { - // make Enter generate "selected" event if there is only one item - // in the combobox - without it, it's impossible to select it at - // all! - wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event.SetInt( 0 ); - event.SetString( value ); - event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); - } - else - { - // add the item to the list if it's not there yet - if ( m_cb->FindString(value) == wxNOT_FOUND ) - { - m_cb->Append(value); - m_cb->SetStringSelection(value); - - // and generate the selected event for it - wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event.SetInt( m_cb->GetCount() - 1 ); - event.SetString( value ); - event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); - } - - // This will invoke the dialog default action, such - // as the clicking the default button. - - wxWindow *parent = GetParent(); - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) { - parent = parent->GetParent() ; - } - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - - return; - } - } - - event.Skip(); - } - -private: - wxComboBox *m_cb; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxComboBoxText, wxTextCtrl) - EVT_CHAR( wxComboBoxText::OnChar) -END_EVENT_TABLE() - -class wxComboBoxChoice : public wxChoice -{ -public: - wxComboBoxChoice(wxComboBox *cb, int style) - : wxChoice( cb , 1 ) - { - m_cb = cb; - } - -protected: - void OnChoice( wxCommandEvent& e ) - { - wxString s = e.GetString(); - - m_cb->DelegateChoice( s ); - wxCommandEvent event2(wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event2.SetInt(m_cb->GetSelection()); - event2.SetEventObject(m_cb); - event2.SetString(m_cb->GetStringSelection()); - m_cb->ProcessCommand(event2); - } - -private: - wxComboBox *m_cb; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice) - EVT_CHOICE(-1, wxComboBoxChoice::OnChoice) -END_EVENT_TABLE() - -wxComboBox::~wxComboBox() -{ - // delete client objects - FreeData(); - - // delete the controls now, don't leave them alive even though they would - // still be eventually deleted by our parent - but it will be too late, the - // user code expects them to be gone now - if (m_text != NULL) { - delete m_text; - m_text = NULL; - } - if (m_choice != NULL) { - delete m_choice; - m_choice = NULL; - } -} - - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxComboBox::DoGetBestSize() const -{ - wxSize size = m_choice->GetBestSize(); - - if ( m_text != NULL ) - { - wxSize sizeText = m_text->GetBestSize(); - - size.x = POPUPWIDTH + sizeText.x + MARGIN; - } - - return size; -} - -void wxComboBox::DoMoveWindow(int x, int y, int width, int height) { - height = POPUPHEIGHT; - - wxControl::DoMoveWindow(x, y, width, height); - - if ( m_text == NULL ) - { - m_choice->SetSize(0, 0 , width, -1); - } - else - { - wxCoord wText = width - POPUPWIDTH - MARGIN; - m_text->SetSize(0, 0, wText, height); - m_choice->SetSize(0 + wText + MARGIN, 0, POPUPWIDTH, -1); - } -} - - - -// ---------------------------------------------------------------------------- -// operations forwarded to the subcontrols -// ---------------------------------------------------------------------------- - -bool wxComboBox::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return FALSE; - - return TRUE; -} - -bool wxComboBox::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return FALSE; - - return TRUE; -} - -void wxComboBox::SetFocus() -{ - if ( m_text != NULL) { - m_text->SetFocus(); - } -} - - -void wxComboBox::DelegateTextChanged( const wxString& value ) -{ - SetStringSelection( value ); -} - - -void wxComboBox::DelegateChoice( const wxString& value ) -{ - SetStringSelection( value ); -} - - -bool wxComboBox::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs( choices ); - - return Create( parent, id, value, pos, size, chs.GetCount(), - chs.GetStrings(), style, validator, name ); -} - - -bool wxComboBox::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style , - wxDefaultValidator, name) ) - { - return FALSE; - } - - m_choice = new wxComboBoxChoice(this, style ); - - wxSize csize = size; - if ( style & wxCB_READONLY ) - { - m_text = NULL; - } - else - { - m_text = new wxComboBoxText(this); - if ( size.y == -1 ) { - csize.y = m_text->GetSize().y ; - } - } - - DoSetSize(pos.x, pos.y, csize.x, csize.y); - - for ( int i = 0 ; i < n ; i++ ) - { - m_choice->DoAppend( choices[ i ] ); - } - - return TRUE; -} - -wxString wxComboBox::GetValue() const -{ - wxString result; - - if ( m_text == NULL ) - { - result = m_choice->GetString( m_choice->GetSelection() ); - } - else - { - result = m_text->GetValue(); - } - - return result; -} - -void wxComboBox::SetValue(const wxString& value) -{ - int s = FindString (value); - if (s == wxNOT_FOUND && !HasFlag(wxCB_READONLY) ) - { - m_choice->Append(value) ; - } - SetStringSelection( value ) ; -} - -// Clipboard operations -void wxComboBox::Copy() -{ - if ( m_text != NULL ) - { - m_text->Copy(); - } -} - -void wxComboBox::Cut() -{ - if ( m_text != NULL ) - { - m_text->Cut(); - } -} - -void wxComboBox::Paste() -{ - if ( m_text != NULL ) - { - m_text->Paste(); - } -} - -void wxComboBox::SetEditable(bool editable) -{ - if ( ( m_text == NULL ) && editable ) - { - m_text = new wxComboBoxText( this ); - } - else if ( ( m_text != NULL ) && !editable ) - { - delete m_text; - m_text = NULL; - } - - int currentX, currentY; - GetPosition( ¤tX, ¤tY ); - - int currentW, currentH; - GetSize( ¤tW, ¤tH ); - - DoMoveWindow( currentX, currentY, currentW, currentH ); -} - -void wxComboBox::SetInsertionPoint(long pos) -{ - // TODO -} - -void wxComboBox::SetInsertionPointEnd() -{ - // TODO -} - -long wxComboBox::GetInsertionPoint() const -{ - // TODO - return 0; -} - -long wxComboBox::GetLastPosition() const -{ - // TODO - return 0; -} - -void wxComboBox::Replace(long from, long to, const wxString& value) -{ - // TODO -} - -void wxComboBox::Remove(long from, long to) -{ - // TODO -} - -void wxComboBox::SetSelection(long from, long to) -{ - // TODO -} - -int wxComboBox::DoAppend(const wxString& item) -{ - return m_choice->DoAppend( item ) ; -} - -int wxComboBox::DoInsert(const wxString& item, int pos) -{ - return m_choice->DoInsert( item , pos ) ; -} - -void wxComboBox::DoSetItemClientData(int n, void* clientData) -{ - return m_choice->DoSetItemClientData( n , clientData ) ; -} - -void* wxComboBox::DoGetItemClientData(int n) const -{ - return m_choice->DoGetItemClientData( n ) ; -} - -void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData) -{ - return m_choice->DoSetItemClientObject( n , clientData ) ; -} - -wxClientData* wxComboBox::DoGetItemClientObject(int n) const -{ - return m_choice->DoGetItemClientObject( n ) ; -} - -void wxComboBox::FreeData() -{ - if ( HasClientObjectData() ) - { - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - SetClientObject( n, NULL ); - } - } -} - -void wxComboBox::Delete(int n) -{ - // force client object deletion - if( HasClientObjectData() ) - SetClientObject( n, NULL ); - m_choice->Delete( n ); -} - -void wxComboBox::Clear() -{ - FreeData(); - m_choice->Clear(); -} - -int wxComboBox::GetSelection() const -{ - return m_choice->GetSelection(); -} - -void wxComboBox::SetSelection(int n) -{ - m_choice->SetSelection( n ); - - if ( m_text != NULL ) - { - m_text->SetValue( GetString( n ) ); - } -} - -int wxComboBox::FindString(const wxString& s) const -{ - return m_choice->FindString( s ); -} - -wxString wxComboBox::GetString(int n) const -{ - return m_choice->GetString( n ); -} - -wxString wxComboBox::GetStringSelection() const -{ - int sel = GetSelection (); - if (sel > -1) - return wxString(this->GetString (sel)); - else - return wxEmptyString; -} - -bool wxComboBox::SetStringSelection(const wxString& sel) -{ - int s = FindString (sel); - if (s > -1) - { - SetSelection (s); - return TRUE; - } - else - return FALSE; -} - -void wxComboBox::SetString(int n, const wxString& s) -{ - m_choice->SetString( n , s ) ; -} - - -void wxComboBox::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 WXUNUSED(controlpart) , bool WXUNUSED(mouseStillDown)) -{ - wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId ); - event.SetInt(GetSelection()); - event.SetEventObject(this); - event.SetString(GetStringSelection()); - ProcessCommand(event); -} - diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp deleted file mode 100644 index 473bdec9fd..0000000000 --- a/src/mac/carbon/control.cpp +++ /dev/null @@ -1,814 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: control.cpp -// Purpose: wxControl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "control.h" -#endif - -#include "wx/defs.h" - -#include "wx/control.h" -#include "wx/panel.h" -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/radiobox.h" -#include "wx/spinbutt.h" -#include "wx/scrolbar.h" -#include "wx/button.h" -#include "wx/dialog.h" -#include "wx/statbox.h" -#include "wx/sizer.h" -#include "wx/stattext.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) - -BEGIN_EVENT_TABLE(wxControl, wxWindow) - EVT_MOUSE_EVENTS( wxControl::OnMouseEvent ) - EVT_PAINT( wxControl::OnPaint ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" -#include "wx/mac/private.h" - -// Item members - - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} cdefRec, *cdefPtr, **cdefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -ControlActionUPP wxMacLiveScrollbarActionUPP = NULL ; -wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ; - -pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode ) ; -pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode ) -{ - if ( partCode != 0) - { - wxControl* wx = (wxControl*) GetControlReference( control ) ; - if ( wx ) - { - wx->MacHandleControlClick( control , partCode , true /* stillDown */ ) ; - } - } -} - -ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ; -ControlDefUPP wxMacControlActionUPP = NULL ; - -pascal SInt32 wxMacControlDefinition(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param) -{ - - wxControl* wx = (wxControl*) wxFindControlFromMacControl( theControl ) ; - if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) ) - { - if( message == drawCntl ) - { - wxMacWindowClipper clip( wx ) ; - return InvokeControlDefUPP( varCode , theControl , message , param , (ControlDefUPP) wx->MacGetControlAction() ) ; - } - else - return InvokeControlDefUPP( varCode , theControl , message , param , (ControlDefUPP) wx->MacGetControlAction() ) ; - } - return NULL ; -} - -pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor ) -{ - OSStatus status = noErr ; - switch( iMessage ) - { - case kControlMsgSetUpBackground : - { - wxControl* wx = (wxControl*) GetControlReference( iControl ) ; - if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) ) - { - wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ; -#if TARGET_CARBON - // under classic this would lead to partial redraws - RgnHandle clip = NewRgn() ; - int x = 0 , y = 0; - - wx->MacWindowToRootWindow( &x,&y ) ; - CopyRgn( (RgnHandle) wx->MacGetVisibleRegion(false).GetWXHRGN() , clip ) ; - OffsetRgn( clip , x , y ) ; - SetClip( clip ) ; - DisposeRgn( clip ) ; -#endif - } - else - { - status = paramErr ; - } - } - break ; - default : - status = paramErr ; - break ; - } - return status ; -} - -wxControl::wxControl() -{ - m_macControl = NULL ; - m_macControlAction = NULL ; - m_macHorizontalBorder = 0 ; // additional pixels around the real control - m_macVerticalBorder = 0 ; - m_backgroundColour = *wxWHITE; - m_foregroundColour = *wxBLACK; - - if ( wxMacLiveScrollbarActionUPP == NULL ) - { -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc ); -#else - wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ; -#endif - } -} - -bool wxControl::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_macControl = NULL ; - m_macHorizontalBorder = 0 ; // additional pixels around the real control - m_macVerticalBorder = 0 ; - - bool rval = wxWindow::Create(parent, id, pos, size, style, name); - if ( parent ) - { - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - } - if (rval) { -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif - } - return rval; -} - -wxControl::~wxControl() -{ - m_isBeingDeleted = TRUE; - wxRemoveMacControlAssociation( this ) ; - // If we delete an item, we should initialize the parent panel, - // because it could now be invalid. - wxWindow *parent = GetParent() ; - if ( parent ) - { - if (parent->GetDefaultItem() == (wxButton*) this) - parent->SetDefaultItem(NULL); - } - if ( (ControlHandle) m_macControl ) - { - // in case the callback might be called during destruction - ::SetControlColorProc( (ControlHandle) m_macControl , NULL ) ; - ::DisposeControl( (ControlHandle) m_macControl ) ; - m_macControl = NULL ; - } -} - -void wxControl::SetLabel(const wxString& title) -{ - m_label = wxStripMenuCodes(title) ; - - if ( m_macControl ) - { - UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ; - } - Refresh() ; -} - -wxSize wxControl::DoGetBestSize() const -{ - if ( (ControlHandle) m_macControl == NULL ) - return wxWindow::DoGetBestSize() ; - - Rect bestsize = { 0 , 0 , 0 , 0 } ; - short baselineoffset ; - int bestWidth, bestHeight ; - ::GetBestControlRect( (ControlHandle) m_macControl , &bestsize , &baselineoffset ) ; - - if ( EmptyRect( &bestsize ) ) - { - baselineoffset = 0; - bestsize.left = bestsize.top = 0 ; - bestsize.right = 16 ; - bestsize.bottom = 16 ; - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - bestsize.bottom = 16 ; - } - else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) ) - { - bestsize.bottom = 24 ; - } - } - - bestWidth = bestsize.right - bestsize.left ; - - bestWidth += 2 * m_macHorizontalBorder ; - - bestHeight = bestsize.bottom - bestsize.top ; - if ( bestHeight < 10 ) - bestHeight = 13 ; - - bestHeight += 2 * m_macVerticalBorder; - - - return wxSize(bestWidth, bestHeight); -} - -bool wxControl::ProcessCommand (wxCommandEvent & event) -{ - // Tries: - // 1) OnCommand, starting at this window and working up parent hierarchy - // 2) OnCommand then calls ProcessEvent to search the event tables. - return GetEventHandler()->ProcessEvent(event); -} - -// ------------------------ -wxList *wxWinMacControlList = NULL; -wxControl *wxFindControlFromMacControl(ControlHandle inControl ) -{ - wxNode *node = wxWinMacControlList->Find((long)inControl); - if (!node) - return NULL; - return (wxControl *)node->GetData(); -} - -void wxAssociateControlWithMacControl(ControlHandle inControl, wxControl *control) -{ - // adding NULL WindowRef is (first) surely a result of an error and - // (secondly) breaks menu command processing - wxCHECK_RET( inControl != (ControlHandle) NULL, wxT("attempt to add a NULL WindowRef to window list") ); - - if ( !wxWinMacControlList->Find((long)inControl) ) - wxWinMacControlList->Append((long)inControl, control); -} - -void wxRemoveMacControlAssociation(wxControl *control) -{ - if ( wxWinMacControlList ) - wxWinMacControlList->DeleteObject(control); -} - -void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label , - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) -{ - m_label = label ; - - // These sizes will be adjusted in MacPostControlCreate - m_width = size.x ; - m_height = size.y ; - m_x = pos.x ; - m_y = pos.y ; - - ((Rect*)outBounds)->top = -10; - ((Rect*)outBounds)->left = -10; - ((Rect*)outBounds)->bottom = 0; - ((Rect*)outBounds)->right = 0; - - wxMacStringToPascal( wxStripMenuCodes(label) , maclabel ) ; -} - -void wxControl::MacPostControlCreate() -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - DoSetWindowVariant( m_windowVariant ) ; - /* - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - // no font - } - else if ( !UMAHasAquaLayout() && (IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) ) ) - { - ControlFontStyleRec controlstyle ; - controlstyle.flags = kControlUseFontMask ; - controlstyle.font = kControlFontSmallBoldSystemFont ; - - ::SetControlFontStyle( (ControlHandle) m_macControl , &controlstyle ) ; - } - else - { - ControlFontStyleRec controlstyle ; - controlstyle.flags = kControlUseFontMask ; - - if (IsKindOf( CLASSINFO( wxButton ) ) ) - controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ; - else - controlstyle.font = kControlFontSmallSystemFont ; - - ::SetControlFontStyle( (ControlHandle) m_macControl , &controlstyle ) ; - } - */ - ControlHandle container = (ControlHandle) GetParent()->MacGetContainerForEmbedding() ; - wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; - ::EmbedControl( (ControlHandle) m_macControl , container ) ; - m_macControlIsShown = MacIsReallyShown() ; - - wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ; - if ( wxMacSetupControlBackgroundUPP == NULL ) - { - wxMacSetupControlBackgroundUPP = NewControlColorUPP( wxMacSetupControlBackground ) ; - } - if ( wxMacControlActionUPP == NULL ) - { - wxMacControlActionUPP = NewControlDefUPP( wxMacControlDefinition ) ; - } - // The following block of code is responsible for crashes when switching - // back to windows, which can be seen in the dialogs sample. - // It is disabled until a proper solution can be found. -#if 0 -#if TARGET_CARBON -/* - only working under classic carbon - m_macControlAction = *(**(ControlHandle)m_macControl).contrlDefProc ; - (**(ControlHandle)m_macControl).contrlDefProc = (Handle) &wxMacControlActionUPP ; -*/ -#else - m_macControlAction = *(**(ControlHandle)m_macControl).contrlDefProc ; - - cdefHandle cdef ; - cdef = (cdefHandle) NewHandle( sizeof(cdefRec) ) ; - if ( (**(ControlHandle)m_macControl).contrlDefProc != NULL ) - { - (**cdef).instruction = 0x4EF9; /* JMP instruction */ - (**cdef).function = (void(*)()) wxMacControlActionUPP; - (**(ControlHandle)m_macControl).contrlDefProc = (Handle) cdef ; - } -#endif -#endif - SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ; - - // Adjust the controls size and position - wxPoint pos(m_x, m_y); - wxSize best_size( DoGetBestSize() ); - wxSize new_size( m_width, m_height ); - - m_x = m_y = m_width = m_height = -1; // Forces SetSize to move/size the control - - if (new_size.x == -1) { - new_size.x = best_size.x; - } - if (new_size.y == -1) { - new_size.y = best_size.y; - } - - SetSize(pos.x, pos.y, new_size.x, new_size.y); - -#if wxUSE_UNICODE - UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ; -#endif - - if ( m_macControlIsShown ) - UMAShowControl( (ControlHandle) m_macControl ) ; - - SetCursor( *wxSTANDARD_CURSOR ) ; - - Refresh() ; -} - -void wxControl::MacAdjustControlRect() -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - if ( m_width == -1 || m_height == -1 ) - { - Rect bestsize = { 0 , 0 , 0 , 0 } ; - short baselineoffset ; - - ::GetBestControlRect( (ControlHandle) m_macControl , &bestsize , &baselineoffset ) ; - - if ( EmptyRect( &bestsize ) ) - { - baselineoffset = 0; - bestsize.left = bestsize.top = 0 ; - bestsize.right = 16 ; - bestsize.bottom = 16 ; - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - bestsize.bottom = 16 ; - } - else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) ) - { - bestsize.bottom = 24 ; - } - } - - if ( m_width == -1 ) - { - if ( IsKindOf( CLASSINFO( wxButton ) ) ) - { - m_width = m_label.Length() * 8 + 12 ; - if ( m_width < 70 ) - m_width = 70 ; - } - else if ( IsKindOf( CLASSINFO( wxStaticText ) ) ) - { - m_width = m_label.Length() * 8 ; - } - else - m_width = bestsize.right - bestsize.left ; - - m_width += 2 * m_macHorizontalBorder + MacGetLeftBorderSize() + MacGetRightBorderSize() ; - } - if ( m_height == -1 ) - { - m_height = bestsize.bottom - bestsize.top ; - if ( m_height < 10 ) - m_height = 13 ; - - m_height += 2 * m_macVerticalBorder + MacGetTopBorderSize() + MacGetBottomBorderSize() ; - } - MacUpdateDimensions() ; - } -} - -WXWidget wxControl::MacGetContainerForEmbedding() -{ - if ( m_macControl ) - return m_macControl ; - - return wxWindow::MacGetContainerForEmbedding() ; -} - -void wxControl::MacUpdateDimensions() -{ - // actually in the current systems this should never be possible, but later reparenting - // may become a reality - - if ( (ControlHandle) m_macControl == NULL ) - return ; - - if ( GetParent() == NULL ) - return ; - - WindowRef rootwindow = (WindowRef) MacGetRootWindow() ; - if ( rootwindow == NULL ) - return ; - - Rect oldBounds ; - GetControlBounds( (ControlHandle) m_macControl , &oldBounds ) ; - - int new_x = m_x + MacGetLeftBorderSize() + m_macHorizontalBorder ; - int new_y = m_y + MacGetTopBorderSize() + m_macVerticalBorder ; - int new_width = m_width - MacGetLeftBorderSize() - MacGetRightBorderSize() - 2 * m_macHorizontalBorder ; - int new_height = m_height - MacGetTopBorderSize() - MacGetBottomBorderSize() - 2 * m_macVerticalBorder ; - - GetParent()->MacWindowToRootWindow( & new_x , & new_y ) ; - bool doMove = new_x != oldBounds.left || new_y != oldBounds.top ; - bool doResize = ( oldBounds.right - oldBounds.left ) != new_width || (oldBounds.bottom - oldBounds.top ) != new_height ; - if ( doMove || doResize ) - { - InvalWindowRect( rootwindow, &oldBounds ) ; - if ( doMove ) - { - UMAMoveControl( (ControlHandle) m_macControl , new_x , new_y ) ; - } - if ( doResize ) - { - UMASizeControl( (ControlHandle) m_macControl , new_width , new_height ) ; - } - } -} - -void wxControl::MacSuperChangedPosition() -{ - MacUpdateDimensions() ; - wxWindow::MacSuperChangedPosition() ; -} - -void wxControl::MacSuperEnabled( bool enabled ) -{ - Refresh(FALSE) ; - wxWindow::MacSuperEnabled( enabled ) ; -} - -void wxControl::MacSuperShown( bool show ) -{ - if ( (ControlHandle) m_macControl ) - { - if ( !show ) - { - if ( m_macControlIsShown ) - { - ::UMAHideControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = false ; - } - } - else - { - if ( MacIsReallyShown() && !m_macControlIsShown ) - { - ::UMAShowControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = true ; - } - } - } - - wxWindow::MacSuperShown( show ) ; -} - -void wxControl::DoSetSize(int x, int y, - int width, int height, - int sizeFlags ) -{ - wxWindow::DoSetSize( x , y ,width , height ,sizeFlags ) ; -#if 0 - { - Rect meta , control ; - GetControlBounds( (ControlHandle) m_macControl , &control ) ; - RgnHandle rgn = NewRgn() ; - GetControlRegion( (ControlHandle) m_macControl , kControlStructureMetaPart , rgn ) ; - GetRegionBounds( rgn , &meta ) ; - if ( !EmptyRect( &meta ) ) - { - wxASSERT( meta.left >= control.left - m_macHorizontalBorder ) ; - wxASSERT( meta.right <= control.right + m_macHorizontalBorder ) ; - wxASSERT( meta.top >= control.top - m_macVerticalBorder ) ; - wxASSERT( meta.bottom <= control.bottom + m_macVerticalBorder ) ; - } - DisposeRgn( rgn ) ; - } -#endif - return ; -} - -bool wxControl::Show(bool show) -{ - if ( !wxWindow::Show( show ) ) - return FALSE ; - - if ( (ControlHandle) m_macControl ) - { - if ( !show ) - { - if ( m_macControlIsShown ) - { - ::UMAHideControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = false ; - } - } - else - { - if ( MacIsReallyShown() && !m_macControlIsShown ) - { - ::UMAShowControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = true ; - } - } - } - return TRUE ; -} - -bool wxControl::Enable(bool enable) -{ - if ( !wxWindow::Enable(enable) ) - return FALSE; - - if ( (ControlHandle) m_macControl ) - { - if ( enable ) - UMAActivateControl( (ControlHandle) m_macControl ) ; - else - UMADeactivateControl( (ControlHandle) m_macControl ) ; - } - return TRUE ; -} - -void wxControl::Refresh(bool eraseBack, const wxRect *rect) -{ - wxWindow::Refresh( eraseBack , rect ) ; -} - -void wxControl::MacRedrawControl() -{ - if ( (ControlHandle) m_macControl && MacGetRootWindow() && m_macControlIsShown ) - { - wxClientDC dc(this) ; - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - UMADrawControl( (ControlHandle) m_macControl ) ; - } -} - -void wxControl::OnPaint(wxPaintEvent& event) -{ - if ( (ControlHandle) m_macControl ) - { - wxPaintDC dc(this) ; - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - UMADrawControl( (ControlHandle) m_macControl ) ; - } - else - { - event.Skip() ; - } -} -void wxControl::OnEraseBackground(wxEraseEvent& event) -{ - wxWindow::OnEraseBackground( event ) ; -} - -void wxControl::OnKeyDown( wxKeyEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - -#if TARGET_CARBON - - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - - GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter((EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - - ::HandleControlKey( (ControlHandle) m_macControl , keyCode , charCode , modifiers ) ; - -#else - EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; -#endif -} - -void wxControl::OnMouseEvent( wxMouseEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - { - event.Skip() ; - return ; - } - - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - { - control = (ControlHandle) m_macControl ; - if ( control && ::IsControlActive( control ) ) - { - { - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; - wxTheApp->s_lastMouseDown = 0 ; - if ( control && controlpart != kControlNoPart ) - { - MacHandleControlClick( control , controlpart , false /* mouse not down anymore */ ) ; - } - } - } - } - } - else - { - event.Skip() ; - } -} - -bool wxControl::MacCanFocus() const -{ - if ( (ControlHandle) m_macControl == NULL ) - return true ; - else - return false ; -} - -void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; -} - -void wxControl::DoSetWindowVariant( wxWindowVariant variant ) -{ - if ( m_macControl == NULL ) - { - wxWindow::SetWindowVariant( variant ) ; - return ; - - } - m_windowVariant = variant ; - - ControlSize size ; - ControlFontStyleRec fontStyle; - fontStyle.flags = kControlUseFontMask ; - - // we will get that from the settings later - // and make this NORMAL later, but first - // we have a few calculations that we must fix - - if ( variant == wxWINDOW_VARIANT_DEFAULT ) - { - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - variant = wxWINDOW_VARIANT_NORMAL ; - else - variant = wxWINDOW_VARIANT_SMALL ; - } - - switch ( variant ) - { - case wxWINDOW_VARIANT_NORMAL : - size = kControlSizeNormal; - fontStyle.font = kControlFontBigSystemFont; - break ; - case wxWINDOW_VARIANT_SMALL : - size = kControlSizeSmall; - fontStyle.font = kControlFontSmallSystemFont; - break ; - case wxWINDOW_VARIANT_MINI : - if (UMAGetSystemVersion() >= 0x1030 ) - { - size = 3 ; // not always defined in the header - fontStyle.font = -5 ; // not always defined in the header - } - else - { - size = kControlSizeSmall; - fontStyle.font = kControlFontSmallSystemFont; - } - break; - break ; - case wxWINDOW_VARIANT_LARGE : - size = kControlSizeLarge; - fontStyle.font = kControlFontBigSystemFont; - break ; - default: - wxFAIL_MSG(_T("unexpected window variant")); - break ; - } - ::SetControlData( (ControlHandle) m_macControl , kControlEntireControl, kControlSizeTag, sizeof( ControlSize ), &size ); - ::SetControlFontStyle( (ControlHandle) m_macControl , &fontStyle ); -} diff --git a/src/mac/carbon/corersrc.r b/src/mac/carbon/corersrc.r deleted file mode 100644 index 676a4d3d2a..0000000000 --- a/src/mac/carbon/corersrc.r +++ /dev/null @@ -1,159 +0,0 @@ -#ifdef __UNIX__ - #include -#else - #include - #if UNIVERSAL_INTERFACES_VERSION > 0x320 - #include - #endif -#endif - -resource 'ldes' ( 128 ) -{ - versionZero - { - 0 , - 0 , - 0 , - 0 , - hasVertScroll , - noHorizScroll , - 0 , - noGrowSpace , - } -} ; - -resource 'ldes' ( 129 ) -{ - versionZero - { - 0 , - 0 , - 0 , - 0 , - hasVertScroll , - hasHorizScroll , - 0 , - noGrowSpace , - } -} ; - -data 'CURS' (10) { - $"0000 03E0 0630 0808 1004 31C6 2362 2222" - $"2362 31C6 1004 0808 0630 03E0 0000 0000" - $"0000 03E0 07F0 0FF8 1FFC 3FFE 3FFE 3FFE" - $"3FFE 3FFE 1FFC 0FF8 07F0 03E0 0000 0000" - $"0007 0008" -}; - -data 'CURS' (11) { - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000" -}; - -data 'CURS' (12) { - $"00F0 0088 0108 0190 0270 0220 0440 0440" - $"0880 0880 1100 1E00 1C00 1800 1000 0000" - $"00F0 00F8 01F8 01F0 03F0 03E0 07C0 07C0" - $"0F80 0F80 1F00 1E00 1C00 1800 1000 0000" - $"000E 0003" -}; - -data 'CURS' (13) { - $"0000 1E00 2100 4080 4080 4080 4080 2180" - $"1FC0 00E0 0070 0038 001C 000E 0006 0000" - $"3F00 7F80 FFC0 FFC0 FFC0 FFC0 FFC0 7FC0" - $"3FE0 1FF0 00F8 007C 003E 001F 000F 0007" - $"0004 0004" -}; - -data 'CURS' (14) { - $"0000 07E0 1FF0 3838 3C0C 6E0E 6706 6386" - $"61C6 60E6 7076 303C 1C1C 0FF8 07E0 0000" - $"0540 0FF0 3FF8 3C3C 7E0E FF0F 6F86 E7C7" - $"63E6 E1F7 70FE 707E 3C3C 1FFC 0FF0 0540" - $"0007 0007" -}; - -data 'CURS' (15) { - $"0000 0380 0380 0380 0380 0380 0380 0FE0" - $"1FF0 1FF0 0000 1FF0 1FF0 1550 1550 1550" - $"07C0 07C0 07C0 07C0 07C0 07C0 0FE0 1FF0" - $"3FF8 3FF8 3FF8 3FF8 3FF8 3FF8 3FF8 3FF8" - $"000B 0007" -}; - -data 'CURS' (16) { - $"00C0 0140 0640 08C0 3180 47FE 8001 8001" - $"81FE 8040 01C0 0040 03C0 C080 3F80 0000" - $"00C0 01C0 07C0 0FC0 3F80 7FFE FFFF FFFF" - $"FFFE FFC0 FFC0 FFC0 FFC0 FF80 3F80 0000" - $"0006 000F" -}; - -data 'CURS' (17) { - $"0100 0280 0260 0310 018C 7FE3 8000 8000" - $"7F80 0200 0380 0200 03C0 0107 01F8 0000" - $"0100 0380 03E0 03F0 01FC 7FFF FFFF FFFF" - $"FFFF 03FF 03FF 03FF 03FF 01FF 01F8 0000" - $"0006 0000" -}; - -data 'CURS' (18) { - $"0000 4078 60FC 71CE 7986 7C06 7E0E 7F1C" - $"7FB8 7C30 6C30 4600 0630 0330 0300 0000" - $"C078 E0FC F1FE FBFF FFCF FF8F FF1F FFBE" - $"FFFC FE78 FF78 EFF8 CFF8 87F8 07F8 0300" - $"0001 0001" -}; - -data 'CURS' (19) { - $"0000 0002 0006 000E 001E 003E 007E 00FE" - $"01FE 003E 0036 0062 0060 00C0 00C0 0000" - $"0003 0007 000F 001F 003F 007F 00FF 01FF" - $"03FF 07FF 007F 00F7 00F3 01E1 01E0 01C0" - $"0001 000E" -}; - -data 'CURS' (20) { - $"0000 0080 01C0 03E0 0080 0080 0080 1FFC" - $"1FFC 0080 0080 0080 03E0 01C0 0080 0000" - $"0080 01C0 03E0 07F0 0FF8 01C0 3FFE 3FFE" - $"3FFE 3FFE 01C0 0FF8 07F0 03E0 01C0 0080" - $"0007 0008" -}; - -data 'CURS' (21) { - $"0000 0080 01C0 03E0 0080 0888 188C 3FFE" - $"188C 0888 0080 03E0 01C0 0080 0000 0000" - $"0080 01C0 03E0 07F0 0BE8 1DDC 3FFE 7FFF" - $"3FFE 1DDC 0BE8 07F0 03E0 01C0 0080 0000" - $"0007 0008" -}; - -data 'CURS' (22) { - $"0000 001E 000E 060E 0712 03A0 01C0 00E0" - $"0170 1238 1C18 1C00 1E00 0000 0000 0000" - $"007F 003F 0E1F 0F0F 0F97 07E3 03E1 21F0" - $"31F8 3A7C 3C3C 3E1C 3F00 3F80 0000 0000" - $"0006 0009" -}; - -data 'CURS' (23) { - $"0000 7800 7000 7060 48E0 05C0 0380 0700" - $"0E80 1C48 1838 0038 0078 0000 0000 0000" - $"FE00 FC00 F870 F0F0 E9F0 C7E0 87C0 0F84" - $"1F8C 3E5C 3C3C 387C 00FC 01FC 0000 0000" - $"0006 0006" -}; - -data 'CURS' (24) { - $"0006 000E 001C 0018 0020 0040 00F8 0004" - $"1FF4 200C 2AA8 1FF0 1F80 3800 6000 8000" - $"000F 001F 003E 007C 0070 00E0 01FC 3FF6" - $"7FF6 7FFE 7FFC 7FF8 3FF0 7FC0 F800 E000" - $"000A 0006" -}; - diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp deleted file mode 100644 index b780a675c9..0000000000 --- a/src/mac/carbon/cursor.cpp +++ /dev/null @@ -1,505 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp -// Purpose: wxCursor class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "cursor.h" -#endif - -#include "wx/defs.h" - -#include "wx/app.h" -#include "wx/cursor.h" -#include "wx/icon.h" -#include "wx/image.h" -#include "wx/xpmdecod.h" - -#include "wx/mac/private.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) -#endif - -const short kwxCursorBullseye = 10 ; -const short kwxCursorBlank = 11 ; -const short kwxCursorPencil = 12 ; -const short kwxCursorMagnifier = 13 ; -const short kwxCursorNoEntry = 14 ; -const short kwxCursorPaintBrush = 15 ; -const short kwxCursorPointRight = 16 ; -const short kwxCursorPointLeft = 17 ; -const short kwxCursorQuestionArrow = 18 ; -const short kwxCursorRightArrow = 19 ; -const short kwxCursorSizeNS = 20 ; -const short kwxCursorSize = 21 ; -const short kwxCursorSizeNESW = 22 ; -const short kwxCursorSizeNWSE = 23 ; -const short kwxCursorRoller = 24 ; - -wxCursor gMacCurrentCursor ; - -wxCursorRefData::wxCursorRefData() -{ - m_width = 16; - m_height = 16; - m_hCursor = NULL ; - m_disposeHandle = false ; - m_releaseHandle = false ; - m_isColorCursor = false ; - m_themeCursor = -1 ; -} - -wxCursorRefData::~wxCursorRefData() -{ - if ( m_isColorCursor ) - { - ::DisposeCCursor( (CCrsrHandle) m_hCursor ) ; - } - else if ( m_disposeHandle ) - { - ::DisposeHandle( (Handle ) m_hCursor ) ; - } - else if ( m_releaseHandle ) - { - // we don't release the resource since it may already - // be in use again - } -} - -// Cursors -wxCursor::wxCursor() -{ -} - -wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[]) -{ -} - -wxCursor::wxCursor( const wxImage &image ) -{ - CreateFromImage( image ) ; -} - -wxCursor::wxCursor(const char **bits) -{ - (void) CreateFromXpm(bits); -} - -wxCursor::wxCursor(char **bits) -{ - (void) CreateFromXpm((const char **)bits); -} - -bool wxCursor::CreateFromXpm(const char **bits) -{ - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") ) - wxXPMDecoder decoder; - wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") ) - CreateFromImage( img ) ; - return TRUE; -} - -short GetCTabIndex( CTabHandle colors , RGBColor *col ) -{ - short retval = 0 ; - unsigned long bestdiff = 0xFFFF ; - for ( int i = 0 ; i < (**colors).ctSize ; ++i ) - { - unsigned long diff = abs(col->red - (**colors).ctTable[i].rgb.red ) + - abs(col->green - (**colors).ctTable[i].rgb.green ) + - abs(col->blue - (**colors).ctTable[i].rgb.blue ) ; - if ( diff < bestdiff ) - { - bestdiff = diff ; - retval = (**colors).ctTable[i].value ; - } - } - return retval ; -} - -void wxCursor::CreateFromImage(const wxImage & image) -{ - m_refData = new wxCursorRefData; - - wxImage image16 = image.Scale(16,16) ; - unsigned char * rgbBits = image16.GetData(); - - - int w = image16.GetWidth() ; - int h = image16.GetHeight() ; - bool bHasMask = image16.HasMask() ; - - int hotSpotX = image16.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X); - int hotSpotY = image16.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y); - if (hotSpotX < 0 || hotSpotX >= w) - hotSpotX = 0; - if (hotSpotY < 0 || hotSpotY >= h) - hotSpotY = 0; - -#if 0 - // monochrome implementation - M_CURSORDATA->m_hCursor = NewHandle( sizeof( Cursor ) ) ; - M_CURSORDATA->m_disposeHandle = true ; - HLock( (Handle) M_CURSORDATA->m_hCursor ) ; - CursPtr cp = *(CursHandle)M_CURSORDATA->m_hCursor ; - memset( cp->data , 0 , sizeof( Bits16 ) ) ; - memset( cp->mask , 0 , sizeof( Bits16 ) ) ; - - unsigned char mr = image16.GetMaskRed() ; - unsigned char mg = image16.GetMaskGreen() ; - unsigned char mb = image16.GetMaskBlue() ; - for ( int y = 0 ; y < h ; ++y ) - { - short rowbits = 0 ; - short maskbits = 0 ; - - for ( int x = 0 ; x < w ; ++x ) - { - long pos = (y * w + x) * 3; - - unsigned char r = rgbBits[pos] ; - unsigned char g = rgbBits[pos+1] ; - unsigned char b = rgbBits[pos+2] ; - if ( bHasMask && r==mr && g==mg && b==mb ) - { - // masked area, does not appear anywhere - } - else - { - if ( (int)r + (int)g + (int)b < 0x0200 ) - { - rowbits |= ( 1 << (15-x) ) ; - } - maskbits |= ( 1 << (15-x) ) ; - } - } - cp->data[y] = rowbits ; - cp->mask[y] = maskbits ; - } - if ( !bHasMask ) - { - memcpy( cp->mask , cp->data , sizeof( Bits16) ) ; - } - cp->hotSpot.h = hotSpotX ; - cp->hotSpot.v = hotSpotY ; - HUnlock( (Handle) M_CURSORDATA->m_hCursor ) ; -#else - PixMapHandle pm = (PixMapHandle) NewHandleClear( sizeof (PixMap)) ; - short extent = 16 ; - short bytesPerPixel = 1 ; - short depth = 8 ; - Rect bounds = { 0 , 0 , extent , extent } ; - CCrsrHandle ch = (CCrsrHandle) NewHandleClear ( sizeof( CCrsr ) ) ; - CTabHandle newColors = GetCTable( 8 ) ; - HandToHand((Handle *) &newColors); - // set the values to the indices - for ( int i = 0 ; i < (**newColors).ctSize ; ++i ) - { - (**newColors).ctTable[i].value = i ; - } - HLock( (Handle) ch) ; - (**ch).crsrType = 0x8001 ; // color cursors - (**ch).crsrMap = pm ; - short bytesPerRow = bytesPerPixel * extent ; - - (**pm).baseAddr = 0; - (**pm).rowBytes = bytesPerRow | 0x8000; - (**pm).bounds = bounds; - (**pm).pmVersion = 0; - (**pm).packType = 0; - (**pm).packSize = 0; - (**pm).hRes = 0x00480000; /* 72 DPI default res */ - (**pm).vRes = 0x00480000; /* 72 DPI default res */ - (**pm).pixelSize = depth; - (**pm).pixelType = 0; - (**pm).cmpCount = 1; - (**pm).cmpSize = depth; - (**pm).pmTable = newColors; - - (**ch).crsrData = NewHandleClear( extent * bytesPerRow ) ; - (**ch).crsrXData = NULL ; - (**ch).crsrXValid = 0; - (**ch).crsrXHandle = NULL; - - (**ch).crsrHotSpot.h = hotSpotX ; - (**ch).crsrHotSpot.v = hotSpotY ; - (**ch).crsrXTable = NULL ; - (**ch).crsrID = GetCTSeed() ; - - memset( (**ch).crsr1Data , 0 , sizeof( Bits16 ) ) ; - memset( (**ch).crsrMask , 0 , sizeof( Bits16 ) ) ; - - unsigned char mr = image16.GetMaskRed() ; - unsigned char mg = image16.GetMaskGreen() ; - unsigned char mb = image16.GetMaskBlue() ; - for ( int y = 0 ; y < h ; ++y ) - { - short rowbits = 0 ; - short maskbits = 0 ; - - for ( int x = 0 ; x < w ; ++x ) - { - long pos = (y * w + x) * 3; - - unsigned char r = rgbBits[pos] ; - unsigned char g = rgbBits[pos+1] ; - unsigned char b = rgbBits[pos+2] ; - RGBColor col = { 0xFFFF ,0xFFFF, 0xFFFF } ; - - if ( bHasMask && r==mr && g==mg && b==mb ) - { - // masked area, does not appear anywhere - } - else - { - if ( (int)r + (int)g + (int)b < 0x0200 ) - { - rowbits |= ( 1 << (15-x) ) ; - } - maskbits |= ( 1 << (15-x) ) ; - - col = *((RGBColor*) wxColor( r , g , b ).GetPixel()) ; - } - *((*(**ch).crsrData) + y * bytesPerRow + x) = - GetCTabIndex( newColors , &col) ; - } - (**ch).crsr1Data[y] = rowbits ; - (**ch).crsrMask[y] = maskbits ; - } - if ( !bHasMask ) - { - memcpy( (**ch).crsrMask , (**ch).crsr1Data , sizeof( Bits16) ) ; - } - - HUnlock((Handle) ch) ; - M_CURSORDATA->m_hCursor = ch ; - M_CURSORDATA->m_isColorCursor = true ; -#endif -} - -wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY) -{ - m_refData = new wxCursorRefData; - if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE ) - { - Str255 theName ; - wxMacStringToPascal( cursor_file , theName ) ; - - wxStAppResource resload ; - Handle resHandle = ::GetNamedResource( 'crsr' , theName ) ; - if ( resHandle ) - { - short theId = -1 ; - OSType theType ; - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - M_CURSORDATA->m_hCursor = GetCCursor( theId ) ; - if ( M_CURSORDATA->m_hCursor ) - M_CURSORDATA->m_isColorCursor = true ; - } - else - { - Handle resHandle = ::GetNamedResource( 'CURS' , theName ) ; - if ( resHandle ) - { - short theId = -1 ; - OSType theType ; - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - M_CURSORDATA->m_hCursor = GetCursor( theId ) ; - if ( M_CURSORDATA->m_hCursor ) - M_CURSORDATA->m_releaseHandle = true ; - } - } - } - else - { - wxImage image ; - image.LoadFile( cursor_file , flags ) ; - if( image.Ok() ) - { - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,hotSpotX ) ; - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y,hotSpotY ) ; - delete m_refData ; - CreateFromImage(image) ; - } - } -} - -// Cursors by stock number -wxCursor::wxCursor(int cursor_type) -{ - m_refData = new wxCursorRefData; - - switch (cursor_type) - { - case wxCURSOR_COPY_ARROW: - M_CURSORDATA->m_themeCursor = kThemeCopyArrowCursor ; - break; - case wxCURSOR_WAIT: - M_CURSORDATA->m_themeCursor = kThemeWatchCursor ; - break; - case wxCURSOR_IBEAM: - M_CURSORDATA->m_themeCursor = kThemeIBeamCursor ; - break; - case wxCURSOR_CROSS: - M_CURSORDATA->m_themeCursor = kThemeCrossCursor; - break; - case wxCURSOR_SIZENWSE: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNWSE); - } - break; - case wxCURSOR_SIZENESW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNESW); - } - break; - case wxCURSOR_SIZEWE: - { - M_CURSORDATA->m_themeCursor = kThemeResizeLeftRightCursor; - } - break; - case wxCURSOR_SIZENS: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNS); - } - break; - case wxCURSOR_SIZING: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSize); - } - break; - case wxCURSOR_HAND: - { - M_CURSORDATA->m_themeCursor = kThemePointingHandCursor; - } - break; - case wxCURSOR_BULLSEYE: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorBullseye); - } - break; - case wxCURSOR_PENCIL: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPencil); - } - break; - case wxCURSOR_MAGNIFIER: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorMagnifier); - } - break; - case wxCURSOR_NO_ENTRY: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorNoEntry); - } - break; - case wxCURSOR_WATCH: - { - M_CURSORDATA->m_themeCursor = kThemeWatchCursor; - break; - } - case wxCURSOR_PAINT_BRUSH: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPaintBrush); - break; - } - case wxCURSOR_POINT_LEFT: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPointLeft); - break; - } - case wxCURSOR_POINT_RIGHT: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPointRight); - break; - } - case wxCURSOR_QUESTION_ARROW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorQuestionArrow); - break; - } - case wxCURSOR_BLANK: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorBlank); - break; - } - case wxCURSOR_RIGHT_ARROW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorRightArrow); - break; - } - case wxCURSOR_SPRAYCAN: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorRoller); - break; - } - case wxCURSOR_CHAR: - case wxCURSOR_ARROW: - case wxCURSOR_LEFT_BUTTON: - case wxCURSOR_RIGHT_BUTTON: - case wxCURSOR_MIDDLE_BUTTON: - default: - M_CURSORDATA->m_themeCursor = kThemeArrowCursor ; - break; - } - if ( M_CURSORDATA->m_themeCursor == -1 ) - M_CURSORDATA->m_releaseHandle = true ; -} - -void wxCursor::MacInstall() const -{ - gMacCurrentCursor = *this ; - if ( m_refData && M_CURSORDATA->m_themeCursor != -1 ) - { - SetThemeCursor( M_CURSORDATA->m_themeCursor ) ; - } - else if ( m_refData && M_CURSORDATA->m_hCursor ) - { - if ( M_CURSORDATA->m_isColorCursor ) - ::SetCCursor( (CCrsrHandle) M_CURSORDATA->m_hCursor ) ; - else - ::SetCursor( * (CursHandle) M_CURSORDATA->m_hCursor ) ; - } - else - { - SetThemeCursor( kThemeArrowCursor ) ; - } -} - -wxCursor::~wxCursor() -{ -} - -// Global cursor setting -void wxSetCursor(const wxCursor& cursor) -{ - cursor.MacInstall() ; -} - - diff --git a/src/mac/carbon/data.cpp b/src/mac/carbon/data.cpp deleted file mode 100644 index 1f0bea00d2..0000000000 --- a/src/mac/carbon/data.cpp +++ /dev/null @@ -1,25 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/data.cpp -// Purpose: Various global Mac-specific data -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/event.h" - -#if wxUSE_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 -const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; } - -const wxEventTable wxEvtHandler::sm_eventTable = - { NULL, &wxEvtHandler::sm_eventTableEntries[0] }; - -const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } }; -#endif - diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp deleted file mode 100644 index 64dc8053d0..0000000000 --- a/src/mac/carbon/dataobj.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.cpp -// Purpose: implementation of wxDataObject class -// Author: Stefan Csomor -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifndef WX_PRECOMP -#include "wx/intl.h" -#endif -#include "wx/defs.h" - -#include "wx/log.h" -#include "wx/dataobj.h" -#include "wx/mstream.h" -#include "wx/image.h" -#include "wx/mac/private.h" -#include - -// ---------------------------------------------------------------------------- -// functions -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// wxDataFormat -// ---------------------------------------------------------------------------- - -wxDataFormat::wxDataFormat() -{ - m_type = wxDF_INVALID; - m_format = 0; -} - -wxDataFormat::wxDataFormat( wxDataFormatId vType ) -{ - SetType(vType); -} - -wxDataFormat::wxDataFormat( const wxChar* zId) -{ - SetId(zId); -} - -wxDataFormat::wxDataFormat( const wxString& rId) -{ - SetId(rId); -} - -wxDataFormat::wxDataFormat( NativeFormat vFormat) -{ - SetId(vFormat); -} - -void wxDataFormat::SetType( wxDataFormatId Type ) -{ - m_type = Type; - - if (m_type == wxDF_TEXT ) - m_format = kScrapFlavorTypeText; - else if (m_type == wxDF_UNICODETEXT ) - m_format = kScrapFlavorTypeUnicode ; - else if (m_type == wxDF_BITMAP || m_type == wxDF_METAFILE ) - m_format = kScrapFlavorTypePicture; - else if (m_type == wxDF_FILENAME) - m_format = kDragFlavorTypeHFS ; - else - { - wxFAIL_MSG( wxT("invalid dataformat") ); - - // this is '????' but it can't be used in the code because ??' is - // parsed as a trigraph! - m_format = 0x3f3f3f3f; - } -} - -wxString wxDataFormat::GetId() const -{ - // note that m_format is not a pointer to string, it *is* itself a 4 - // character string - char text[5] ; - strncpy( text , (char*) &m_format , 4 ) ; - text[4] = 0 ; - - return wxString::FromAscii( text ) ; -} - -void wxDataFormat::SetId( NativeFormat format ) -{ - m_format = format; - - if (m_format == kScrapFlavorTypeText) - m_type = wxDF_TEXT; - else if (m_format == kScrapFlavorTypeUnicode ) - m_type = wxDF_UNICODETEXT; - else if (m_format == kScrapFlavorTypePicture) - m_type = wxDF_BITMAP; - else if (m_format == kDragFlavorTypeHFS ) - m_type = wxDF_FILENAME; - else - m_type = wxDF_PRIVATE; -} - -void wxDataFormat::SetId( const wxChar* zId ) -{ - m_type = wxDF_PRIVATE; - m_format = 0;// TODO: get the format gdk_atom_intern( wxMBSTRINGCAST tmp.mbc_str(), FALSE ); -} - -//------------------------------------------------------------------------- -// wxDataObject -//------------------------------------------------------------------------- - -wxDataObject::wxDataObject() -{ -} - -bool wxDataObject::IsSupportedFormat( - const wxDataFormat& rFormat -, Direction vDir -) const -{ - size_t nFormatCount = GetFormatCount(vDir); - - if (nFormatCount == 1) - { - return rFormat == GetPreferredFormat(); - } - else - { - wxDataFormat* pFormats = new wxDataFormat[nFormatCount]; - GetAllFormats( pFormats - ,vDir - ); - - size_t n; - - for (n = 0; n < nFormatCount; n++) - { - if (pFormats[n] == rFormat) - break; - } - - delete [] pFormats; - - // found? - return n < nFormatCount; - } -} - -// ---------------------------------------------------------------------------- -// wxFileDataObject -// ---------------------------------------------------------------------------- - -bool wxFileDataObject::GetDataHere( - void* pBuf -) const -{ - wxString sFilenames; - - for (size_t i = 0; i < m_filenames.GetCount(); i++) - { - sFilenames += m_filenames[i]; - sFilenames += (wxChar)0; - } - - memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1); - return TRUE; -} - -size_t wxFileDataObject::GetDataSize() const -{ - size_t nRes = 0; - - for (size_t i = 0; i < m_filenames.GetCount(); i++) - { - nRes += m_filenames[i].Len(); - nRes += 1; - } - - return nRes + 1; -} - -bool wxFileDataObject::SetData( - size_t WXUNUSED(nSize) -, const void* pBuf -) -{ - m_filenames.Empty(); - - AddFile(wxString::FromAscii((char*)pBuf)); - - return TRUE; -} - -void wxFileDataObject::AddFile( - const wxString& rFilename -) -{ - m_filenames.Add(rFilename); -} - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject -// ---------------------------------------------------------------------------- - -wxBitmapDataObject::wxBitmapDataObject() -{ - Init(); -} - -wxBitmapDataObject::wxBitmapDataObject( - const wxBitmap& rBitmap -) -: wxBitmapDataObjectBase(rBitmap) -{ - Init(); - if ( m_bitmap.Ok() ) - { - m_pictHandle = m_bitmap.GetPict( &m_pictCreated ) ; - } -} - -wxBitmapDataObject::~wxBitmapDataObject() -{ - Clear(); -} - -void wxBitmapDataObject::SetBitmap( - const wxBitmap& rBitmap -) -{ - Clear(); - wxBitmapDataObjectBase::SetBitmap(rBitmap); - if ( m_bitmap.Ok() ) - { - m_pictHandle = m_bitmap.GetPict( &m_pictCreated ) ; - } -} - -void wxBitmapDataObject::Init() -{ - m_pictHandle = NULL ; - m_pictCreated = false ; -} - -void wxBitmapDataObject::Clear() -{ - if ( m_pictCreated && m_pictHandle ) - { - KillPicture( (PicHandle) m_pictHandle ) ; - } - m_pictHandle = NULL ; -} - -bool wxBitmapDataObject::GetDataHere( - void* pBuf -) const -{ - if (!m_pictHandle) - { - wxFAIL_MSG(wxT("attempt to copy empty bitmap failed")); - return FALSE; - } - memcpy(pBuf, *(Handle)m_pictHandle, GetHandleSize((Handle)m_pictHandle)); - return TRUE; -} - -size_t wxBitmapDataObject::GetDataSize() const -{ - return GetHandleSize((Handle)m_pictHandle) ; -} - -bool wxBitmapDataObject::SetData( - size_t nSize -, const void* pBuf -) -{ - Clear(); - PicHandle picHandle = (PicHandle) NewHandle( nSize ) ; - memcpy( *picHandle , pBuf , nSize ) ; - m_pictHandle = picHandle ; - m_pictCreated = false ; - Rect frame = (**picHandle).picFrame ; - - m_bitmap.SetPict( picHandle ) ; - m_bitmap.SetWidth( frame.right - frame.left ) ; - m_bitmap.SetHeight( frame.bottom - frame.top ) ; - return m_bitmap.Ok(); -} diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp deleted file mode 100644 index d906bac5a4..0000000000 --- a/src/mac/carbon/dc.cpp +++ /dev/null @@ -1,2297 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.cpp -// Purpose: wxDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dc.h" -#endif - -#include "wx/dc.h" -#include "wx/app.h" -#include "wx/mac/uma.h" -#include "wx/dcmemory.h" -#include "wx/dcprint.h" -#include "wx/region.h" -#include "wx/image.h" -#include "wx/log.h" - -#if __MSL__ >= 0x6000 -#include "math.h" -using namespace std ; -#endif - -#include "wx/mac/private.h" -#include -#include -#include -#include -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) -#endif - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define mm2inches 0.0393700787402 -#define inches2mm 25.4 -#define mm2twips 56.6929133859 -#define twips2mm 0.0176388888889 -#define mm2pt 2.83464566929 -#define pt2mm 0.352777777778 -#if !defined( __DARWIN__ ) || defined(__MWERKS__) -#ifndef M_PI -const double M_PI = 3.14159265358979 ; -#endif -#endif -const double RAD2DEG = 180.0 / M_PI; -const short kEmulatedMode = -1 ; -const short kUnsupportedMode = -2 ; - -extern TECObjectRef s_TECNativeCToUnicode ; - -// set to 0 if problems arise -#define wxMAC_EXPERIMENTAL_DC 1 - -wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) : - m_ph( (GrafPtr) dc->m_macPort ) -{ - wxASSERT( dc->Ok() ) ; - m_dc = dc ; - dc->MacSetupPort(&m_ph) ; -} -wxMacPortSetter::~wxMacPortSetter() -{ - m_dc->MacCleanupPort(&m_ph) ; -} - -#if wxMAC_EXPERIMENTAL_DC -class wxMacFastPortSetter -{ -public : - wxMacFastPortSetter( const wxDC *dc ) - { - wxASSERT( dc->Ok() ) ; - GetPort( &m_oldPort ) ; - SetPort( (GrafPtr) dc->m_macPort ) ; - m_clipRgn = NewRgn() ; - GetClip( m_clipRgn ) ; - m_dc = dc ; - dc->MacSetupPort( NULL ) ; - } - ~wxMacFastPortSetter() - { - SetPort( (GrafPtr) m_dc->m_macPort ) ; - SetClip( m_clipRgn ) ; - SetPort( m_oldPort ) ; - m_dc->MacCleanupPort( NULL ) ; - DisposeRgn( m_clipRgn ) ; - } -private : - RgnHandle m_clipRgn ; - GrafPtr m_oldPort ; - const wxDC* m_dc ; -} ; - -#else -typedef wxMacPortSetter wxMacFastPortSetter ; -#endif - -#if 0 - -// start moving to a dual implementation for QD and CGContextRef - -class wxMacGraphicsContext -{ -public : - void DrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) = 0 ; - void SetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) = 0 ; - void SetClippingRegion( const wxRegion ®ion ) = 0 ; - void DestroyClippingRegion() = 0 ; - void SetTextForeground( const wxColour &col ) = 0 ; - void SetTextBackground( const wxColour &col ) = 0 ; - void SetLogicalScale( double x , double y ) = 0 ; - void SetUserScale( double x , double y ) = 0; -} ; - -class wxMacQuickDrawContext : public wxMacGraphicsContext -{ -public : -} ; - -#endif - -wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) -{ - m_formerClip = NewRgn() ; - m_newClip = NewRgn() ; - GetClip( m_formerClip ) ; - - if ( win ) - { -#if 0 - // this clipping area was set to the parent window's drawing area, lead to problems - // with MacOSX controls drawing outside their wx' rectangle - RgnHandle insidergn = NewRgn() ; - int x = 0 , y = 0; - wxWindow *parent = win->GetParent() ; - parent->MacWindowToRootWindow( &x,&y ) ; - wxSize size = parent->GetSize() ; - SetRectRgn( insidergn , parent->MacGetLeftBorderSize() , parent->MacGetTopBorderSize() , - size.x - parent->MacGetRightBorderSize(), - size.y - parent->MacGetBottomBorderSize()) ; - CopyRgn( (RgnHandle) parent->MacGetVisibleRegion(false).GetWXHRGN() , m_newClip ) ; - SectRgn( m_newClip , insidergn , m_newClip ) ; - OffsetRgn( m_newClip , x , y ) ; - SetClip( m_newClip ) ; - DisposeRgn( insidergn ) ; -#else - int x = 0 , y = 0; - win->MacWindowToRootWindow( &x,&y ) ; - CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; - OffsetRgn( m_newClip , x , y ) ; - SetClip( m_newClip ) ; -#endif - } -} - -wxMacWindowClipper::~wxMacWindowClipper() -{ - SetClip( m_formerClip ) ; - DisposeRgn( m_newClip ) ; - DisposeRgn( m_formerClip ) ; -} - -//----------------------------------------------------------------------------- -// Local functions -//----------------------------------------------------------------------------- -static inline double dmin(double a, double b) { return a < b ? a : b; } -static inline double dmax(double a, double b) { return a > b ? a : b; } -static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } - -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- -// this function emulates all wx colour manipulations, used to verify the implementation -// by setting the mode in the blitting functions to kEmulatedMode -void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ; - -void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) -{ - switch ( logical_func ) - { - case wxAND: // src AND dst - dstColor.red = dstColor.red & srcColor.red ; - dstColor.green = dstColor.green & srcColor.green ; - dstColor.blue = dstColor.blue & srcColor.blue ; - break ; - case wxAND_INVERT: // (NOT src) AND dst - dstColor.red = dstColor.red & ~srcColor.red ; - dstColor.green = dstColor.green & ~srcColor.green ; - dstColor.blue = dstColor.blue & ~srcColor.blue ; - break ; - case wxAND_REVERSE:// src AND (NOT dst) - dstColor.red = ~dstColor.red & srcColor.red ; - dstColor.green = ~dstColor.green & srcColor.green ; - dstColor.blue = ~dstColor.blue & srcColor.blue ; - break ; - case wxCLEAR: // 0 - dstColor.red = 0 ; - dstColor.green = 0 ; - dstColor.blue = 0 ; - break ; - case wxCOPY: // src - dstColor.red = srcColor.red ; - dstColor.green = srcColor.green ; - dstColor.blue = srcColor.blue ; - break ; - case wxEQUIV: // (NOT src) XOR dst - dstColor.red = dstColor.red ^ ~srcColor.red ; - dstColor.green = dstColor.green ^ ~srcColor.green ; - dstColor.blue = dstColor.blue ^ ~srcColor.blue ; - break ; - case wxINVERT: // NOT dst - dstColor.red = ~dstColor.red ; - dstColor.green = ~dstColor.green ; - dstColor.blue = ~dstColor.blue ; - break ; - case wxNAND: // (NOT src) OR (NOT dst) - dstColor.red = ~dstColor.red | ~srcColor.red ; - dstColor.green = ~dstColor.green | ~srcColor.green ; - dstColor.blue = ~dstColor.blue | ~srcColor.blue ; - break ; - case wxNOR: // (NOT src) AND (NOT dst) - dstColor.red = ~dstColor.red & ~srcColor.red ; - dstColor.green = ~dstColor.green & ~srcColor.green ; - dstColor.blue = ~dstColor.blue & ~srcColor.blue ; - break ; - case wxNO_OP: // dst - break ; - case wxOR: // src OR dst - dstColor.red = dstColor.red | srcColor.red ; - dstColor.green = dstColor.green | srcColor.green ; - dstColor.blue = dstColor.blue | srcColor.blue ; - break ; - case wxOR_INVERT: // (NOT src) OR dst - dstColor.red = dstColor.red | ~srcColor.red ; - dstColor.green = dstColor.green | ~srcColor.green ; - dstColor.blue = dstColor.blue | ~srcColor.blue ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - dstColor.red = ~dstColor.red | srcColor.red ; - dstColor.green = ~dstColor.green | srcColor.green ; - dstColor.blue = ~dstColor.blue | srcColor.blue ; - break ; - case wxSET: // 1 - dstColor.red = 0xFFFF ; - dstColor.green = 0xFFFF ; - dstColor.blue = 0xFFFF ; - break ; - case wxSRC_INVERT: // (NOT src) - dstColor.red = ~srcColor.red ; - dstColor.green = ~srcColor.green ; - dstColor.blue = ~srcColor.blue ; - break ; - case wxXOR: // src XOR dst - dstColor.red = dstColor.red ^ srcColor.red ; - dstColor.green = dstColor.green ^ srcColor.green ; - dstColor.blue = dstColor.blue ^ srcColor.blue ; - break ; - } -} - -wxDC::wxDC() -{ - m_ok = FALSE; - m_colour = TRUE; - m_mm_to_pix_x = mm2pt; - m_mm_to_pix_y = mm2pt; - m_internalDeviceOriginX = 0; - m_internalDeviceOriginY = 0; - m_externalDeviceOriginX = 0; - m_externalDeviceOriginY = 0; - m_logicalScaleX = 1.0; - m_logicalScaleY = 1.0; - m_userScaleX = 1.0; - m_userScaleY = 1.0; - m_scaleX = 1.0; - m_scaleY = 1.0; - m_needComputeScaleX = FALSE; - m_needComputeScaleY = FALSE; - m_macPort = NULL ; - m_macMask = NULL ; - m_ok = FALSE ; - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - m_macLocalOrigin.x = m_macLocalOrigin.y = 0 ; - m_macBoundaryClipRgn = NewRgn() ; - m_macCurrentClipRgn = NewRgn() ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , -32000 , -32000 , 32000 , 32000 ) ; - SetRectRgn( (RgnHandle) m_macCurrentClipRgn , -32000 , -32000 , 32000 , 32000 ) ; - m_pen = *wxBLACK_PEN; - m_font = *wxNORMAL_FONT; - m_brush = *wxWHITE_BRUSH; -#ifdef __WXDEBUG__ - // needed to debug possible errors with two active drawing methods at the same time on - // the same DC - m_macCurrentPortStateHelper = NULL ; -#endif - m_macATSUIStyle = NULL ; - m_macAliasWasEnabled = false; - m_macForegroundPixMap = NULL ; - m_macBackgroundPixMap = NULL ; -} - -wxDC::~wxDC(void) -{ - DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ; - DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ; -} - -void wxDC::MacSetupPort(wxMacPortStateHelper* help) const -{ -#ifdef __WXDEBUG__ - wxASSERT( m_macCurrentPortStateHelper == NULL ) ; - m_macCurrentPortStateHelper = help ; -#endif - SetClip( (RgnHandle) m_macCurrentClipRgn); -#if ! wxMAC_EXPERIMENTAL_DC - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; -#endif -} -void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const -{ -#ifdef __WXDEBUG__ - wxASSERT( m_macCurrentPortStateHelper == help ) ; - m_macCurrentPortStateHelper = NULL ; -#endif - if( m_macATSUIStyle ) - { - ::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle); - m_macATSUIStyle = NULL ; - } - if ( m_macAliasWasEnabled ) - { - SetAntiAliasedTextEnabled(m_macFormerAliasState, m_macFormerAliasSize); - m_macAliasWasEnabled = false ; - } - if ( m_macForegroundPixMap ) - { - Pattern blackColor ; - ::PenPat(GetQDGlobalsBlack(&blackColor)); - DisposePixPat( (PixPatHandle) m_macForegroundPixMap ) ; - m_macForegroundPixMap = NULL ; - } - if ( m_macBackgroundPixMap ) - { - Pattern whiteColor ; - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - DisposePixPat( (PixPatHandle) m_macBackgroundPixMap ) ; - m_macBackgroundPixMap = NULL ; - } -} - -void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord w = bmp.GetWidth(); - wxCoord h = bmp.GetHeight(); - wxCoord ww = XLOG2DEVREL(w); - wxCoord hh = YLOG2DEVREL(h); - // Set up drawing mode - short mode = (m_logicalFunction == wxCOPY ? srcCopy : - //m_logicalFunction == wxCLEAR ? WHITENESS : - //m_logicalFunction == wxSET ? BLACKNESS : - m_logicalFunction == wxINVERT ? hilite : - //m_logicalFunction == wxAND ? MERGECOPY : - m_logicalFunction == wxOR ? srcOr : - m_logicalFunction == wxSRC_INVERT ? notSrcCopy : - m_logicalFunction == wxXOR ? srcXor : - m_logicalFunction == wxOR_REVERSE ? notSrcOr : - //m_logicalFunction == wxAND_REVERSE ? SRCERASE : - //m_logicalFunction == wxSRC_OR ? srcOr : - //m_logicalFunction == wxSRC_AND ? SRCAND : - srcCopy ); - if ( bmp.GetBitmapType() == kMacBitmapTypePict ) { - Rect bitmaprect = { 0 , 0 , hh, ww }; - ::OffsetRect( &bitmaprect, xx, yy ) ; - ::DrawPicture( (PicHandle) bmp.GetPict(), &bitmaprect ) ; - } - else if ( bmp.GetBitmapType() == kMacBitmapTypeGrafWorld ) - { - GWorldPtr bmapworld = MAC_WXHBITMAP( bmp.GetHBITMAP() ); - PixMapHandle bmappixels ; - // Set foreground and background colours (for bitmaps depth = 1) - if(bmp.GetDepth() == 1) - { - RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel()); - RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()); - RGBForeColor(&fore); - RGBBackColor(&back); - } - else - { - RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ; - RGBColor black = { 0,0,0} ; - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - } - bmappixels = GetGWorldPixMap( bmapworld ) ; - wxCHECK_RET(LockPixels(bmappixels), - wxT("DoDrawBitmap: Unable to lock pixels")); - Rect source = { 0, 0, h, w }; - Rect dest = { yy, xx, yy + hh, xx + ww }; - if ( useMask && bmp.GetMask() ) - { - if( LockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap())))) - { - CopyDeepMask - ( - GetPortBitMapForCopyBits(bmapworld), - GetPortBitMapForCopyBits(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap())), - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ), - &source, &source, &dest, mode, NULL - ); - UnlockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap()))); - } - } - else { - CopyBits( GetPortBitMapForCopyBits( bmapworld ), - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ), - &source, &dest, mode, NULL ) ; - } - UnlockPixels( bmappixels ) ; - } - else if ( bmp.GetBitmapType() == kMacBitmapTypeIcon ) - { - Rect bitmaprect = { 0 , 0 , bmp.GetHeight(), bmp.GetWidth() } ; - OffsetRect( &bitmaprect, xx, yy ) ; - PlotCIconHandle( &bitmaprect , atNone , ttNone , MAC_WXHICON(bmp.GetHICON()) ) ; - } - m_macPenInstalled = false ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; -} - -void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) -{ - wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon")); - wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon")); - DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ; -} - -void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC")); - wxCoord xx, yy, ww, hh; - xx = XLOG2DEVMAC(x); - yy = YLOG2DEVMAC(y); - ww = XLOG2DEVREL(width); - hh = YLOG2DEVREL(height); - SetRectRgn( (RgnHandle) m_macCurrentClipRgn , xx , yy , xx + ww , yy + hh ) ; - SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - if( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1 , xx ); - m_clipY1 = wxMax( m_clipY1 , yy ); - m_clipX2 = wxMin( m_clipX2, (xx + ww)); - m_clipY2 = wxMin( m_clipY2, (yy + hh)); - } - else - { - m_clipping = TRUE; - m_clipX1 = xx; - m_clipY1 = yy; - m_clipX2 = xx + ww; - m_clipY2 = yy + hh; - } -} - -void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ) ; - if (region.Empty()) - { - DestroyClippingRegion(); - return; - } - wxMacFastPortSetter helper(this) ; - wxCoord x, y, w, h; - region.GetBox( x, y, w, h ); - wxCoord xx, yy, ww, hh; - xx = XLOG2DEVMAC(x); - yy = YLOG2DEVMAC(y); - ww = XLOG2DEVREL(w); - hh = YLOG2DEVREL(h); - // if we have a scaling that we cannot map onto native regions - // we must use the box - if ( ww != w || hh != h ) - { - wxDC::DoSetClippingRegion( x, y, w, h ); - } - else - { - CopyRgn( (RgnHandle) region.GetWXHRGN() , (RgnHandle) m_macCurrentClipRgn ) ; - if ( xx != x || yy != y ) - { - OffsetRgn( (RgnHandle) m_macCurrentClipRgn , xx - x , yy - y ) ; - } - SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - if( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1 , xx ); - m_clipY1 = wxMax( m_clipY1 , yy ); - m_clipX2 = wxMin( m_clipX2, (xx + ww)); - m_clipY2 = wxMin( m_clipY2, (yy + hh)); - } - else - { - m_clipping = TRUE; - m_clipX1 = xx; - m_clipY1 = yy; - m_clipX2 = xx + ww; - m_clipY2 = yy + hh; - } - } -} - -void wxDC::DestroyClippingRegion() -{ - wxMacFastPortSetter helper(this) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_clipping = FALSE; -} - -void wxDC::DoGetSizeMM( int* width, int* height ) const -{ - int w = 0; - int h = 0; - GetSize( &w, &h ); - *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) ); - *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) ); -} - -void wxDC::SetTextForeground( const wxColour &col ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - m_textForegroundColour = col; - m_macFontInstalled = false ; -} - -void wxDC::SetTextBackground( const wxColour &col ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - m_textBackgroundColour = col; - m_macFontInstalled = false ; -} - -void wxDC::SetMapMode( int mode ) -{ - switch (mode) - { - case wxMM_TWIPS: - SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y ); - break; - case wxMM_POINTS: - SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y ); - break; - case wxMM_METRIC: - SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y ); - break; - case wxMM_LOMETRIC: - SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 ); - break; - default: - case wxMM_TEXT: - SetLogicalScale( 1.0, 1.0 ); - break; - } - if (mode != wxMM_TEXT) - { - m_needComputeScaleX = TRUE; - m_needComputeScaleY = TRUE; - } -} - -void wxDC::SetUserScale( double x, double y ) -{ - // allow negative ? -> no - m_userScaleX = x; - m_userScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxDC::SetLogicalScale( double x, double y ) -{ - // allow negative ? - m_logicalScaleX = x; - m_logicalScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y ) -{ - m_logicalOriginX = x * m_signX; // is this still correct ? - m_logicalOriginY = y * m_signY; - ComputeScaleAndOrigin(); -} - -void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y ) -{ - m_externalDeviceOriginX = x; - m_externalDeviceOriginY = y; - ComputeScaleAndOrigin(); -} - -#if 0 -void wxDC::SetInternalDeviceOrigin( long x, long y ) -{ - m_internalDeviceOriginX = x; - m_internalDeviceOriginY = y; - ComputeScaleAndOrigin(); -} -void wxDC::GetInternalDeviceOrigin( long *x, long *y ) -{ - if (x) *x = m_internalDeviceOriginX; - if (y) *y = m_internalDeviceOriginY; -} -#endif - -void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) -{ - m_signX = (xLeftRight ? 1 : -1); - m_signY = (yBottomUp ? -1 : 1); - ComputeScaleAndOrigin(); -} - -wxSize wxDC::GetPPI() const -{ - return wxSize(72, 72); -} - -int wxDC::GetDepth() const -{ - if ( IsPortColor( (CGrafPtr) m_macPort ) ) - { - return ( (**GetPortPixMap( (CGrafPtr) m_macPort)).pixelSize ) ; - } - return 1 ; -} - -void wxDC::ComputeScaleAndOrigin() -{ - // CMB: copy scale to see if it changes - double origScaleX = m_scaleX; - double origScaleY = m_scaleY; - m_scaleX = m_logicalScaleX * m_userScaleX; - m_scaleY = m_logicalScaleY * m_userScaleY; - m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX; - m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY; - // CMB: if scale has changed call SetPen to recalulate the line width - if (m_scaleX != origScaleX || m_scaleY != origScaleY) - { - // this is a bit artificial, but we need to force wxDC to think - // the pen has changed - wxPen* pen = & GetPen(); - wxPen tempPen; - m_pen = tempPen; - SetPen(* pen); - } -} - -void wxDC::SetPalette( const wxPalette& palette ) -{ -} - -void wxDC::SetBackgroundMode( int mode ) -{ - m_backgroundMode = mode ; -} - -void wxDC::SetFont( const wxFont &font ) -{ - m_font = font; - m_macFontInstalled = false ; -} - -void wxDC::SetPen( const wxPen &pen ) -{ - if ( m_pen == pen ) - return ; - m_pen = pen; - m_macPenInstalled = false ; -} - -void wxDC::SetBrush( const wxBrush &brush ) -{ - if (m_brush == brush) - return; - m_brush = brush; - m_macBrushInstalled = false ; -} - -void wxDC::SetBackground( const wxBrush &brush ) -{ - if (m_backgroundBrush == brush) - return; - m_backgroundBrush = brush; - if (!m_backgroundBrush.Ok()) - return; - m_macBrushInstalled = false ; -} - -void wxDC::SetLogicalFunction( int function ) -{ - if (m_logicalFunction == function) - return; - m_logicalFunction = function ; - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; -} - -extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); - -bool wxDC::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) -{ - return wxDoFloodFill(this, x, y, col, style); -} - -bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const -{ - wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") ); - wxMacFastPortSetter helper(this) ; - RGBColor colour; - GetCPixel( XLOG2DEVMAC(x), YLOG2DEVMAC(y), &colour ); - // Convert from Mac colour to wx - col->Set( colour.red >> 8, - colour.green >> 8, - colour.blue >> 8); - return true ; -} - -void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 : - m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2; - wxCoord xx1 = XLOG2DEVMAC(x1) - offset; - wxCoord yy1 = YLOG2DEVMAC(y1) - offset; - wxCoord xx2 = XLOG2DEVMAC(x2) - offset; - wxCoord yy2 = YLOG2DEVMAC(y2) - offset; - if ((m_pen.GetCap() == wxCAP_ROUND) && - (m_pen.GetWidth() <= 1)) - { - // Implement LAST_NOT for MAC at least for - // orthogonal lines. RR. - if (xx1 == xx2) - { - if (yy1 < yy2) - yy2--; - if (yy1 > yy2) - yy2++; - } - if (yy1 == yy2) - { - if (xx1 < xx2) - xx2--; - if (xx1 > xx2) - xx2++; - } - } - ::MoveTo(xx1, yy1); - ::LineTo(xx2, yy2); - } -} - -void wxDC::DoCrossHair( wxCoord x, wxCoord y ) -{ - wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") ); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - int w = 0; - int h = 0; - GetSize( &w, &h ); - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - MacInstallPen(); - ::MoveTo( XLOG2DEVMAC(0), yy ); - ::LineTo( XLOG2DEVMAC(w), yy ); - ::MoveTo( xx, YLOG2DEVMAC(0) ); - ::LineTo( xx, YLOG2DEVMAC(h) ); - CalcBoundingBox(x, y); - CalcBoundingBox(x+w, y+h); - } -} - -/* -* To draw arcs properly the angles need to be converted from the WX style: -* Angles start on the +ve X axis and go anti-clockwise (As you would draw on -* a normal axis on paper). -* TO -* the Mac style: -* Angles start on the +ve y axis and go clockwise. -*/ - -static double wxConvertWXangleToMACangle(double angle) -{ - double newAngle = 90 - angle ; - if ( newAngle < 0 ) - newAngle += 360 ; - return newAngle ; -} - -void wxDC::DoDrawArc( wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawArc Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx1 = XLOG2DEVMAC(x1); - wxCoord yy1 = YLOG2DEVMAC(y1); - wxCoord xx2 = XLOG2DEVMAC(x2); - wxCoord yy2 = YLOG2DEVMAC(y2); - wxCoord xxc = XLOG2DEVMAC(xc); - wxCoord yyc = YLOG2DEVMAC(yc); - double dx = xx1 - xxc; - double dy = yy1 - yyc; - double radius = sqrt((double)(dx*dx+dy*dy)); - wxCoord rad = (wxCoord)radius; - double radius1, radius2; - if (xx1 == xx2 && yy1 == yy2) - { - radius1 = 0.0; - radius2 = 360.0; - } - else if (radius == 0.0) - { - radius1 = radius2 = 0.0; - } - else - { - radius1 = (xx1 - xxc == 0) ? - (yy1 - yyc < 0) ? 90.0 : -90.0 : - -atan2(double(yy1-yyc), double(xx1-xxc)) * RAD2DEG; - radius2 = (xx2 - xxc == 0) ? - (yy2 - yyc < 0) ? 90.0 : -90.0 : - -atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG; - } - wxCoord alpha2 = wxCoord(radius2 - radius1); - wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1)); - if( (xx1 > xx2) || (yy1 > yy2) ) { - alpha2 *= -1; - } - Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad }; - if(m_brush.GetStyle() != wxTRANSPARENT) { - MacInstallBrush(); - PaintArc(&r, alpha1, alpha2); - } - if(m_pen.GetStyle() != wxTRANSPARENT) { - MacInstallPen(); - FrameArc(&r, alpha1, alpha2); - } -} - -void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawEllepticArc Invalid DC")); - wxMacFastPortSetter helper(this) ; - Rect r; - double angle = sa - ea; // Order important Mac in opposite direction to wx - // we have to make sure that the filling is always counter-clockwise - if ( angle > 0 ) - angle -= 360 ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(w); - wxCoord hh = m_signY * YLOG2DEVREL(h); - // handle -ve width and/or height - if (ww < 0) { ww = -ww; xx = xx - ww; } - if (hh < 0) { hh = -hh; yy = yy - hh; } - sa = wxConvertWXangleToMACangle(sa); - r.top = yy; - r.left = xx; - r.bottom = yy + hh; - r.right = xx + ww; - if(m_brush.GetStyle() != wxTRANSPARENT) { - MacInstallBrush(); - PaintArc(&r, (short)sa, (short)angle); - } - if(m_pen.GetStyle() != wxTRANSPARENT) { - MacInstallPen(); - FrameArc(&r, (short)sa, (short)angle); - } -} - -void wxDC::DoDrawPoint( wxCoord x, wxCoord y ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - wxCoord xx1 = XLOG2DEVMAC(x); - wxCoord yy1 = YLOG2DEVMAC(y); - RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel()); - ::SetCPixel( xx1,yy1,&pencolor) ; - CalcBoundingBox(x, y); - } -} - -void wxDC::DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() == wxTRANSPARENT) - return; - MacInstallPen() ; - wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 : - m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2 ; - wxCoord x1, x2 , y1 , y2 ; - x1 = XLOG2DEVMAC(points[0].x + xoffset); - y1 = YLOG2DEVMAC(points[0].y + yoffset); - ::MoveTo(x1 - offset, y1 - offset ); - for (int i = 0; i < n-1; i++) - { - x2 = XLOG2DEVMAC(points[i+1].x + xoffset); - y2 = YLOG2DEVMAC(points[i+1].y + yoffset); - ::LineTo( x2 - offset, y2 - offset ); - } -} - -void wxDC::DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord x1, x2 , y1 , y2 ; - if ( m_brush.GetStyle() == wxTRANSPARENT && m_pen.GetStyle() == wxTRANSPARENT ) - return ; - PolyHandle polygon = OpenPoly(); - x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset); - y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset); - ::MoveTo(x1,y1); - for (int i = 1; i < n; i++) - { - x2 = XLOG2DEVMAC(points[i].x + xoffset); - y2 = YLOG2DEVMAC(points[i].y + yoffset); - ::LineTo(x2, y2); - } - // close the polyline if necessary - if ( x1 != x2 || y1 != y2 ) - { - ::LineTo(x1,y1 ) ; - } - ClosePoly(); - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush(); - ::PaintPoly( polygon ); - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FramePoly( polygon ) ; - } - KillPoly( polygon ); -} - -void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintRect( &rect ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameRect( &rect ) ; - } -} - -void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double radius) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (radius < 0.0) - radius = - radius * ((width < height) ? width : height); - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ; - } -} - -void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintOval( &rect ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameOval( &rect ) ; - } -} - -bool wxDC::CanDrawBitmap(void) const -{ - return true ; -} - -bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask, - wxCoord xsrcMask, wxCoord ysrcMask ) -{ - wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit Illegal dc")); - wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC")); - if ( logical_func == wxNO_OP ) - return TRUE ; - if (xsrcMask == -1 && ysrcMask == -1) - { - xsrcMask = xsrc; ysrcMask = ysrc; - } - // correct the parameter in case this dc does not have a mask at all - if ( useMask && !source->m_macMask ) - useMask = false ; - Rect srcrect , dstrect ; - srcrect.top = source->YLOG2DEVMAC(ysrc) ; - srcrect.left = source->XLOG2DEVMAC(xsrc) ; - srcrect.right = source->XLOG2DEVMAC(xsrc + width ) ; - srcrect.bottom = source->YLOG2DEVMAC(ysrc + height) ; - dstrect.top = YLOG2DEVMAC(ydest) ; - dstrect.left = XLOG2DEVMAC(xdest) ; - dstrect.bottom = YLOG2DEVMAC(ydest + height ) ; - dstrect.right = XLOG2DEVMAC(xdest + width ) ; - short mode = kUnsupportedMode ; - bool invertDestinationFirst = false ; - switch ( logical_func ) - { - case wxAND: // src AND dst - mode = adMin ; // ok - break ; - case wxAND_INVERT: // (NOT src) AND dst - mode = notSrcOr ; // ok - break ; - case wxAND_REVERSE:// src AND (NOT dst) - invertDestinationFirst = true ; - mode = srcOr ; - break ; - case wxCLEAR: // 0 - mode = kEmulatedMode ; - break ; - case wxCOPY: // src - mode = srcCopy ; // ok - break ; - case wxEQUIV: // (NOT src) XOR dst - mode = srcXor ; // ok - break ; - case wxINVERT: // NOT dst - mode = kEmulatedMode ; //or hilite ; - break ; - case wxNAND: // (NOT src) OR (NOT dst) - invertDestinationFirst = true ; - mode = srcBic ; - break ; - case wxNOR: // (NOT src) AND (NOT dst) - invertDestinationFirst = true ; - mode = notSrcOr ; - break ; - case wxNO_OP: // dst - mode = kEmulatedMode ; // this has already been handled upon entry - break ; - case wxOR: // src OR dst - mode = notSrcBic ; - break ; - case wxOR_INVERT: // (NOT src) OR dst - mode = srcBic ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - invertDestinationFirst = true ; - mode = notSrcBic ; - break ; - case wxSET: // 1 - mode = kEmulatedMode ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notSrcCopy ; // ok - break ; - case wxXOR: // src XOR dst - mode = notSrcXor ; // ok - break ; - default : - break ; - } - if ( mode == kUnsupportedMode ) - { - wxFAIL_MSG(wxT("unsupported blitting mode" )); - return FALSE ; - } - CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ; - PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ; - if ( LockPixels(bmappixels) ) - { - wxMacFastPortSetter helper(this) ; - if ( source->GetDepth() == 1 ) - { - RGBForeColor( &MAC_WXCOLORREF(m_textForegroundColour.GetPixel()) ) ; - RGBBackColor( &MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()) ) ; - } - else - { - // the modes need this, otherwise we'll end up having really nice colors... - RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ; - RGBColor black = { 0,0,0} ; - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - } - if ( useMask && source->m_macMask ) - { - if ( mode == srcCopy ) - { - if ( LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ) - { - CopyMask( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(source->m_macMask) ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &srcrect , &dstrect ) ; - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - } - } - else - { - RgnHandle clipRgn = NewRgn() ; - LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - OffsetRgn( clipRgn , -srcrect.left + dstrect.left, -srcrect.top + dstrect.top ) ; - if ( mode == kEmulatedMode ) - { - Pattern pat ; - ::PenPat(GetQDGlobalsBlack(&pat)); - if ( logical_func == wxSET ) - { - RGBColor col= { 0xFFFF, 0xFFFF, 0xFFFF } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxCLEAR ) - { - RGBColor col= { 0x0000, 0x0000, 0x0000 } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxINVERT ) - { - MacInvertRgn( clipRgn ) ; - } - else - { - for ( int y = 0 ; y < srcrect.right - srcrect.left ; ++y ) - { - for ( int x = 0 ; x < srcrect.bottom - srcrect.top ; ++x ) - { - Point dstPoint = { dstrect.top + y , dstrect.left + x } ; - Point srcPoint = { srcrect.top + y , srcrect.left + x } ; - if ( PtInRgn( dstPoint , clipRgn ) ) - { - RGBColor srcColor ; - RGBColor dstColor ; - SetPort( (GrafPtr) sourcePort ) ; - GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ; - SetPort( (GrafPtr) m_macPort ) ; - GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - wxMacCalculateColour( logical_func , srcColor , dstColor ) ; - SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - } - } - } - } - } - else - { - if ( invertDestinationFirst ) - { - MacInvertRgn( clipRgn ) ; - } - CopyBits( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &dstrect, mode, clipRgn ) ; - } - DisposeRgn( clipRgn ) ; - } - } - else - { - RgnHandle clipRgn = NewRgn() ; - SetRectRgn( clipRgn , dstrect.left , dstrect.top , dstrect.right , dstrect.bottom ) ; - if ( mode == kEmulatedMode ) - { - Pattern pat ; - ::PenPat(GetQDGlobalsBlack(&pat)); - if ( logical_func == wxSET ) - { - RGBColor col= { 0xFFFF, 0xFFFF, 0xFFFF } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxCLEAR ) - { - RGBColor col= { 0x0000, 0x0000, 0x0000 } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxINVERT ) - { - MacInvertRgn( clipRgn ) ; - } - else - { - for ( int y = 0 ; y < srcrect.right - srcrect.left ; ++y ) - { - for ( int x = 0 ; x < srcrect.bottom - srcrect.top ; ++x ) - { - Point dstPoint = { dstrect.top + y , dstrect.left + x } ; - Point srcPoint = { srcrect.top + y , srcrect.left + x } ; - { - RGBColor srcColor ; - RGBColor dstColor ; - SetPort( (GrafPtr) sourcePort ) ; - GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ; - SetPort( (GrafPtr) m_macPort ) ; - GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - wxMacCalculateColour( logical_func , srcColor , dstColor ) ; - SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - } - } - } - } - } - else - { - if ( invertDestinationFirst ) - { - MacInvertRgn( clipRgn ) ; - } - CopyBits( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &dstrect, mode, NULL ) ; - } - DisposeRgn( clipRgn ) ; - } - UnlockPixels( bmappixels ) ; - } - m_macPenInstalled = false ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; - return TRUE; -} - -#ifndef FixedToInt -// as macro in FixMath.h for 10.3 -inline Fixed IntToFixed( int inInt ) -{ - return (((SInt32) inInt) << 16); -} - -inline int FixedToInt( Fixed inFixed ) -{ - return (((SInt32) inFixed) >> 16); -} -#endif - -void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, - double angle) -{ - wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") ); - - if (angle == 0.0 ) - { - DrawText(str, x, y); - return; - } - - if ( str.Length() == 0 ) - return ; - - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; - - if ( 0 ) - { - m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * m_font.GetMacFontSize())); - m_macAliasWasEnabled = true ; - } - OSStatus status = noErr ; - ATSUTextLayout atsuLayout ; - UniCharCount chars = str.Length() ; -#if wxUSE_UNICODE - status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) (const wxChar*) str , 0 , str.Length() , str.Length() , 1 , - &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; -#else - wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ; - int wlen = wxWcslen( wchar.data() ) ; - status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) wchar.data() , 0 , wlen , wlen , 1 , - &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; -#endif - wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") ); - int iAngle = int( angle ); - int drawX = XLOG2DEVMAC(x) ; - int drawY = YLOG2DEVMAC(y) ; - - ATSUTextMeasurement textBefore ; - ATSUTextMeasurement textAfter ; - ATSUTextMeasurement ascent ; - ATSUTextMeasurement descent ; - - - if ( abs(iAngle) > 0 ) - { - Fixed atsuAngle = IntToFixed( iAngle ) ; - ATSUAttributeTag atsuTags[] = - { - kATSULineRotationTag , - } ; - ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - sizeof( Fixed ) , - } ; - ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - &atsuAngle , - } ; - status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags)/sizeof(ATSUAttributeTag), - atsuTags, atsuSizes, atsuValues ) ; - } - status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - &textBefore , &textAfter, &ascent , &descent ); - - drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent)); - drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent)); - status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - IntToFixed(drawX) , IntToFixed(drawY) ); - wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") ); - Rect rect ; - status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - IntToFixed(drawX) , IntToFixed(drawY) , &rect ); - wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") ); - OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ; - CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) ); - CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) ); - ::ATSUDisposeTextLayout(atsuLayout); -} - -void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC")); - - wxMacFastPortSetter helper(this) ; - long xx = XLOG2DEVMAC(x); - long yy = YLOG2DEVMAC(y); -#if TARGET_CARBON - bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() ) - useDrawThemeText = false ; -#endif - MacInstallFont() ; - if ( 0 ) - { - m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, 8); - m_macAliasWasEnabled = true ; - } - FontInfo fi ; - ::GetFontInfo( &fi ) ; -#if TARGET_CARBON - if ( !useDrawThemeText ) -#endif - yy += fi.ascent ; - ::MoveTo( xx , yy ); - if ( m_backgroundMode == wxTRANSPARENT ) - { - ::TextMode( srcOr) ; - } - else - { - ::TextMode( srcCopy ) ; - } - int length = strtext.Length() ; - - int laststop = 0 ; - int i = 0 ; - int line = 0 ; - { -#if 0 // we don't have to do all that here - while( i < length ) - { - if( strtext[i] == 13 || strtext[i] == 10) - { - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#if TARGET_CARBON - if ( useDrawThemeText ) - { - Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - line++ ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - ::DrawText( text , 0 , strlen(text) ) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - line++ ; - ::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) ); - } - laststop = i+1 ; - } - i++ ; - } - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#endif // 0 - wxString linetext = strtext ; -#if TARGET_CARBON - if ( useDrawThemeText ) - { - Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ; - - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Rect frame = { yy - fi.ascent + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy - fi.ascent + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - short width = ::TextWidth( text , 0 , strlen(text) ) ; - frame.right = frame.left + width ; - - ::EraseRect( &frame ) ; - } - ::DrawText( text , 0 , strlen(text) ) ; - } - } - ::TextMode( srcOr ) ; -} - -bool wxDC::CanGetTextExtent() const -{ - wxCHECK_MSG(Ok(), false, wxT("Invalid DC")); - return true ; -} - -void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height, - wxCoord *descent, wxCoord *externalLeading , - wxFont *theFont ) const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxFont formerFont = m_font ; - if ( theFont ) - { - // work around the constness - *((wxFont*)(&m_font)) = *theFont ; - } - MacInstallFont() ; - FontInfo fi ; - ::GetFontInfo( &fi ) ; -#if TARGET_CARBON - bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() ) - useGetThemeText = false ; -#endif - if ( height ) - *height = YDEV2LOGREL( fi.descent + fi.ascent ) ; - if ( descent ) - *descent =YDEV2LOGREL( fi.descent ); - if ( externalLeading ) - *externalLeading = YDEV2LOGREL( fi.leading ) ; - int length = strtext.Length() ; - - int laststop = 0 ; - int i = 0 ; - int curwidth = 0 ; - if ( width ) - { - *width = 0 ; -#if 0 // apparently we don't have to do all that - while( i < length ) - { - if( strtext[i] == 13 || strtext[i] == 10) - { - wxString linetext = strtext.Mid( laststop , i - laststop ) ; - if ( height ) - *height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - curwidth = bounds.h ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - curwidth = ::TextWidth( text , 0 , strlen(text) ) ; - } - if ( curwidth > *width ) - *width = XDEV2LOGREL( curwidth ) ; - laststop = i+1 ; - } - i++ ; - } - - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#endif // 0 - wxString linetext = strtext ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - curwidth = bounds.h ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - curwidth = ::TextWidth( text , 0 , strlen(text) ) ; - } - if ( curwidth > *width ) - *width = XDEV2LOGREL( curwidth ) ; - } - if ( theFont ) - { - // work around the constness - *((wxFont*)(&m_font)) = formerFont ; - m_macFontInstalled = false ; - } -} - - -bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const -{ - wxCHECK_MSG(Ok(), false, wxT("Invalid DC")); - - widths.Empty(); - widths.Add(0, text.Length()); - - if (text.Length() == 0) - return false; - - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; -#if TARGET_CARBON - bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() ) - useGetThemeText = false ; - - if ( useGetThemeText ) - { - // If anybody knows how to do this more efficiently yet still handle - // the fractional glyph widths that may be present when using AA - // fonts, please change it. Currently it is measuring from the - // begining of the string for each succeding substring, which is much - // slower than this should be. - for (size_t i=0; iGetNoAntiAliasing() ) - useGetThemeText = false ; -#endif - char text[] = "g" ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text , 1 , CFStringGetSystemEncoding(), false ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - CFRelease( mString ) ; - width = bounds.h ; - } - else -#endif - { - width = ::TextWidth( text , 0 , 1 ) ; - } - return YDEV2LOGREL(width) ; -} - -wxCoord wxDC::GetCharHeight(void) const -{ - wxCHECK_MSG(Ok(), 1, wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; - FontInfo fi ; - ::GetFontInfo( &fi ) ; - return YDEV2LOGREL( fi.descent + fi.ascent ); -} - -void wxDC::Clear(void) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - Rect rect = { -31000 , -31000 , 31000 , 31000 } ; - if (m_backgroundBrush.GetStyle() != wxTRANSPARENT) - { - ::PenNormal() ; - //MacInstallBrush() ; - MacSetupBackgroundForCurrentPort( m_backgroundBrush ) ; - ::EraseRect( &rect ) ; - } -} - -void wxDC::MacInstallFont() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - // if ( m_macFontInstalled ) - // return ; - Pattern blackColor ; - MacSetupBackgroundForCurrentPort(m_backgroundBrush) ; - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( (short)(m_scaleY * m_font.GetMacFontSize()) ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - m_macFontInstalled = true ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - RGBColor forecolor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - } - else - { - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - ::TextFont( fontId ) ; - ::TextSize( short(m_scaleY * fontSize) ) ; - ::TextFace( fontStyle ) ; - // todo reset after spacing changes - or store the current spacing somewhere - m_macFontInstalled = true ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - RGBColor forecolor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - } - short mode = patCopy ; - // todo : - switch( m_logicalFunction ) - { - case wxCOPY: // src - mode = patCopy ; - break ; - case wxINVERT: // NOT dst - ::PenPat(GetQDGlobalsBlack(&blackColor)); - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - OSStatus status = noErr ; - Fixed atsuSize = IntToFixed( int(m_scaleY * m_font.GetMacFontSize()) ) ; - Style qdStyle = m_font.GetMacFontStyle() ; - ATSUFontID atsuFont = m_font.GetMacATSUFontID() ; - status = ::ATSUCreateStyle((ATSUStyle *)&m_macATSUIStyle) ; - wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") ) ; - ATSUAttributeTag atsuTags[] = - { - kATSUFontTag , - kATSUSizeTag , - // kATSUColorTag , - // kATSUBaselineClassTag , - kATSUVerticalCharacterTag, - kATSUQDBoldfaceTag , - kATSUQDItalicTag , - kATSUQDUnderlineTag , - kATSUQDCondensedTag , - kATSUQDExtendedTag , - } ; - ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - sizeof( ATSUFontID ) , - sizeof( Fixed ) , - // sizeof( RGBColor ) , - // sizeof( BslnBaselineClass ) , - sizeof( ATSUVerticalCharacterType), - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - } ; - Boolean kTrue = true ; - Boolean kFalse = false ; - //BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; - ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; - ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - &atsuFont , - &atsuSize , - // &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) , - // &kBaselineDefault , - &kHorizontal, - (qdStyle & bold) ? &kTrue : &kFalse , - (qdStyle & italic) ? &kTrue : &kFalse , - (qdStyle & underline) ? &kTrue : &kFalse , - (qdStyle & condense) ? &kTrue : &kFalse , - (qdStyle & extend) ? &kTrue : &kFalse , - } ; - status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) , - atsuTags, atsuSizes, atsuValues); - wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ; -} - -Pattern gPatterns[] = -{ // hatch patterns - { { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } } , - { { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } } , - { { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } } , - { { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } } , - { { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } } , - { { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } } , - { { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } , - // dash patterns - { { 0xCC , 0x99 , 0x33 , 0x66 , 0xCC , 0x99 , 0x33 , 0x66 } } , // DOT - { { 0xFE , 0xFD , 0xFB , 0xF7 , 0xEF , 0xDF , 0xBF , 0x7F } } , // LONG_DASH - { { 0xEE , 0xDD , 0xBB , 0x77 , 0xEE , 0xDD , 0xBB , 0x77 } } , // SHORT_DASH - { { 0xDE , 0xBD , 0x7B , 0xF6 , 0xED , 0xDB , 0xB7 , 0x6F } } , // DOT_DASH -} ; - -static void wxMacGetPattern(int penStyle, Pattern *pattern) -{ - int index = 0; // solid pattern by default - switch(penStyle) - { - // hatches - case wxBDIAGONAL_HATCH: index = 1; break; - case wxFDIAGONAL_HATCH: index = 2; break; - case wxCROSS_HATCH: index = 3; break; - case wxHORIZONTAL_HATCH: index = 4; break; - case wxVERTICAL_HATCH: index = 5; break; - case wxCROSSDIAG_HATCH: index = 6; break; - // dashes - case wxDOT: index = 7; break; - case wxLONG_DASH: index = 8; break; - case wxSHORT_DASH: index = 9; break; - case wxDOT_DASH: index = 10; break; - } - *pattern = gPatterns[index]; -} - -void wxDC::MacInstallPen() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - //Pattern blackColor; - // if ( m_macPenInstalled ) - // return ; - RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - ::PenNormal() ; - int penWidth = (int) (m_pen.GetWidth() * m_scaleX) ; ; - // null means only one pixel, at whatever resolution - if ( penWidth == 0 ) - penWidth = 1 ; - ::PenSize(penWidth, penWidth); - - int penStyle = m_pen.GetStyle(); - Pattern pat; - if (penStyle == wxUSER_DASH) - { - // FIXME: there should be exactly 8 items in the dash - wxDash* dash ; - int number = m_pen.GetDashes(&dash) ; - int index = 0; - for ( int i = 0 ; i < 8 ; ++i ) - { - pat.pat[i] = dash[index] ; - if (index < number - 1) - index++; - } - } - else - { - wxMacGetPattern(penStyle, &pat); - } - ::PenPat(&pat); - - short mode = patCopy ; - // todo : - switch( m_logicalFunction ) - { - case wxCOPY: // only foreground color, leave background (thus not patCopy) - mode = patOr ; - break ; - case wxINVERT: // NOT dst - // ::PenPat(GetQDGlobalsBlack(&blackColor)); - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - m_macPenInstalled = true ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; -} - -void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background ) -{ - Pattern whiteColor ; - switch( background.MacGetBrushKind() ) - { - case kwxMacBrushTheme : - { - ::SetThemeBackground( background.GetMacTheme() , wxDisplayDepth() , true ) ; - break ; - } - case kwxMacBrushThemeBackground : - { - Rect extent ; - ThemeBackgroundKind bg = background.GetMacThemeBackground( &extent ) ; - ::ApplyThemeBackground( bg , &extent ,kThemeStateActive , wxDisplayDepth() , true ) ; - break ; - } - case kwxMacBrushColour : - { - ::RGBBackColor( &MAC_WXCOLORREF( background.GetColour().GetPixel()) ); - int brushStyle = background.GetStyle(); - if (brushStyle == wxSOLID) - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - else if (IS_HATCH(brushStyle)) - { - Pattern pat ; - wxMacGetPattern(brushStyle, &pat); - ::BackPat(&pat); - } - else - { - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - } - break ; - } - } -} - -void wxDC::MacInstallBrush() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - Pattern blackColor ; - // if ( m_macBrushInstalled ) - // return ; - // foreground - bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ; - ::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) ); - ::RGBBackColor( &MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) ); - int brushStyle = m_brush.GetStyle(); - if (brushStyle == wxSOLID) - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - else if (IS_HATCH(brushStyle)) - { - Pattern pat ; - wxMacGetPattern(brushStyle, &pat); - ::PenPat(&pat); - } - else if ( m_brush.GetStyle() == wxSTIPPLE || m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE ) - { - // we force this in order to be compliant with wxMSW - backgroundTransparent = false ; - // for these the text fore (and back for MASK_OPAQUE) colors are used - wxBitmap* bitmap = m_brush.GetStipple() ; - int width = bitmap->GetWidth() ; - int height = bitmap->GetHeight() ; - GWorldPtr gw = NULL ; - if ( m_brush.GetStyle() == wxSTIPPLE ) - gw = MAC_WXHBITMAP(bitmap->GetHBITMAP()) ; - else - gw = MAC_WXHBITMAP(bitmap->GetMask()->GetMaskBitmap()) ; - PixMapHandle gwpixmaphandle = GetGWorldPixMap( gw ) ; - LockPixels( gwpixmaphandle ) ; - bool isMonochrome = !IsPortColor( gw ) ; - if ( !isMonochrome ) - { - if ( (**gwpixmaphandle).pixelSize == 1 ) - isMonochrome = true ; - } - if ( isMonochrome && width == 8 && height == 8 ) - { - ::RGBForeColor( &MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ); - ::RGBForeColor( &MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ); - BitMap* gwbitmap = (BitMap*) *gwpixmaphandle ; // since the color depth is 1 it is a BitMap - UInt8 *gwbits = (UInt8*) gwbitmap->baseAddr ; - int alignment = gwbitmap->rowBytes & 0x7FFF ; - Pattern pat ; - for ( int i = 0 ; i < 8 ; ++i ) - { - pat.pat[i] = gwbits[i*alignment+0] ; - } - UnlockPixels( GetGWorldPixMap( gw ) ) ; - ::PenPat( &pat ) ; - } - else - { - // this will be the code to handle power of 2 patterns, we will have to arrive at a nice - // caching scheme before putting this into production - Handle image; - long imageSize; - PixPatHandle pixpat = NewPixPat() ; - CopyPixMap(gwpixmaphandle, (**pixpat).patMap); - imageSize = GetPixRowBytes((**pixpat).patMap) * - ((**(**pixpat).patMap).bounds.bottom - - (**(**pixpat).patMap).bounds.top); - PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize ); - (**pixpat).patData = image; - if ( isMonochrome ) - { - CTabHandle ctable = ((**((**pixpat).patMap)).pmTable) ; - ColorSpecPtr ctspec = (ColorSpecPtr) &(**ctable).ctTable ; - if ( ctspec[0].rgb.red == 0x0000 ) - { - ctspec[1].rgb = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ; - ctspec[0].rgb = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ; - } - else - { - ctspec[0].rgb = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ; - ctspec[1].rgb = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ; - } - ::CTabChanged( ctable ) ; - } - ::PenPixPat(pixpat); - m_macForegroundPixMap = pixpat ; - } - UnlockPixels( gwpixmaphandle ) ; - } - else - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - short mode = patCopy ; - switch( m_logicalFunction ) - { - case wxCOPY: // src - if ( backgroundTransparent ) - mode = patOr ; - else - mode = patCopy ; - break ; - case wxINVERT: // NOT dst - if ( !backgroundTransparent ) - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - m_macBrushInstalled = true ; - m_macPenInstalled = false ; - m_macFontInstalled = false ; -} - -// --------------------------------------------------------------------------- -// coordinates transformations -// --------------------------------------------------------------------------- - -wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const -{ - return ((wxDC *)this)->XDEV2LOG(x); -} - -wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const -{ - return ((wxDC *)this)->YDEV2LOG(y); -} - -wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const -{ - return ((wxDC *)this)->XDEV2LOGREL(x); -} - -wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const -{ - return ((wxDC *)this)->YDEV2LOGREL(y); -} - -wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const -{ - return ((wxDC *)this)->XLOG2DEV(x); -} - -wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const -{ - return ((wxDC *)this)->YLOG2DEV(y); -} - -wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const -{ - return ((wxDC *)this)->XLOG2DEVREL(x); -} - -wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const -{ - return ((wxDC *)this)->YLOG2DEVREL(y); -} diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp deleted file mode 100644 index f28c6dc576..0000000000 --- a/src/mac/carbon/dcclient.cpp +++ /dev/null @@ -1,175 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.cpp -// Purpose: wxClientDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcclient.h" -#endif - -#include "wx/dcclient.h" -#include "wx/dcmemory.h" -#include "wx/region.h" -#include "wx/window.h" -#include "wx/toplevel.h" -#include -#include "wx/mac/private.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define RAD2DEG 57.2957795131 - -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) -#endif - -/* - * wxWindowDC - */ - -#include "wx/mac/uma.h" - -wxWindowDC::wxWindowDC() -{ - m_window = NULL ; -} - -wxWindowDC::wxWindowDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - - int x , y ; - x = y = 0 ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - CopyRgn( (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); -} - -wxWindowDC::~wxWindowDC() -{ -} - -void wxWindowDC::DoGetSize( int* width, int* height ) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetSize(width, height); -} - -/* - * wxClientDC - */ - -wxClientDC::wxClientDC() -{ - m_window = NULL ; -} - -wxClientDC::wxClientDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - if (!rootwindow) - return; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - wxPoint origin = window->GetClientAreaOrigin() ; - wxSize size = window->GetClientSize() ; - int x , y ; - x = origin.x ; - y = origin.y ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , origin.x , origin.y , origin.x + size.x , origin.y + size.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , -origin.x , -origin.y ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); - SetFont( window->GetFont() ) ; -} - -wxClientDC::~wxClientDC() -{ -} - -void wxClientDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetClientSize( width, height ); -} - - -/* - * wxPaintDC - */ - -wxPaintDC::wxPaintDC() -{ - m_window = NULL ; -} - -wxPaintDC::wxPaintDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - wxPoint origin = window->GetClientAreaOrigin() ; - wxSize size = window->GetClientSize() ; - int x , y ; - x = origin.x ; - y = origin.y ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , origin.x , origin.y , origin.x + size.x , origin.y + size.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , -origin.x , -origin.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->GetUpdateRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); - SetFont( window->GetFont() ) ; -} - -wxPaintDC::~wxPaintDC() -{ -} - -void wxPaintDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetClientSize( width, height ); -} - - diff --git a/src/mac/carbon/dcmemory.cpp b/src/mac/carbon/dcmemory.cpp deleted file mode 100644 index e850a59e4d..0000000000 --- a/src/mac/carbon/dcmemory.cpp +++ /dev/null @@ -1,100 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.cpp -// Purpose: wxMemoryDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcmemory.h" -#endif - -#include "wx/dcmemory.h" -#include "wx/mac/private.h" - -//----------------------------------------------------------------------------- -// wxMemoryDC -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) - -wxMemoryDC::wxMemoryDC(void) -: m_selected() -{ - m_ok = TRUE; - SetBackground(*wxWHITE_BRUSH); - SetBrush(*wxWHITE_BRUSH); - SetPen(*wxBLACK_PEN); - m_ok = FALSE; -}; - -wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) -: m_selected() -{ - m_ok = TRUE; - SetBackground(*wxWHITE_BRUSH); - SetBrush(*wxWHITE_BRUSH); - SetPen(*wxBLACK_PEN); - m_ok = FALSE; -}; - -wxMemoryDC::~wxMemoryDC() -{ - if ( m_selected.Ok() ) - { - UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) ); - } -}; - -void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) -{ - if ( m_selected.Ok() ) - { - UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) ); - } - m_selected = bitmap; - if (m_selected.Ok()) - { - if ( m_selected.GetHBITMAP() ) - { - m_macPort = (GrafPtr) m_selected.GetHBITMAP() ; - LockPixels( GetGWorldPixMap( (CGrafPtr) m_macPort ) ) ; - wxMask * mask = bitmap.GetMask() ; - if ( mask ) - { - m_macMask = mask->GetMaskBitmap() ; - } - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; - m_ok = TRUE ; - } - else - { - m_ok = FALSE; - } - } - else - { - m_ok = FALSE; - } -} - -void wxMemoryDC::DoGetSize( int *width, int *height ) const -{ - if (m_selected.Ok()) - { - if (width) (*width) = m_selected.GetWidth(); - if (height) (*height) = m_selected.GetHeight(); - } - else - { - if (width) (*width) = 0; - if (height) (*height) = 0; - } -} - - diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp deleted file mode 100644 index e875cb0387..0000000000 --- a/src/mac/carbon/dcprint.cpp +++ /dev/null @@ -1,416 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcprint.cpp -// Purpose: wxPrinterDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcprint.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif - -#include "wx/dcprint.h" -#include "wx/msgdlg.h" -#include -#include "wx/mac/uma.h" -#include "wx/mac/private/print.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxPrinterDC, wxDC) -#endif - -class wxNativePrinterDC -{ -public : - wxNativePrinterDC() {} - virtual ~wxNativePrinterDC() {} - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) = 0; - virtual void EndDoc( wxPrinterDC* dc ) = 0; - virtual void StartPage( wxPrinterDC* dc ) = 0; - virtual void EndPage( wxPrinterDC* dc ) = 0; - virtual wxCoord GetMaxX() const = 0 ; - virtual wxCoord GetMaxY() const = 0 ; - // returns 0 in case of no Error, otherwise platform specific error codes - virtual wxUint32 GetStatus() const = 0 ; - bool Ok() { return GetStatus() == 0 ; } - - static wxNativePrinterDC* Create(wxPrintData* data) ; -} ; - -#if TARGET_CARBON - -class wxMacCarbonPrinterDC : public wxNativePrinterDC -{ -public : - wxMacCarbonPrinterDC( wxPrintData* data ) ; - ~wxMacCarbonPrinterDC() ; - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; - virtual void EndDoc( wxPrinterDC* dc ) ; - virtual void StartPage( wxPrinterDC* dc ) ; - virtual void EndPage( wxPrinterDC* dc ) ; - virtual wxCoord GetMaxX() const { return m_maxX ; } - virtual wxCoord GetMaxY() const { return m_maxY ; } - virtual wxUint32 GetStatus() const { return m_err ; } -private : - GrafPtr m_macPrintFormerPort ; - wxCoord m_maxX ; - wxCoord m_maxY ; - OSStatus m_err ; -} ; - -wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) -{ - ::GetPort( & m_macPrintFormerPort ) ; - - m_err = noErr ; - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) data->m_nativePrintData ; - - PMRect rPage; - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( m_err != noErr ) - return; - - m_maxX = wxCoord(rPage.right - rPage.left) ; - m_maxY = wxCoord(rPage.bottom - rPage.top); -} - -wxMacCarbonPrinterDC::~wxMacCarbonPrinterDC() -{ - // nothing to release from print data, as wxPrinterDC has all data in its wxPrintData member - ::SetPort( m_macPrintFormerPort ) ; -} - -wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data) -{ - return new wxMacCarbonPrinterDC(data) ; -} - -bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) ) -{ - if ( m_err ) - return false ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionBeginDocument(native->m_macPrintSession, - native->m_macPrintSettings, - native->m_macPageFormat); - if ( m_err != noErr ) - return false; - - PMRect rPage; - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( m_err != noErr ) - return false; - - m_maxX = (wxCoord)(rPage.right - rPage.left); - m_maxY = (wxCoord)(rPage.bottom - rPage.top); - return true ; -} - -void wxMacCarbonPrinterDC::EndDoc( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionEndDocument(native->m_macPrintSession); -} - -void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionBeginPage(native->m_macPrintSession, - native->m_macPageFormat, - nil); - - if ( m_err == noErr ) - { - m_err = PMSessionGetGraphicsContext(native->m_macPrintSession, - nil, - (void**) &dc->m_macPort ); - } - - if ( m_err != noErr ) - { - PMSessionEndPage(native->m_macPrintSession); - PMSessionEndDocument(native->m_macPrintSession); - } - else - { - PMRect rPage; - - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( !m_err ) - { - dc->m_macLocalOrigin.x = (int) rPage.left; - dc->m_macLocalOrigin.y = (int) rPage.top; - } - // since this is a non-critical error, we set the flag back - m_err = noErr ; - } -} - -void wxMacCarbonPrinterDC::EndPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionEndPage(native->m_macPrintSession); - if ( m_err != noErr ) - { - PMSessionEndDocument(native->m_macPrintSession); - } -} - -#else - -class wxMacClassicPrinterDC : public wxNativePrinterDC -{ -public : - wxMacClassicPrinterDC( wxPrintData* data ) ; - ~wxMacClassicPrinterDC() ; - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; - virtual void EndDoc( wxPrinterDC* dc ) ; - virtual void StartPage( wxPrinterDC* dc ) ; - virtual void EndPage( wxPrinterDC* dc ) ; - virtual wxCoord GetMaxX() const { return m_maxX ; } - virtual wxCoord GetMaxY() const { return m_maxY ; } - virtual wxUint32 GetStatus() const { return m_err ; } -private : - GrafPtr m_macPrintFormerPort ; - TPPrPort m_macPrintingPort ; - OSErr m_err ; - long m_maxX ; - long m_maxY ; -} ; - -wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data) -{ - return new wxMacClassicPrinterDC(data) ; -} - -wxMacClassicPrinterDC::wxMacClassicPrinterDC(wxPrintData* data) -{ - ::GetPort( &m_macPrintFormerPort ) ; - m_err = noErr ; - ::UMAPrOpen() ; - m_err = PrError() ; - if ( m_err != noErr ) - return; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) data->m_nativePrintData ; - - if ( ::PrValidate( native->m_macPrintSettings ) ) - { - // the driver has changed in the mean time, should we pop up a page setup dialog ? - if ( !::PrStlDialog( native->m_macPrintSettings ) ) - { - m_err = -1 ; - return; - } - } - m_err = PrError() ; - - if ( m_err == noErr ) - { - m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ; - m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ; - } -} - -wxMacClassicPrinterDC::~wxMacClassicPrinterDC() -{ - ::UMAPrClose() ; - ::SetPort( LMGetWMgrPort() ) ; -} - -bool wxMacClassicPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) ) -{ - if ( m_err ) - return false ; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ; - m_macPrintingPort = ::PrOpenDoc( native->m_macPrintSettings , NULL , NULL ) ; - m_err = PrError() ; - if ( m_err ) - return false ; - - // sets current port - dc->m_macPort = (GrafPtr ) m_macPrintingPort ; - m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ; - m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ; - return true ; -} - -void wxMacClassicPrinterDC::EndDoc( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - PrCloseDoc( m_macPrintingPort ) ; - m_err = PrError() ; -} - -void wxMacClassicPrinterDC::StartPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ; - - PrOpenPage( m_macPrintingPort , NULL ) ; - dc->m_macLocalOrigin.x = (**native->m_macPrintSettings).rPaper.left ; - dc->m_macLocalOrigin.y = (**native->m_macPrintSettings).rPaper.top ; - // m_macPrintingPort is now the current port - Rect clip = { -32000 , -32000 , 32000 , 32000 } ; - ::ClipRect( &clip ) ; - m_err = PrError() ; - if ( m_err != noErr ) - ::PrCloseDoc( m_macPrintingPort ) ; -} - -void wxMacClassicPrinterDC::EndPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - PrClosePage( m_macPrintingPort ) ; - m_err = PrError() ; - if ( m_err != noErr ) - ::PrCloseDoc( m_macPrintingPort ) ; -} - -#endif - -wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) -{ - m_ok = FALSE ; - m_printData = printdata ; - m_printData.ConvertToNative() ; - m_nativePrinterDC = wxNativePrinterDC::Create( &m_printData ) ; - if ( m_nativePrinterDC ) - { - m_ok = m_nativePrinterDC->Ok() ; - - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - } -} - -wxPrinterDC::~wxPrinterDC(void) -{ - delete m_nativePrinterDC ; -} - -bool wxPrinterDC::StartDoc( const wxString& message ) -{ - wxASSERT_MSG( Ok() , wxT("Called wxPrinterDC::StartDoc from an invalid object") ) ; - - if ( !m_ok ) - return false ; - - if ( m_nativePrinterDC->StartDoc(this, message ) ) - { - // in case we have to do additional things when successful - } - m_ok = m_nativePrinterDC->Ok() ; - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return m_ok ; -} - -void wxPrinterDC::EndDoc(void) -{ - if ( !m_ok ) - return ; - - m_nativePrinterDC->EndDoc( this ) ; - m_ok = m_nativePrinterDC->Ok() ; - - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } -} - -void wxPrinterDC::StartPage(void) -{ - if ( !m_ok ) - return ; - - m_logicalFunction = wxCOPY; - // m_textAlignment = wxALIGN_TOP_LEFT; - m_backgroundMode = wxTRANSPARENT; - - m_textForegroundColour = *wxBLACK; - m_textBackgroundColour = *wxWHITE; - m_pen = *wxBLACK_PEN; - m_font = *wxNORMAL_FONT; - m_brush = *wxTRANSPARENT_BRUSH; - m_backgroundBrush = *wxWHITE_BRUSH; - - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - - m_nativePrinterDC->StartPage(this) ; - m_ok = m_nativePrinterDC->Ok() ; - -} - -void wxPrinterDC::EndPage(void) -{ - if ( !m_ok ) - return ; - - m_nativePrinterDC->EndPage(this) ; - m_ok = m_nativePrinterDC->Ok() ; -} - -void wxPrinterDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") ); - - if ( width ) - * width = m_nativePrinterDC->GetMaxX() ; - if ( height ) - * height = m_nativePrinterDC->GetMaxY() ; -} - - diff --git a/src/mac/carbon/dcscreen.cpp b/src/mac/carbon/dcscreen.cpp deleted file mode 100644 index 03d769a05b..0000000000 --- a/src/mac/carbon/dcscreen.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcscreen.cpp -// Purpose: wxScreenDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcscreen.h" -#endif - -#include "wx/dcscreen.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC) -#endif - -// Create a DC representing the whole screen -wxScreenDC::wxScreenDC() -{ -#if TARGET_CARBON - m_macPort = GetQDGlobalsThePort() ; - GrafPtr port ; - GetPort( &port ) ; - SetPort( (GrafPtr) m_macPort ) ; - Point pt = { 0,0 } ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - m_macLocalOrigin.x = -pt.h ; - m_macLocalOrigin.y = -pt.v ; -#else - m_macPort = LMGetWMgrPort() ; - m_macLocalOrigin.x = 0 ; - m_macLocalOrigin.y = 0 ; -#endif - m_ok = TRUE ; - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - m_minX = screenBits.bounds.left ; - #if TARGET_CARBON - SInt16 height ; - GetThemeMenuBarHeight( &height ) ; - m_minY = screenBits.bounds.top + height ; - #else - m_minY = screenBits.bounds.top + LMGetMBarHeight() ; - #endif - m_maxX = screenBits.bounds.right ; - m_maxY = screenBits.bounds.bottom ; - MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; -} - -wxScreenDC::~wxScreenDC() -{ - // TODO -} - diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp deleted file mode 100644 index f29ed3e59e..0000000000 --- a/src/mac/carbon/dialog.cpp +++ /dev/null @@ -1,268 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp -// Purpose: wxDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dialog.h" -#endif - -#include "wx/dialog.h" -#include "wx/utils.h" -#include "wx/frame.h" -#include "wx/app.h" -#include "wx/settings.h" - -#include "wx/mac/uma.h" - -// Lists to keep track of windows, so we can disable/enable them -// for modal dialogs -wxList wxModalDialogs; -//wxList wxModelessWindows; // Frames and modeless dialogs -extern wxList wxPendingDelete; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) - -BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) - EVT_BUTTON(wxID_OK, wxDialog::OnOK) - EVT_BUTTON(wxID_APPLY, wxDialog::OnApply) - EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel) - - EVT_CHAR_HOOK(wxDialog::OnCharHook) - - EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged) - - EVT_CLOSE(wxDialog::OnCloseWindow) -END_EVENT_TABLE() - -#endif - -wxDialog::wxDialog() -{ - m_isShown = FALSE; - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); -} - -bool wxDialog::Create(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - - - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; - - MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) & ~(wxYES|wxOK|wxNO|wxCANCEL) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - return TRUE; -} - -void wxDialog::SetModal(bool flag) -{ - if ( flag ) - { - m_windowStyle |= wxDIALOG_MODAL; - - wxModelessWindows.DeleteObject(this); -#if TARGET_CARBON - SetWindowModality( (WindowRef) MacGetWindowRef() , kWindowModalityAppModal , NULL ) ; -#endif - } - else - { - m_windowStyle &= ~wxDIALOG_MODAL; - - wxModelessWindows.Append(this); - } -} - -wxDialog::~wxDialog() -{ - m_isBeingDeleted = TRUE; - Show(FALSE); -} - -// By default, pressing escape cancels the dialog , on mac command-stop does the same thing -void wxDialog::OnCharHook(wxKeyEvent& event) -{ - if (( event.m_keyCode == WXK_ESCAPE || - ( event.m_keyCode == '.' && event.MetaDown() ) ) - && FindWindow(wxID_CANCEL) ) - { - // 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); - cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); - - return; - } - // We didn't process this event. - event.Skip(); -} - -bool wxDialog::IsModal() const -{ - return (GetWindowStyleFlag() & wxDIALOG_MODAL) != 0; -} - - -bool wxDialog::IsModalShowing() const -{ - return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast -} - -bool wxDialog::Show(bool show) -{ - if ( !wxDialogBase::Show(show) ) - { - // nothing to do - return FALSE; - } - - if ( show ) - { - // usually will result in TransferDataToWindow() being called - InitDialog(); - } - - if ( IsModal() ) - { - if ( show ) - { - DoShowModal(); - } - else // end of modal dialog - { - // this will cause IsModalShowing() return FALSE and our local - // message loop will terminate - wxModalDialogs.DeleteObject(this); - } - } - - return TRUE; -} - -#if !TARGET_CARBON -extern bool s_macIsInModalLoop ; -#endif - -void wxDialog::DoShowModal() -{ - wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") ); - - wxModalDialogs.Append(this); - -#if TARGET_CARBON - BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; -#else - // TODO : test whether parent gets disabled - bool formerModal = s_macIsInModalLoop ; - s_macIsInModalLoop = true ; -#endif - while ( IsModalShowing() ) - { - wxTheApp->MacDoOneEvent() ; - // calls process idle itself - } - -#if TARGET_CARBON - EndAppModalStateForWindow( (WindowRef) MacGetWindowRef() ) ; -#else - // TODO probably reenable the parent window if any - s_macIsInModalLoop = formerModal ; -#endif -} - - -// Replacement for Show(TRUE) for modal dialogs - returns return code -int wxDialog::ShowModal() -{ - if ( !IsModal() ) - { - SetModal(TRUE); - } - - Show(TRUE); - return GetReturnCode(); -} - -// NB: this function (surprizingly) may be called for both modal and modeless -// dialogs and should work for both of them -void wxDialog::EndModal(int retCode) -{ - SetReturnCode(retCode); - Show(FALSE); -} - -// Standard buttons -void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ - if ( Validate() && TransferDataFromWindow() ) - { - EndModal(wxID_OK); - } -} - -void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) -{ - if (Validate()) - TransferDataFromWindow(); - // TODO probably need to disable the Apply button until things change again -} - -void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - // We'll send a Cancel message by default, - // which may close the dialog. - // Check for looping if the Cancel event handler calls Close(). - - // Note that if a cancel button and handler aren't present in the dialog, - // nothing will happen when you close the dialog via the window manager, or - // via Close(). - // We wouldn't want to destroy the dialog by default, since the dialog may have been - // created on the stack. - // However, this does mean that calling dialog->Close() won't delete the dialog - // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be - // sure to destroy the dialog. - // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog. - - static wxList closing; - - if ( closing.Member(this) ) - return; - - closing.Append(this); - - wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); - cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog - - closing.DeleteObject(this); -} - -void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - Refresh(); -} - diff --git a/src/mac/carbon/dirdlg.cpp b/src/mac/carbon/dirdlg.cpp deleted file mode 100644 index 0b4c7df195..0000000000 --- a/src/mac/carbon/dirdlg.cpp +++ /dev/null @@ -1,146 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.cpp -// Purpose: wxDirDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dirdlg.h" -#endif - -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/dirdlg.h" - -#include "wx/cmndata.h" - -#include "wx/mac/private.h" - -#ifdef __DARWIN__ - #include -#else - #include -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxDirDialog, wxDialog) -#endif - -wxDirDialog::wxDirDialog(wxWindow *parent, - const wxString& message, - const wxString& defaultPath, - long style, - const wxPoint& WXUNUSED(pos), - const wxSize& WXUNUSED(size), - const wxString& WXUNUSED(name)) -{ - wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ; - m_message = message; - m_dialogStyle = style; - m_parent = parent; - m_path = defaultPath; -} - -int wxDirDialog::ShowModal() -{ - NavDialogOptions mNavOptions; - NavObjectFilterUPP mNavFilterUPP = NULL; - NavPreviewUPP mNavPreviewUPP = NULL ; - NavReplyRecord mNavReply; - AEDesc* mDefaultLocation = NULL ; - bool mSelectDefault = false ; - - ::NavGetDefaultDialogOptions(&mNavOptions); - - mNavFilterUPP = nil; - mNavPreviewUPP = nil; - mSelectDefault = false; - mNavReply.validRecord = false; - mNavReply.replacing = false; - mNavReply.isStationery = false; - mNavReply.translationNeeded = false; - mNavReply.selection.descriptorType = typeNull; - mNavReply.selection.dataHandle = nil; - mNavReply.keyScript = smSystemScript; - mNavReply.fileTranslation = nil; - - // Set default location, the location - // that's displayed when the dialog - // first appears - - if ( mDefaultLocation ) { - - if (mSelectDefault) { - mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; - } else { - mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; - } - } - - OSErr err = ::NavChooseFolder( - mDefaultLocation, - &mNavReply, - &mNavOptions, - NULL, - mNavFilterUPP, - 0L); // User Data - - if ( (err != noErr) && (err != userCanceledErr) ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - - if (mNavReply.validRecord) { // User chose a folder - - FSSpec folderInfo; - FSSpec outFileSpec ; - AEDesc specDesc ; - - OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc); - if ( err != noErr ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - folderInfo = **(FSSpec**) specDesc.dataHandle; - if (specDesc.dataHandle != nil) { - ::AEDisposeDesc(&specDesc); - } - -// mNavReply.GetFileSpec(folderInfo); - - // The FSSpec from NavChooseFolder is NOT the file spec - // for the folder. The parID field is actually the DirID - // of the folder itself, not the folder's parent, and - // the name field is empty. We must call PBGetCatInfo - // to get the parent DirID and folder name - - Str255 name; - CInfoPBRec thePB; // Directory Info Parameter Block - thePB.dirInfo.ioCompletion = nil; - thePB.dirInfo.ioVRefNum = folderInfo.vRefNum; // Volume is right - thePB.dirInfo.ioDrDirID = folderInfo.parID; // Folder's DirID - thePB.dirInfo.ioNamePtr = name; - thePB.dirInfo.ioFDirIndex = -1; // Lookup using Volume and DirID - - err = ::PBGetCatInfoSync(&thePB); - if ( err != noErr ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - // Create cannonical FSSpec - ::FSMakeFSSpec(thePB.dirInfo.ioVRefNum, thePB.dirInfo.ioDrParID, - name, &outFileSpec); - - // outFolderDirID = thePB.dirInfo.ioDrDirID; - m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ; - return wxID_OK ; - } - return wxID_CANCEL; -} - diff --git a/src/mac/carbon/dirmac.cpp b/src/mac/carbon/dirmac.cpp deleted file mode 100644 index 0afc3b5cb3..0000000000 --- a/src/mac/carbon/dirmac.cpp +++ /dev/null @@ -1,322 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/dir.cpp -// Purpose: wxDir implementation for Mac -// Author: Stefan Csomor -// Modified by: -// Created: 08.12.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "dir.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif // PCH - -#include "wx/dir.h" -#include "wx/filefn.h" // for wxPathExists() - -#ifndef __DARWIN__ - #include -#endif - -#include "wx/mac/private.h" - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifndef MAX_PATH - #define MAX_PATH 260 // from VC++ headers -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#define M_DIR ((wxDirData *)m_data) - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// this class stores everything we need to enumerate the files -class wxDirData -{ -public: - wxDirData(const wxString& dirname); - ~wxDirData(); - - void SetFileSpec(const wxString& filespec) { m_filespec = filespec; } - void SetFlags(int flags) { m_flags = flags; } - - bool Read(wxString *filename); // reads the next - void Rewind() ; - - const wxString& GetName() const { return m_dirname; } - bool Ok() const { return m_ok; } - -private: - CInfoPBRec m_CPB ; - wxInt16 m_index ; - long m_dirId ; - Str255 m_name ; - Boolean m_isDir ; - - wxString m_dirname; - wxString m_filespec; - - int m_flags; - bool m_ok; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDirData -// ---------------------------------------------------------------------------- - -wxDirData::wxDirData(const wxString& dirname) - : m_dirname(dirname) -{ - m_ok = false; - - OSErr err; - - // throw away the trailing slashes - size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); - - while ( n > 0 && wxIsPathSeparator(m_dirname[--n]) ) - ; - - m_dirname.Truncate(n + 1); - -#ifdef __DARWIN__ - FSRef theRef; - - // get the FSRef associated with the POSIX path - err = FSPathMakeRef((const UInt8 *) m_dirname.c_str(), &theRef, NULL); - FSGetVRefNum(&theRef, &(m_CPB.hFileInfo.ioVRefNum)); - - err = FSGetNodeID( &theRef , &m_dirId , &m_isDir ) ; -#else - FSSpec fsspec ; - - wxMacFilename2FSSpec( m_dirname , &fsspec ) ; - m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ; - - err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; -#endif - //wxASSERT_MSG( (err == noErr) || (err == nsvErr) , wxT("Error accessing directory " + m_dirname)) ; - if ( (err == noErr) || (err == nsvErr)) - m_ok = true; - else - wxLogError(wxString(wxT("Error accessing directory ")) + m_dirname); - - m_CPB.hFileInfo.ioNamePtr = m_name ; - m_index = 0 ; -} - -wxDirData::~wxDirData() -{ -} - -void wxDirData::Rewind() -{ - m_index = 0 ; -} - -bool wxDirData::Read(wxString *filename) -{ - if ( !m_isDir ) - return FALSE ; - - wxString result; - - short err = noErr ; - - while ( err == noErr ) - { - m_index++ ; - m_CPB.dirInfo.ioFDirIndex = m_index; - m_CPB.dirInfo.ioDrDirID = m_dirId; /* we need to do this every time */ - err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB); - if ( err != noErr ) - break ; - - // its hidden but we don't want it - if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) ) - continue ; -#ifdef __DARWIN__ - // under X, names that start with '.' are hidden - if ( ( m_name[1] == '.' ) && !(m_flags & wxDIR_HIDDEN) ) - continue; -#endif -#if TARGET_CARBON - // under X thats the way the mounting points look like - if ( ( m_CPB.dirInfo.ioDrDirID == 0 ) && ( m_flags & wxDIR_DIRS) ) - break ; -#endif - // we have a directory - if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) - break ; - - // its a file but we don't want it - if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) ) - continue ; - - wxString file = wxMacMakeStringFromPascal( m_name ) ; - if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") ) - { - } - else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") ) - { - if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() ) - { - continue ; - } - } - else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == wxT("*") ) - { - if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() ) - { - continue ; - } - } - else if ( file.Upper() != m_filespec.Upper() ) - { - continue ; - } - - break ; - } - if ( err != noErr ) - { - return FALSE ; - } - - *filename = wxMacMakeStringFromPascal( m_name ) ; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxDir helpers -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDir::Exists(const wxString& dir) -{ - return wxPathExists(dir); -} - -// ---------------------------------------------------------------------------- -// wxDir construction/destruction -// ---------------------------------------------------------------------------- - -wxDir::wxDir(const wxString& dirname) -{ - m_data = NULL; - - (void)Open(dirname); -} - -bool wxDir::Open(const wxString& dirname) -{ - delete M_DIR; - m_data = new wxDirData(dirname); - if (m_data->Ok()) - return TRUE; - else - { - delete m_data; - m_data = NULL; - return FALSE; - } -} - -bool wxDir::IsOpened() const -{ - return m_data != NULL; -} - -wxString wxDir::GetName() const -{ - wxString name; - if ( m_data ) - { - name = M_DIR->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) - { - // chop off the last (back)slash - name.Truncate(name.length() - 1); - } - } - - return name; -} - -wxDir::~wxDir() -{ - if (M_DIR != NULL) { - delete M_DIR; - m_data = NULL; - } -} - -// ---------------------------------------------------------------------------- -// wxDir enumerating -// ---------------------------------------------------------------------------- - -bool wxDir::GetFirst(wxString *filename, - const wxString& filespec, - int flags) const -{ - wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") ); - - M_DIR->Rewind(); - - M_DIR->SetFileSpec(filespec); - M_DIR->SetFlags(flags); - - return GetNext(filename); -} - -bool wxDir::GetNext(wxString *filename) const -{ - wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") ); - - wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") ); - - return M_DIR->Read(filename); -} diff --git a/src/mac/carbon/display.cpp b/src/mac/carbon/display.cpp deleted file mode 100644 index 8786306211..0000000000 --- a/src/mac/carbon/display.cpp +++ /dev/null @@ -1,446 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: display.cpp -// Purpose: Mac implementation of wxDisplay class -// Author: Brian Victor -// Modified by: Royce Mitchell III & Ryan Norton -// Created: 06/21/02 -// RCS-ID: $Id$ -// Copyright: (c) wxWindows team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "display.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DISPLAY - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" - #include "wx/msgdlg.h" -#endif - -#ifdef __DARWIN__ - #include -#else - #include - #include - #include - #include //for VDSwitchInfoRec - #include -#endif - -#include "wx/display.h" -#include "wx/gdicmn.h" -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxDisplayMacPriv -{ -public: - GDHandle m_hndl; -}; - -size_t wxDisplayBase::GetCount() -{ - GDHandle hndl; - size_t num = 0; - hndl = DMGetFirstScreenDevice(true); - while(hndl) - { - num++; - hndl = DMGetNextScreenDevice(hndl, true); - } - return num; -} - -int wxDisplayBase::GetFromPoint(const wxPoint &p) -{ - GDHandle hndl; - size_t num = 0; - hndl = DMGetFirstScreenDevice(true); - while(hndl) - { - Rect screenrect = (*hndl)->gdRect; - if (p.x >= screenrect.left && - p.x <= screenrect.right && - p.y >= screenrect.top && - p.y <= screenrect.bottom) - { - return num; - } - num++; - hndl = DMGetNextScreenDevice(hndl, true); - } - return -1; -} - -wxDisplay::wxDisplay(size_t index) : wxDisplayBase ( index ), - m_priv ( new wxDisplayMacPriv() ) -{ - GDHandle hndl; - hndl = DMGetFirstScreenDevice(true); - m_priv->m_hndl = NULL; - while(hndl) - { - if (index == 0) - { - m_priv->m_hndl = hndl; - } - index--; - hndl = DMGetNextScreenDevice(hndl, true); - } -} - -wxRect wxDisplay::GetGeometry() const -{ - if (!(m_priv)) return wxRect(0, 0, 0, 0); - if (!(m_priv->m_hndl)) return wxRect(0, 0, 0, 0); - Rect screenrect = (*(m_priv->m_hndl))->gdRect; - return wxRect( screenrect.left, screenrect.top, - screenrect.right - screenrect.left, screenrect.bottom - screenrect.top); -} - -int wxDisplay::GetDepth() const -{ - if (!(m_priv)) return 0; - if (!(m_priv->m_hndl)) return 0; - - // This cryptic looking code is based on Apple's sample code: - // http://developer.apple.com/samplecode/Sample_Code/Graphics_2D/GDevVideo/Gen.cp.htm - - //RN - according to the docs - //gdPMap is a bitmap-type representation of the GDevice, and all - //0x0000FFFF does is get the lower 16 bits of pixelSize. However, - //since pixelSize is only 16 bits (a short)... - return ((*(*(m_priv->m_hndl))->gdPMap)->pixelSize) & 0x0000FFFF; -} - -wxString wxDisplay::GetName() const -{ - // Macs don't name their displays... - return wxEmptyString; -} - -struct DMModeIteratorRec -{ - wxArrayVideoModes* pModes; - const wxVideoMode* pMatchMode; -}; - -pascal void DMModeListIteratorProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeIteratorRec* pInfoData = (DMModeIteratorRec*) pData; - - //Note that in testing the refresh rate is always 0 on my ibook - RN - int refresh = (int) Fix2Long(pInfo->displayModeResolutionInfo->csRefreshRate); - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - - if (wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - refresh).Matches(*pInfoData->pMatchMode) ) - { - pInfoData->pModes->Add(wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - refresh)); - } -#undef pDBI - } -} - -struct DMModeInfoRec -{ - const wxVideoMode* pMode; - VDSwitchInfoRec sMode; - bool bMatched; -}; - -pascal void DMModeInfoProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeInfoRec* pInfoData = (DMModeInfoRec*) pData; - Fixed refresh = Long2Fix(pInfoData->pMode->refresh); - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - if (pInfoData->pMode->w == (int&) pInfo->displayModeResolutionInfo->csHorizontalPixels && - pInfoData->pMode->h == (int&) pInfo->displayModeResolutionInfo->csVerticalLines && - pInfoData->pMode->bpp == (int) pDBI->vpPixelSize && - refresh == pInfo->displayModeResolutionInfo->csRefreshRate) - { - memcpy(&pInfoData->sMode, pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthSwitchInfo, - sizeof(VDSwitchInfoRec)); - pInfoData->sMode.csMode = pDBI->vpPixelSize; - pInfoData->bMatched = true; - break; - } -#undef pDBI - } -} - -struct DMModeTransRec -{ - wxVideoMode Mode; - const VDSwitchInfoRec* psMode; - bool bMatched; -}; - -pascal void DMModeTransProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeTransRec* pInfoData = (DMModeTransRec*) pData; - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - if (pInfoData->psMode->csData == pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthSwitchInfo->csData) - { - pInfoData->Mode = wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - (int) Fix2Long(pInfo->displayModeResolutionInfo->csRefreshRate) ); - pInfoData->bMatched = true; - break; - } -#undef pDBI - } -} - -wxArrayVideoModes - wxDisplay::GetModes(const wxVideoMode& mode) const -{ - - wxArrayVideoModes Modes; - - unsigned long dwDMVer; - Gestalt(gestaltDisplayMgrVers, (long*) &dwDMVer); - - //Check DM version (for backward compatibility only - 7.5.3+ use 2.0) - if (dwDMVer >= 0x020000) //version 2? - { - - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeListIteratorProc); - wxASSERT(uppMLI); - - DMModeIteratorRec sModeInfo; - sModeInfo.pModes = &Modes; - sModeInfo.pMatchMode = &mode; - for (DMListIndexType i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - } - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - } - else //DM 1.0, 1.2, 1.x - { - wxLogSysError(wxString::Format(wxT("Display Manager Version %u Not Supported! Present? %s"), - (unsigned int) dwDMVer / 0x10000, - (dwDMVer & (1 << gestaltDisplayMgrPresent) ? wxT("Yes") : wxT("No")) ) - ); - } - - return Modes; -} - -wxVideoMode wxDisplay::GetCurrentMode() const -{ - unsigned long dwDMVer; - wxVideoMode RetMode; - - Gestalt(gestaltDisplayMgrVers, (long*) &dwDMVer); - //Check DM version (for backward compatibility only - 7.5.3+ use 2.0) - if (dwDMVer >= 0x020000) //version 2? - { - VDSwitchInfoRec sMode; //Note - csMode member also contains the bit depth - if (DMGetDisplayMode(m_priv->m_hndl, &sMode) == noErr) - { - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeTransProc); - wxASSERT(uppMLI); - - DMModeTransRec sModeInfo; - sModeInfo.bMatched = false; - sModeInfo.psMode = &sMode; - for (DMListIndexType i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - - if ( sModeInfo.bMatched == true ) - { - RetMode = sModeInfo.Mode; - break; - } - } - - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - } - else //Can't get current mode? - { - wxLogSysError(wxString::Format(wxT("Couldn't obtain current display mode!!!\ndwDMVer:%u"), - (unsigned int) dwDMVer)); - } - } - else //DM ver 1 - { - wxLogSysError(wxString::Format(wxT("Display Manager Version %u Not Supported! Present? %s"), - (unsigned int) dwDMVer / 0x10000, - (dwDMVer & (1 << gestaltDisplayMgrPresent) ? wxT("Yes") : wxT("No")) ) - ); - } - - return RetMode; -} - -bool wxDisplay::ChangeMode(const wxVideoMode& mode) -{ - unsigned long dwDMVer; - Gestalt(gestaltDisplayMgrVers, (long*)&dwDMVer); - if (GetCount() == 1 || dwDMVer >= 0x020000) - { - if (mode == wxDefaultVideoMode) - { -//#ifndef __DARWIN__ -// Handle hDisplayState; -// if (DMBeginConfigureDisplays(&hDisplayState) != noErr) -// { -// wxLogSysError(wxT("Could not lock display for display mode changing!")); -// return false; -// } -// wxASSERT( DMUseScreenPrefs(true, hDisplayState) == noErr); -// DMEndConfigureDisplays(hDisplayState); -// return true; -//#else - //hmmmmm.... - return true; -//#endif - } - - //0 & NULL for params 2 & 3 of DMSetVideoMode signal it to use defaults (current mode) - //DM 2.0+ doesn't use params 2 & 3 of DMSetDisplayMode - //so we have to use this icky structure - VDSwitchInfoRec sMode; - memset(&sMode, 0, sizeof(VDSwitchInfoRec) ); - - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeInfoProc); - wxASSERT(uppMLI); - - DMModeInfoRec sModeInfo; - sModeInfo.bMatched = false; - sModeInfo.pMode = &mode; - unsigned int i; - for(i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - if (sModeInfo.bMatched == true) - { - sMode = sModeInfo.sMode; - break; - } - } - if(i == nNumModes) - return false; - - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - - // For the really paranoid - - // unsigned long flags; - // Boolean bok; - // wxASSERT(noErr == DMCheckDisplayMode(m_priv->m_hndl, sMode.csData, - // sMode.csMode, &flags, NULL, &bok)); - // wxASSERT(bok); - - Handle hDisplayState; - if (DMBeginConfigureDisplays(&hDisplayState) != noErr) - { - wxLogSysError(wxT("Could not lock display for display mode changing!")); - return false; - } - - unsigned long dwBPP = (unsigned long) mode.bpp; - if (DMSetDisplayMode(m_priv->m_hndl, sMode.csData, - (unsigned long*) &(dwBPP), NULL - //(unsigned long) &sMode - , hDisplayState - ) != noErr) - { - DMEndConfigureDisplays(hDisplayState); - wxMessageBox(wxString::Format(wxT("Could not set the display mode"))); - return false; - } - DMEndConfigureDisplays(hDisplayState); - } - else //DM 1.0, 1.2, 1.x - { - wxLogSysError(wxString::Format(wxT("Monitor gravitation not supported yet. dwDMVer:%u"), - (unsigned int) dwDMVer)); - return false; - } - - return true; -} - -wxDisplay::~wxDisplay() -{ - if ( m_priv ) - { - delete m_priv; - m_priv = 0; - } -} - -#endif // wxUSE_DISPLAY diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp deleted file mode 100644 index 22ced39ede..0000000000 --- a/src/mac/carbon/dnd.cpp +++ /dev/null @@ -1,607 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dnd.cpp -// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dnd.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_DRAG_AND_DROP - -#include "wx/dnd.h" -#include "wx/window.h" -#include "wx/toplevel.h" -#include "wx/app.h" -#include "wx/gdicmn.h" -#include "wx/mac/private.h" - -// ---------------------------------------------------------------------------- -// global -// ---------------------------------------------------------------------------- - -void wxMacEnsureTrackingHandlersInstalled() ; - -typedef struct -{ - wxWindow* m_currentTargetWindow ; - wxDropTarget* m_currentTarget ; - wxDropSource* m_currentSource ; -} MacTrackingGlobals ; - -MacTrackingGlobals gTrackingGlobals ; - -//---------------------------------------------------------------------------- -// wxDropTarget -//---------------------------------------------------------------------------- - -wxDropTarget::wxDropTarget( wxDataObject *data ) - : wxDropTargetBase( data ) -{ - wxMacEnsureTrackingHandlersInstalled() ; -} - -wxDragResult wxDropTarget::OnDragOver( wxCoord WXUNUSED(x), - wxCoord WXUNUSED(y), - wxDragResult def ) -{ - - return CurrentDragHasSupportedFormat() ? def : wxDragNone; -} - -bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) ) -{ - if (!m_dataObject) - return FALSE; - - return CurrentDragHasSupportedFormat() ; -} - -wxDragResult wxDropTarget::OnData( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - wxDragResult def ) -{ - if (!m_dataObject) - return wxDragNone; - - if (!CurrentDragHasSupportedFormat()) - return wxDragNone; - - return GetData() ? def : wxDragNone; -} - -bool wxDropTarget::CurrentDragHasSupportedFormat() -{ - bool supported = false ; - if ( gTrackingGlobals.m_currentSource != NULL ) - { - wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject() ; - - if ( data ) - { - size_t formatcount = data->GetFormatCount() ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - data->GetAllFormats( array ); - for (size_t i = 0; !supported && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_dataObject->IsSupported( format ) ) - { - supported = true ; - break ; - } - } - delete[] array ; - } - } - if ( !supported ) - { - UInt16 items ; - OSErr result; - CountDragItems((DragReference)m_currentDrag, &items); - for (UInt16 index = 1; index <= items && supported == false ; ++index) - { - ItemReference theItem; - FlavorType theType ; - UInt16 flavors = 0 ; - GetDragItemReferenceNumber((DragReference)m_currentDrag, index, &theItem); - CountDragItemFlavors( (DragReference)m_currentDrag, theItem , &flavors ) ; - for ( UInt16 flavor = 1 ; flavor <= flavors ; ++flavor ) - { - result = GetFlavorType((DragReference)m_currentDrag, theItem, flavor , &theType); - if ( m_dataObject->IsSupportedFormat( wxDataFormat( theType ) ) ) - { - supported = true ; - break ; - } - } - } - } - return supported ; -} - -bool wxDropTarget::GetData() -{ - if (!m_dataObject) - return FALSE; - - if ( !CurrentDragHasSupportedFormat() ) - return FALSE ; - - bool transferred = false ; - if ( gTrackingGlobals.m_currentSource != NULL ) - { - wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject() ; - - if ( data ) - { - size_t formatcount = data->GetFormatCount() ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - data->GetAllFormats( array ); - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_dataObject->IsSupported( format ) ) - { - int size = data->GetDataSize( format ); - transferred = true ; - - if (size == 0) - { - m_dataObject->SetData(format , 0 , 0 ) ; - } - else - { - char *d = new char[size]; - data->GetDataHere( format , (void*) d ); - m_dataObject->SetData( format , size , d ) ; - delete[] d ; - } - } - } - delete[] array ; - } - } - if ( !transferred ) - { - UInt16 items ; - OSErr result; - bool firstFileAdded = false ; - CountDragItems((DragReference)m_currentDrag, &items); - for (UInt16 index = 1; index <= items; ++index) - { - ItemReference theItem; - FlavorType theType ; - UInt16 flavors = 0 ; - GetDragItemReferenceNumber((DragReference)m_currentDrag, index, &theItem); - CountDragItemFlavors( (DragReference)m_currentDrag, theItem , &flavors ) ; - for ( UInt16 flavor = 1 ; flavor <= flavors ; ++flavor ) - { - result = GetFlavorType((DragReference)m_currentDrag, theItem, flavor , &theType); - wxDataFormat format(theType) ; - if ( m_dataObject->IsSupportedFormat( format ) ) - { - FlavorFlags theFlags; - result = GetFlavorFlags((DragReference)m_currentDrag, theItem, theType, &theFlags); - if (result == noErr) - { - Size dataSize ; - Ptr theData ; - GetFlavorDataSize((DragReference)m_currentDrag, theItem, theType, &dataSize); - if ( theType == 'TEXT' ) - { - // this increment is only valid for allocating, on the next GetFlavorData - // call it is reset again to the original value - dataSize++ ; - } - theData = new char[dataSize]; - GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L); - if( theType == 'TEXT' ) - { - theData[dataSize]=0 ; - wxString convert( theData , wxConvLocal ) ; - m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert ); - } - else if ( theType == kDragFlavorTypeHFS ) - { - HFSFlavor* theFile = (HFSFlavor*) theData ; - wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ) ; - if ( firstFileAdded ) - ((wxFileDataObject*)m_dataObject)->AddFile( name ) ; - else - { - ((wxFileDataObject*)m_dataObject)->SetData( 0 , name.c_str() ) ; - firstFileAdded = true ; - } - } - else - { - m_dataObject->SetData( format, dataSize, theData ); - } - delete[] theData; - } - break ; - } - } - } - } - return TRUE ; -} - -//------------------------------------------------------------------------- -// wxDropSource -//------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// drag request - -wxDropSource::wxDropSource(wxWindow *win, - const wxCursor &cursorCopy, - const wxCursor &cursorMove, - const wxCursor &cursorStop) - : wxDropSourceBase(cursorCopy, cursorMove, cursorStop) -{ - wxMacEnsureTrackingHandlersInstalled() ; - m_window = win; -} - -wxDropSource::wxDropSource(wxDataObject& data, - wxWindow *win, - const wxCursor &cursorCopy, - const wxCursor &cursorMove, - const wxCursor &cursorStop) - : wxDropSourceBase(cursorCopy, cursorMove, cursorStop) -{ - wxMacEnsureTrackingHandlersInstalled() ; - SetData( data ); - m_window = win; -} - -wxDropSource::~wxDropSource() -{ -} - - -wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) -{ - wxASSERT_MSG( m_data, wxT("Drop source: no data") ); - - if (!m_data) - return (wxDragResult) wxDragNone; - - if (m_data->GetFormatCount() == 0) - return (wxDragResult) wxDragNone; - - OSErr result; - DragReference theDrag; - RgnHandle dragRegion; - if ((result = NewDrag(&theDrag))) - { - return wxDragNone ; - } - // add data to drag - size_t formatCount = m_data->GetFormatCount() ; - wxDataFormat *formats = new wxDataFormat[formatCount] ; - m_data->GetAllFormats( formats ) ; - ItemReference theItem = 1 ; - for ( size_t i = 0 ; i < formatCount ; ++i ) - { - size_t dataSize = m_data->GetDataSize( formats[i] ) ; - Ptr dataPtr = new char[dataSize] ; - m_data->GetDataHere( formats[i] , dataPtr ) ; - OSType type = formats[i].GetFormatId() ; - if ( type == 'TEXT' ) - { - dataSize-- ; - dataPtr[ dataSize ] = 0 ; - wxString st( (wxChar*) dataPtr ) ; - wxCharBuffer buf = st.mb_str( wxConvLocal) ; - AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0); - } - else if (type == kDragFlavorTypeHFS ) - { - HFSFlavor theFlavor ; - OSErr err = noErr; - CInfoPBRec cat; - - wxMacFilename2FSSpec( dataPtr , &theFlavor.fileSpec ) ; - - cat.hFileInfo.ioNamePtr = theFlavor.fileSpec.name; - cat.hFileInfo.ioVRefNum = theFlavor.fileSpec.vRefNum; - cat.hFileInfo.ioDirID = theFlavor.fileSpec.parID; - cat.hFileInfo.ioFDirIndex = 0; - err = PBGetCatInfoSync(&cat); - if (err == noErr ) - { - theFlavor.fdFlags = cat.hFileInfo.ioFlFndrInfo.fdFlags; - if (theFlavor.fileSpec.parID == fsRtParID) { - theFlavor.fileCreator = 'MACS'; - theFlavor.fileType = 'disk'; - } else if ((cat.hFileInfo.ioFlAttrib & ioDirMask) != 0) { - theFlavor.fileCreator = 'MACS'; - theFlavor.fileType = 'fold'; - } else { - theFlavor.fileCreator = cat.hFileInfo.ioFlFndrInfo.fdCreator; - theFlavor.fileType = cat.hFileInfo.ioFlFndrInfo.fdType; - } - AddDragItemFlavor(theDrag, theItem, type , &theFlavor, sizeof(theFlavor), 0); - } - } - else - { - AddDragItemFlavor(theDrag, theItem, type , dataPtr, dataSize, 0); - } - delete[] dataPtr ; - } - delete[] formats ; - - dragRegion = NewRgn(); - RgnHandle tempRgn = NewRgn() ; - - EventRecord* ev = NULL ; -#if !TARGET_CARBON // TODO - ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; -#else - EventRecord rec ; - ev = &rec ; - wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ; -#endif - const short dragRegionOuterBoundary = 10 ; - const short dragRegionInnerBoundary = 9 ; - - SetRectRgn( dragRegion , ev->where.h - dragRegionOuterBoundary , - ev->where.v - dragRegionOuterBoundary , - ev->where.h + dragRegionOuterBoundary , - ev->where.v + dragRegionOuterBoundary ) ; - - SetRectRgn( tempRgn , ev->where.h - dragRegionInnerBoundary , - ev->where.v - dragRegionInnerBoundary , - ev->where.h + dragRegionInnerBoundary , - ev->where.v + dragRegionInnerBoundary ) ; - - DiffRgn( dragRegion , tempRgn , dragRegion ) ; - DisposeRgn( tempRgn ) ; - - // TODO:work with promises in order to return data only when drag - // was successfully completed - - gTrackingGlobals.m_currentSource = this ; - result = TrackDrag(theDrag, ev , dragRegion); - DisposeRgn(dragRegion); - DisposeDrag(theDrag); - gTrackingGlobals.m_currentSource = NULL ; - - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult dndresult = optionDown ? wxDragCopy : wxDragMove; - return dndresult; -} - -bool wxDropSource::MacInstallDefaultCursor(wxDragResult effect) -{ - const wxCursor& cursor = GetCursor(effect); - if ( cursor.Ok() ) - { - cursor.MacInstall() ; - - return TRUE; - } - else - { - return FALSE; - } -} - -bool gTrackingGlobalsInstalled = false ; - -// passing the globals via refcon is not needed by the CFM and later architectures anymore -// but I'll leave it in there, just in case... - -pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow, - void *handlerRefCon, DragReference theDrag) ; -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, -DragReference theDrag) ; - -void wxMacEnsureTrackingHandlersInstalled() -{ - if( !gTrackingGlobalsInstalled ) - { - OSErr result; - - result = InstallTrackingHandler(NewDragTrackingHandlerUPP(wxMacWindowDragTrackingHandler), 0L,&gTrackingGlobals); - wxASSERT( result == noErr ) ; - result = InstallReceiveHandler(NewDragReceiveHandlerUPP(wxMacWindowDragReceiveHandler), 0L, &gTrackingGlobals); - wxASSERT( result == noErr ) ; - - gTrackingGlobalsInstalled = true ; - } -} - -pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow, - void *handlerRefCon, DragReference theDrag) -{ - MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; - Point mouse, localMouse; - DragAttributes attributes; - GetDragAttributes(theDrag, &attributes); - wxTopLevelWindowMac* toplevel = wxFindWinFromMacWindow( theWindow ) ; - - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult result = optionDown ? wxDragCopy : wxDragMove; - - switch(theMessage) - { - case kDragTrackingEnterHandler: - break; - case kDragTrackingLeaveHandler: - break; - case kDragTrackingEnterWindow: - trackingGlobals->m_currentTargetWindow = NULL ; - trackingGlobals->m_currentTarget = NULL ; - break; - case kDragTrackingInWindow: - if (toplevel == NULL) - break; - - GetDragMouse(theDrag, &mouse, 0L); - localMouse = mouse; - GlobalToLocal(&localMouse); - - - -// if (attributes & kDragHasLeftSenderWindow) - { - wxPoint point(localMouse.h , localMouse.v) ; - wxWindow *win = NULL ; - toplevel->MacGetWindowFromPointSub( point , &win ) ; - int localx , localy ; - localx = localMouse.h ; - localy = localMouse.v ; - //TODO : should we use client coordinates - if ( win ) - win->MacRootWindowToWindow( &localx , &localy ) ; - if ( win != trackingGlobals->m_currentTargetWindow ) - { - if ( trackingGlobals->m_currentTargetWindow ) - { - // this window is left - if ( trackingGlobals->m_currentTarget ) - { - HideDragHilite(theDrag); - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnLeave() ; - trackingGlobals->m_currentTarget = NULL; - trackingGlobals->m_currentTargetWindow = NULL ; - } - } - if ( win ) - { - // this window is entered - trackingGlobals->m_currentTargetWindow = win ; - trackingGlobals->m_currentTarget = win->GetDropTarget() ; - { - - if ( trackingGlobals->m_currentTarget ) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - result = trackingGlobals->m_currentTarget->OnEnter( - localx , localy , result ) ; - } - - - if ( result != wxDragNone ) - { - int x , y ; - x = y = 0 ; - win->MacWindowToRootWindow( &x , &y ) ; - RgnHandle hiliteRgn = NewRgn() ; - SetRectRgn( hiliteRgn , x , y , x+win->GetSize().x ,y+win->GetSize().y) ; - ShowDragHilite(theDrag, hiliteRgn, true); - DisposeRgn( hiliteRgn ) ; - } - } - } - } - else - { - if( trackingGlobals->m_currentTarget ) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnDragOver( - localx , localy , result ) ; - } - } - - // set cursor for OnEnter and OnDragOver - if ( trackingGlobals->m_currentSource && trackingGlobals->m_currentSource->GiveFeedback( result ) == FALSE ) - { - if ( trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) == FALSE ) - { - switch( result ) - { - case wxDragCopy : - { - wxCursor cursor(wxCURSOR_COPY_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragMove : - { - wxCursor cursor(wxCURSOR_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragNone : - { - wxCursor cursor(wxCURSOR_NO_ENTRY) ; - cursor.MacInstall() ; - } - break ; - - case wxDragError: - case wxDragLink: - case wxDragCancel: - // put these here to make gcc happy - ; - } - } - } - - } - // MyTrackItemUnderMouse(localMouse, theWindow); - break; - case kDragTrackingLeaveWindow: - if (trackingGlobals->m_currentTarget) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnLeave() ; - HideDragHilite(theDrag); - trackingGlobals->m_currentTarget = NULL ; - } - trackingGlobals->m_currentTargetWindow = NULL ; - break; - } - return(noErr); -} - -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, - void *handlerRefCon, - DragReference theDrag) -{ - MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; - if ( trackingGlobals->m_currentTarget ) - { - Point mouse,localMouse ; - int localx,localy ; - - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - GetDragMouse(theDrag, &mouse, 0L); - localMouse = mouse; - GlobalToLocal(&localMouse); - localx = localMouse.h ; - localy = localMouse.v ; - //TODO : should we use client coordinates - if ( trackingGlobals->m_currentTargetWindow ) - trackingGlobals->m_currentTargetWindow->MacRootWindowToWindow( &localx , &localy ) ; - if ( trackingGlobals->m_currentTarget->OnDrop( localx , localy ) ) - { - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult result = optionDown ? wxDragCopy : wxDragMove; - trackingGlobals->m_currentTarget->OnData( localx , localy , result ) ; - } - } - return(noErr); -} -#endif diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp deleted file mode 100644 index 59807f398d..0000000000 --- a/src/mac/carbon/filedlg.cpp +++ /dev/null @@ -1,647 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: filedlg.cpp -// Purpose: wxFileDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "filedlg.h" -#endif - -#include "wx/defs.h" -#include "wx/app.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/filedlg.h" -#include "wx/intl.h" -#include "wx/tokenzr.h" -#include "wx/filename.h" - -#ifndef __DARWIN__ - #include "PLStringFuncs.h" -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase) -#endif - -// begin wxmac - -#include "wx/mac/private.h" - -#include - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -extern bool gUseNavServices ; - -// the data we need to pass to our standard file hook routine -// includes a pointer to the dialog, a pointer to the standard -// file reply record (so we can inspect the current selection) -// and a copy of the "previous" file spec of the reply record -// so we can see if the selection has changed - -struct OpenUserDataRec { - int currentfilter ; - bool saveMode ; - wxArrayString name ; - wxArrayString extensions ; - wxArrayLong filtermactypes ; - wxString defaultLocation; -#if TARGET_CARBON - CFArrayRef menuitems ; -#else - NavMenuItemSpecArrayHandle menuitems ; -#endif -}; - -typedef struct OpenUserDataRec -OpenUserDataRec, *OpenUserDataRecPtr; - -static pascal void NavEventProc( - NavEventCallbackMessage inSelector, - NavCBRecPtr ioParams, - NavCallBackUserData ioUserData); - -#if TARGET_CARBON - static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc); -#else - static NavEventUPP sStandardNavEventFilter = NewNavEventProc(NavEventProc); -#endif - -static pascal void -NavEventProc( - NavEventCallbackMessage inSelector, - NavCBRecPtr ioParams, - NavCallBackUserData ioUserData ) -{ - OpenUserDataRec * data = ( OpenUserDataRec *) ioUserData ; - if (inSelector == kNavCBEvent) { -#if TARGET_CARBON -#else - wxTheApp->MacHandleOneEvent(ioParams->eventData.eventDataParms.event); -#endif - } - else if ( inSelector == kNavCBStart ) - { -#if TARGET_CARBON - if (data && !(data->defaultLocation).IsEmpty()) - { - // Set default location for the modern Navigation APIs - // Apple Technical Q&A 1151 - FSSpec theFSSpec; - wxMacFilename2FSSpec(data->defaultLocation, &theFSSpec); - AEDesc theLocation = {typeNull, NULL}; - if (noErr == ::AECreateDesc(typeFSS, &theFSSpec, sizeof(FSSpec), &theLocation)) - ::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation); - } -#else - if ( data->menuitems ) - NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &(*data->menuitems)[data->currentfilter]); -#endif - } - else if ( inSelector == kNavCBPopupMenuSelect ) - { - NavMenuItemSpec * menu = (NavMenuItemSpec *) ioParams->eventData.eventDataParms.param ; -#if TARGET_CARBON -#else - if ( menu->menuCreator == 'WXNG' ) -#endif - { - data->currentfilter = menu->menuType ; - if ( data->saveMode ) - { - int i = menu->menuType ; - wxString extension = data->extensions[i].AfterLast('.') ; - extension.MakeLower() ; - wxString sfilename ; - -#if TARGET_CARBON - wxMacCFStringHolder cfString( NavDialogGetSaveFileName( ioParams->context ) , false ); - sfilename = cfString.AsString() ; -#else - Str255 filename ; - // get the current filename - NavCustomControl(ioParams->context, kNavCtlGetEditFileName, &filename); - sfilename = wxMacMakeStringFromPascal( filename ) ; -#endif - - int pos = sfilename.Find('.', true) ; - if ( pos != wxNOT_FOUND ) - { - sfilename = sfilename.Left(pos+1)+extension ; -#if TARGET_CARBON - cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ; - NavDialogSetSaveFileName( ioParams->context , cfString ) ; -#else - wxMacStringToPascal( sfilename , filename ) ; - NavCustomControl(ioParams->context, kNavCtlSetEditFileName, &filename); -#endif - } - } - } - } -} - - -void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter ) -{ - myData->menuitems = NULL ; - myData->currentfilter = 0 ; - myData->saveMode = false ; - - if ( filter && filter[0] ) - { - wxString filter2(filter) ; - int filterIndex = 0; - bool isName = true ; - wxString current ; - for( unsigned int i = 0; i < filter2.Len() ; i++ ) - { - if( filter2.GetChar(i) == wxT('|') ) - { - if( isName ) { - myData->name.Add( current ) ; - } - else { - myData->extensions.Add( current.MakeUpper() ) ; - ++filterIndex ; - } - isName = !isName ; - current = wxEmptyString ; - } - else - { - current += filter2.GetChar(i) ; - } - } - // we allow for compatibility reason to have a single filter expression (like *.*) without - // an explanatory text, in that case the first part is name and extension at the same time - - wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ; - if ( current.IsEmpty() ) - myData->extensions.Add( myData->name[filterIndex] ) ; - else - myData->extensions.Add( current.MakeUpper() ) ; - if ( filterIndex == 0 || isName ) - myData->name.Add( current.MakeUpper() ) ; - - ++filterIndex ; - - const size_t extCount = myData->extensions.GetCount(); - for ( size_t i = 0 ; i < extCount; i++ ) - { - wxUint32 fileType; - wxUint32 creator; - wxString extension = myData->extensions[i]; - - if (extension.GetChar(0) == '*') - extension = extension.Mid(1); // Remove leading * - - if (extension.GetChar(0) == '.') - { - extension = extension.Mid(1); // Remove leading . - } - - if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator )) - { - myData->filtermactypes.Add( (OSType)fileType ); - } - else - { - myData->filtermactypes.Add( '****' ) ; // We'll fail safe if it's not recognized - } - } - } -} - -static Boolean CheckFile( const wxString &filename , OSType type , OpenUserDataRecPtr data) -{ - wxString file(filename) ; - file.MakeUpper() ; - - if ( data->extensions.GetCount() > 0 ) - { - //for ( int i = 0 ; i < data->numfilters ; ++i ) - int i = data->currentfilter ; - if ( data->extensions[i].Right(2) == wxT(".*") ) - return true ; - - { - if ( type == (OSType)data->filtermactypes[i] ) - return true ; - - wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ; - while( tokenizer.HasMoreTokens() ) - { - wxString extension = tokenizer.GetNextToken() ; - if ( extension.GetChar(0) == '*' ) - extension = extension.Mid(1) ; - - if ( file.Len() >= extension.Len() && extension == file.Right(extension.Len() ) ) - return true ; - } - } - return false ; - } - return true ; -} - -#ifndef __DARWIN__ -static pascal Boolean CrossPlatformFileFilter(CInfoPBPtr myCInfoPBPtr, void *dataPtr) -{ - OpenUserDataRecPtr data = (OpenUserDataRecPtr) dataPtr ; - // return true if this item is invisible or a file - - Boolean visibleFlag; - Boolean folderFlag; - - visibleFlag = ! (myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible); - folderFlag = (myCInfoPBPtr->hFileInfo.ioFlAttrib & 0x10); - - // because the semantics of the filter proc are "true means don't show - // it" we need to invert the result that we return - - if ( !visibleFlag ) - return true ; - - if ( !folderFlag ) - { - wxString file = wxMacMakeStringFromPascal( myCInfoPBPtr->hFileInfo.ioNamePtr ) ; - return !CheckFile( file , myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdType , data ) ; - } - - return false ; -} -#endif - -// end wxmac - -wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, - const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard, - long style, const wxPoint& pos) - :wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos) -{ - wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ; -} - -pascal Boolean CrossPlatformFilterCallback ( - AEDesc *theItem, - void *info, - void *callBackUD, - NavFilterModes filterMode -) -{ - bool display = true; - OpenUserDataRecPtr data = (OpenUserDataRecPtr) callBackUD ; - - if (filterMode == kNavFilteringBrowserList) - { - NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ; - if ( !theInfo->isFolder ) - { - if (theItem->descriptorType == typeFSS ) - { - FSSpec spec; - memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ; - wxString file = wxMacMakeStringFromPascal( spec.name ) ; - display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; - } - #if TARGET_CARBON - else if ( theItem->descriptorType == typeFSRef ) - { - FSRef fsref ; - memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ; - - - - CFURLRef fullURLRef; - fullURLRef = ::CFURLCreateFromFSRef(NULL, &fsref); -#ifdef __UNIX__ - CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; -#else - CFURLPathStyle pathstyle = kCFURLHFSPathStyle; -#endif - CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); - ::CFRelease( fullURLRef ) ; - wxString file = wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding()); - - display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; - } -#endif - } - } - - return display; -} - -int wxFileDialog::ShowModal() -{ -#if TARGET_CARBON - OSErr err; - NavDialogCreationOptions dialogCreateOptions; - // set default options - ::NavGetDefaultDialogCreationOptions(&dialogCreateOptions); - - // this was always unset in the old code - dialogCreateOptions.optionFlags &= ~kNavSelectDefaultLocation; - - wxMacCFStringHolder message(m_message, m_font.GetEncoding()); - dialogCreateOptions.windowTitle = message; - - wxMacCFStringHolder defaultFileName(m_fileName, m_font.GetEncoding()); - dialogCreateOptions.saveFileName = defaultFileName; - - - NavDialogRef dialog; - NavObjectFilterUPP navFilterUPP = NULL; - CFArrayRef cfArray = NULL; // for popupExtension - OpenUserDataRec myData; - myData.defaultLocation = m_dir; - - if (m_dialogStyle & wxSAVE) - { - dialogCreateOptions.optionFlags |= kNavNoTypePopup; - dialogCreateOptions.optionFlags |= kNavDontAutoTranslate; - dialogCreateOptions.optionFlags |= kNavDontAddTranslateItems; - - // The extension is important - dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension; - - err = ::NavCreatePutFileDialog(&dialogCreateOptions, - 'TEXT', - 'TEXT', - sStandardNavEventFilter, - &myData, // for defaultLocation - &dialog); - } - else - { - MakeUserDataRec(&myData , m_wildCard); - size_t numfilters = myData.extensions.GetCount(); - if (numfilters > 0) - { - CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault , - numfilters , &kCFTypeArrayCallBacks ) ; - dialogCreateOptions.popupExtension = popup ; - myData.menuitems = dialogCreateOptions.popupExtension ; - for ( size_t i = 0 ; i < numfilters ; ++i ) - { - CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] , m_font.GetEncoding() ) ) ; - } - } - - navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback); - err = ::NavCreateGetFileDialog(&dialogCreateOptions, - NULL, // NavTypeListHandle - sStandardNavEventFilter, - NULL, // NavPreviewUPP - navFilterUPP, - (void *) &myData, // inClientData - &dialog); - } - - if (err == noErr) - err = ::NavDialogRun(dialog); - - // clean up filter related data, etc. - if (navFilterUPP) - ::DisposeNavObjectFilterUPP(navFilterUPP); - if (cfArray) - ::CFRelease(cfArray); - - if (err != noErr) - return wxID_CANCEL; - - NavReplyRecord navReply; - err = ::NavDialogGetReply(dialog, &navReply); - if (err == noErr && navReply.validRecord) - { - AEKeyword theKeyword; - DescType actualType; - Size actualSize; - FSRef theFSRef; - wxString thePath ; - long count; - ::AECountItems(&navReply.selection , &count); - for (long i = 1; i <= count; ++i) - { - err = ::AEGetNthPtr(&(navReply.selection), i, typeFSRef, &theKeyword, &actualType, - &theFSRef, sizeof(theFSRef), &actualSize); - if (err != noErr) - break; - - CFURLRef fullURLRef; - if (m_dialogStyle & wxSAVE) - { - CFURLRef parentURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef); - - if (parentURLRef) - { - fullURLRef = - ::CFURLCreateCopyAppendingPathComponent(NULL, - parentURLRef, - navReply.saveFileName, - false); - ::CFRelease(parentURLRef); - } - } - else - { - fullURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef); - } -#ifdef __UNIX__ - CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; -#else - CFURLPathStyle pathstyle = kCFURLHFSPathStyle; -#endif - CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); - thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding()); - if (!thePath) - { - ::NavDisposeReply(&navReply); - return wxID_CANCEL; - } - m_path = thePath; - m_paths.Add(m_path); - m_fileName = wxFileNameFromPath(m_path); - m_fileNames.Add(m_fileName); - } - // set these to the first hit - m_path = m_paths[0]; - m_fileName = wxFileNameFromPath(m_path); - m_dir = wxPathOnly(m_path); - } - ::NavDisposeReply(&navReply); - - return (err == noErr) ? wxID_OK : wxID_CANCEL; -#else // TARGET_CARBON - - NavDialogOptions mNavOptions; - NavObjectFilterUPP mNavFilterUPP = NULL; - NavPreviewUPP mNavPreviewUPP = NULL ; - NavReplyRecord mNavReply; - AEDesc mDefaultLocation ; - bool mSelectDefault = false ; - OSStatus err = noErr ; - // setup dialog - - mNavFilterUPP = nil; - mNavPreviewUPP = nil; - mSelectDefault = false; - mDefaultLocation.descriptorType = typeNull; - mDefaultLocation.dataHandle = nil; - - NavGetDefaultDialogOptions(&mNavOptions); - wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ; - wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ; - - // Set default location, the location - // that's displayed when the dialog - // first appears - - FSSpec location ; - wxMacFilename2FSSpec( m_dir , &location ) ; - - err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation ); - - if ( mDefaultLocation.dataHandle ) - { - if (mSelectDefault) - { - mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; - } else { - mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; - } - } - - memset( &mNavReply , 0 , sizeof( mNavReply ) ) ; - mNavReply.validRecord = false; - mNavReply.replacing = false; - mNavReply.isStationery = false; - mNavReply.translationNeeded = false; - mNavReply.selection.descriptorType = typeNull; - mNavReply.selection.dataHandle = nil; - mNavReply.keyScript = smSystemScript; - mNavReply.fileTranslation = nil; - mNavReply.version = kNavReplyRecordVersion ; - - // zero all data - - m_path = wxEmptyString ; - m_fileName = wxEmptyString ; - m_paths.Empty(); - m_fileNames.Empty(); - - OpenUserDataRec myData; - MakeUserDataRec( &myData , m_wildCard ) ; - myData.currentfilter = m_filterIndex ; - if ( myData.extensions.GetCount() > 0 ) - { - mNavOptions.popupExtension = (NavMenuItemSpecArrayHandle) NewHandle( sizeof( NavMenuItemSpec ) * myData.extensions.GetCount() ) ; - myData.menuitems = mNavOptions.popupExtension ; - for ( size_t i = 0 ; i < myData.extensions.GetCount() ; ++i ) - { - (*mNavOptions.popupExtension)[i].version = kNavMenuItemSpecVersion ; - (*mNavOptions.popupExtension)[i].menuCreator = 'WXNG' ; - // TODO : according to the new docs -1 to 10 are reserved for the OS - (*mNavOptions.popupExtension)[i].menuType = i ; - wxMacStringToPascal( myData.name[i] , (StringPtr)(*mNavOptions.popupExtension)[i].menuItemName ) ; - } - } - if ( m_dialogStyle & wxSAVE ) - { - myData.saveMode = true ; - - mNavOptions.dialogOptionFlags |= kNavDontAutoTranslate ; - mNavOptions.dialogOptionFlags |= kNavDontAddTranslateItems ; - - err = ::NavPutFile( - &mDefaultLocation, - &mNavReply, - &mNavOptions, - sStandardNavEventFilter , - NULL, - kNavGenericSignature, - &myData); // User Data - m_filterIndex = myData.currentfilter ; - } - else - { - myData.saveMode = false ; - - mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ; - if ( m_dialogStyle & wxMULTIPLE ) - mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ; - else - mNavOptions.dialogOptionFlags &= ~kNavAllowMultipleFiles ; - - err = ::NavGetFile( - &mDefaultLocation, - &mNavReply, - &mNavOptions, - sStandardNavEventFilter , - mNavPreviewUPP, - mNavFilterUPP, - NULL , - &myData); - m_filterIndex = myData.currentfilter ; - } - - DisposeNavObjectFilterUPP(mNavFilterUPP); - if ( mDefaultLocation.dataHandle != nil ) - { - ::AEDisposeDesc(&mDefaultLocation); - } - - if ( (err != noErr) && (err != userCanceledErr) ) { - return wxID_CANCEL ; - } - - if (mNavReply.validRecord) - { - FSSpec outFileSpec ; - AEDesc specDesc ; - AEKeyword keyWord ; - - long count ; - ::AECountItems( &mNavReply.selection , &count ) ; - for ( long i = 1 ; i <= count ; ++i ) - { - OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc); - if ( err != noErr ) - { - m_path = wxT("") ; - return wxID_CANCEL ; - } - outFileSpec = **(FSSpec**) specDesc.dataHandle; - if (specDesc.dataHandle != nil) { - ::AEDisposeDesc(&specDesc); - } - m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ; - - m_paths.Add( m_path ) ; - m_fileName = wxFileNameFromPath(m_path); - m_fileNames.Add(m_fileName); - } - // set these to the first hit - m_path = m_paths[ 0 ] ; - m_fileName = wxFileNameFromPath(m_path); - m_dir = wxPathOnly(m_path); - NavDisposeReply( &mNavReply ) ; - return wxID_OK ; - } - return wxID_CANCEL; -#endif // TARGET_CARBON -} - diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp deleted file mode 100644 index ef0ecc73b6..0000000000 --- a/src/mac/carbon/font.cpp +++ /dev/null @@ -1,446 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: font.cpp -// Purpose: wxFont class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "font.h" -#endif - -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/font.h" -#include "wx/fontutil.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" - -#include "wx/fontutil.h" - -#include "wx/mac/private.h" -#include - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -#endif - -class WXDLLEXPORT wxFontRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxFont; -public: - wxFontRefData() - : m_fontId(0) - , m_pointSize(10) - , m_family(wxDEFAULT) - , m_style(wxNORMAL) - , m_weight(wxNORMAL) - , m_underlined(FALSE) - , m_faceName(wxT("Geneva")) - , m_encoding(wxFONTENCODING_DEFAULT) - , m_macFontNum(0) - , m_macFontSize(0) - , m_macFontStyle(0) - , m_macATSUFontID() - { - Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE, - wxT("Geneva"), wxFONTENCODING_DEFAULT); - } - - wxFontRefData(const wxFontRefData& data) - : wxGDIRefData() - , m_fontId(data.m_fontId) - , m_pointSize(data.m_pointSize) - , m_family(data.m_family) - , m_style(data.m_style) - , m_weight(data.m_weight) - , m_underlined(data.m_underlined) - , m_faceName(data.m_faceName) - , m_encoding(data.m_encoding) - , m_macFontNum(data.m_macFontNum) - , m_macFontSize(data.m_macFontSize) - , m_macFontStyle(data.m_macFontStyle) - , m_macATSUFontID(data.m_macATSUFontID) - { - Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight, - data.m_underlined, data.m_faceName, data.m_encoding); - } - - wxFontRefData(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) - : m_fontId(0) - , m_pointSize(size) - , m_family(family) - , m_style(style) - , m_weight(weight) - , m_underlined(underlined) - , m_faceName(faceName) - , m_encoding(encoding) - , m_macFontNum(0) - , m_macFontSize(0) - , m_macFontStyle(0) - , m_macATSUFontID(0) - { - Init(size, family, style, weight, underlined, faceName, encoding); - } - - virtual ~wxFontRefData(); - void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; } - bool GetNoAntiAliasing() { return m_noAA; } - -protected: - // common part of all ctors - void Init(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding); - - // font characterstics - int m_fontId; - int m_pointSize; - int m_family; - int m_style; - int m_weight; - bool m_underlined; - wxString m_faceName; - wxFontEncoding m_encoding; - bool m_noAA; // No anti-aliasing - -public: - short m_macFontNum; - short m_macFontSize; - unsigned char m_macFontStyle; - wxUint32 m_macATSUFontID; - - wxNativeFontInfo m_info; - -public: - void MacFindFont() ; -}; -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontRefData -// ---------------------------------------------------------------------------- - -void wxFontRefData::Init(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) -{ - m_style = style; - m_pointSize = pointSize; - m_family = family; - m_style = style; - m_weight = weight; - m_underlined = underlined; - m_faceName = faceName; - m_encoding = encoding; - - m_macFontNum = 0 ; - m_macFontSize = 0; - m_macFontStyle = 0; - m_fontId = 0; - m_noAA = FALSE; -} - -wxFontRefData::~wxFontRefData() -{ -} - -void wxFontRefData::MacFindFont() -{ - if( m_faceName.Length() == 0 ) - { - switch( m_family ) - { - case wxDEFAULT : - m_macFontNum = ::GetAppFont() ; - break ; - case wxDECORATIVE : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxROMAN : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxSCRIPT : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxSWISS : - ::GetFNum( "\pGeneva" , &m_macFontNum) ; - break ; - case wxMODERN : - ::GetFNum( "\pMonaco" , &m_macFontNum) ; - break ; - } - Str255 name ; - GetFontName( m_macFontNum , name ) ; - m_faceName = wxMacMakeStringFromPascal( name ) ; - } - else - { - if ( m_faceName == wxT("systemfont") ) - m_macFontNum = ::GetSysFont() ; - else if ( m_faceName == wxT("applicationfont") ) - m_macFontNum = ::GetAppFont() ; - else - { - Str255 fontname ; - wxMacStringToPascal( m_faceName , fontname ) ; - ::GetFNum( fontname, &m_macFontNum); - } - } - - m_macFontStyle = 0; - if (m_weight == wxBOLD) - m_macFontStyle |= bold; - if (m_style == wxITALIC || m_style == wxSLANT) - m_macFontStyle |= italic; - if (m_underlined) - m_macFontStyle |= underline; - m_macFontSize = m_pointSize ; - - //TODO:if we supply the style as an additional parameter we must make a testing - //sequence in order to degrade gracefully while trying to maintain most of the style - //information, meanwhile we just take the normal font and apply the features after -#ifdef __WXDEBUG__ - OSStatus status = -#endif // __WXDEBUG__ - ::ATSUFONDtoFontID(m_macFontNum, normal /*qdStyle*/, (UInt32*)&m_macATSUFontID); - /* - status = ATSUFindFontFromName ( (Ptr) m_faceName , strlen( m_faceName ) , - kFontFullName, kFontMacintoshPlatform, kFontRomanScript , kFontNoLanguage , (UInt32*)&m_macATSUFontID ) ; - */ - wxASSERT_MSG( status == noErr , wxT("couldn't retrieve font identifier") ) ; -} - -// ---------------------------------------------------------------------------- -// wxFont -// ---------------------------------------------------------------------------- - -void wxFont::Init() -{ -} - -bool wxFont::Create(const wxNativeFontInfo& info) -{ - return Create(info.pointSize, info.family, info.style, info.weight, - info.underlined, info.faceName, info.encoding); -} - -wxFont::wxFont(const wxString& fontdesc) -{ - wxNativeFontInfo info; - if ( info.FromString(fontdesc) ) - (void)Create(info); -} - -bool wxFont::Create(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) -{ - UnRef(); - m_refData = new wxFontRefData(pointSize, family, style, weight, - underlined, faceName, encoding); - - RealizeResource(); - - return TRUE; -} - -wxFont::~wxFont() -{ -} - -bool wxFont::RealizeResource() -{ - M_FONTDATA->MacFindFont() ; - return TRUE; -} - -void wxFont::SetEncoding(wxFontEncoding encoding) -{ - Unshare(); - - M_FONTDATA->m_encoding = encoding; - - RealizeResource(); -} - -void wxFont::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxFontRefData(); - } - else - { - wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxFont::SetPointSize(int pointSize) -{ - Unshare(); - - M_FONTDATA->m_pointSize = pointSize; - - RealizeResource(); -} - -void wxFont::SetFamily(int family) -{ - Unshare(); - - M_FONTDATA->m_family = family; - - RealizeResource(); -} - -void wxFont::SetStyle(int style) -{ - Unshare(); - - M_FONTDATA->m_style = style; - - RealizeResource(); -} - -void wxFont::SetWeight(int weight) -{ - Unshare(); - - M_FONTDATA->m_weight = weight; - - RealizeResource(); -} - -void wxFont::SetFaceName(const wxString& faceName) -{ - Unshare(); - - M_FONTDATA->m_faceName = faceName; - - RealizeResource(); -} - -void wxFont::SetUnderlined(bool underlined) -{ - Unshare(); - - M_FONTDATA->m_underlined = underlined; - - RealizeResource(); -} - -void wxFont::SetNoAntiAliasing( bool no ) -{ - Unshare(); - - M_FONTDATA->SetNoAntiAliasing( no ); - - RealizeResource(); -} - -// ---------------------------------------------------------------------------- -// accessors -// ---------------------------------------------------------------------------- - -// TODO: insert checks everywhere for M_FONTDATA == NULL! - -int wxFont::GetPointSize() const -{ - return M_FONTDATA->m_pointSize; -} - -int wxFont::GetFamily() const -{ - return M_FONTDATA->m_family; -} - -int wxFont::GetStyle() const -{ - return M_FONTDATA->m_style; -} - -int wxFont::GetWeight() const -{ - return M_FONTDATA->m_weight; -} - -bool wxFont::GetUnderlined() const -{ - return M_FONTDATA->m_underlined; -} - -wxString wxFont::GetFaceName() const -{ - wxString str; - if ( M_FONTDATA ) - str = M_FONTDATA->m_faceName ; - return str; -} - -wxFontEncoding wxFont::GetEncoding() const -{ - return M_FONTDATA->m_encoding; -} - -bool wxFont::GetNoAntiAliasing() -{ - return M_FONTDATA->m_noAA; -} - -short wxFont::GetMacFontNum() const -{ - return M_FONTDATA->m_macFontNum; -} - -short wxFont::GetMacFontSize() const -{ - return M_FONTDATA->m_macFontSize; -} - -wxByte wxFont::GetMacFontStyle() const -{ - return M_FONTDATA->m_macFontStyle; -} - -wxUint32 wxFont::GetMacATSUFontID() const -{ - return M_FONTDATA->m_macATSUFontID; -} - -const wxNativeFontInfo *wxFont::GetNativeFontInfo() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); - - M_FONTDATA->m_info.InitFromFont(*this); - - return &(M_FONTDATA->m_info); -} - diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp deleted file mode 100644 index 03c894c553..0000000000 --- a/src/mac/carbon/fontdlg.cpp +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.cpp -// Purpose: wxFontDialog class. NOTE: you can use the generic class -// if you wish, instead of implementing this. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "fontdlg.h" -#endif - -#include "wx/mac/fontdlg.h" -#include "wx/cmndata.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) -#endif - -/* - * wxFontDialog - */ - -wxFontDialog::wxFontDialog() -{ - m_dialogParent = NULL; -} - -wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData& data) -{ - Create(parent, data); -} - -bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) -{ - m_dialogParent = parent; - - m_fontData = data; - - // TODO: you may need to do dialog creation here, unless it's - // done in ShowModal. - return TRUE; -} - -int wxFontDialog::ShowModal() -{ - // TODO: show (maybe create) the dialog - return wxID_CANCEL; -} - diff --git a/src/mac/carbon/fontenum.cpp b/src/mac/carbon/fontenum.cpp deleted file mode 100644 index 467bc95442..0000000000 --- a/src/mac/carbon/fontenum.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/fontenum.cpp -// Purpose: wxFontEnumerator class for MacOS -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "fontenum.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/font.h" -#endif - -#include "wx/fontenum.h" -#include "wx/fontutil.h" -#include "wx/fontmap.h" -#include "wx/fontutil.h" -#include "wx/encinfo.h" - -#include "wx/mac/private.h" - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxFontEnumeratorHelper -{ -public: - wxFontEnumeratorHelper(wxFontEnumerator *fontEnum); - - // control what exactly are we enumerating - bool SetEncoding(wxFontEncoding encoding); - void SetFixedOnly(bool fixedOnly) - { m_fixedOnly = fixedOnly; } - - // call to start enumeration - void DoEnumerate(); - -private: - // the object we forward calls to OnFont() to - wxFontEnumerator *m_fontEnum; - - // if != -1, enum only fonts which have this encoding - int m_charset; - - // if not empty, enum only the fonts with this facename - wxString m_facename; - - // if TRUE, enum only fixed fonts - bool m_fixedOnly; -}; -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontEnumeratorHelper -// ---------------------------------------------------------------------------- - -wxFontEnumeratorHelper::wxFontEnumeratorHelper(wxFontEnumerator *fontEnum) -{ - m_fontEnum = fontEnum; - m_charset = -1; - m_fixedOnly = FALSE; -} - -bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) -{ - wxNativeEncodingInfo info; - if ( !wxGetNativeFontEncoding(encoding, &info) ) - { - if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) - { - // no such encodings at all - return FALSE; - } - } - m_charset = info.charset; - m_facename = info.facename; - - return TRUE; -} - -void wxFontEnumeratorHelper::DoEnumerate() -{ - MenuHandle menu ; - Str255 p_name ; - - short lines ; - - menu = NewMenu( 32000 , "\pFont" ) ; - AppendResMenu( menu , 'FONT' ) ; - lines = CountMenuItems( menu ) ; - - for ( int i = 1 ; i < lines+1 ; i ++ ) - { - GetMenuItemText( menu , i , p_name ) ; - wxString c_name = wxMacMakeStringFromPascal(p_name) ; - - /* - - if ( m_fixedOnly ) - { - // check that it's a fixed pitch font (there is *no* error here, the - // flag name is misleading!) - if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) - { - // not a fixed pitch font - return TRUE; - } - } - - if ( m_charset != -1 ) - { - // check that we have the right encoding - if ( lf->lfCharSet != m_charset ) - { - return TRUE; - } - } - - */ - m_fontEnum->OnFacename( c_name ) ; - } - DisposeMenu( menu ) ; -} - -// ---------------------------------------------------------------------------- -// wxFontEnumerator -// ---------------------------------------------------------------------------- - -bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, - bool fixedWidthOnly) -{ - wxFontEnumeratorHelper fe(this); - if ( fe.SetEncoding(encoding) ) - { - fe.SetFixedOnly(fixedWidthOnly); - - fe.DoEnumerate(); - } - // else: no such fonts, unknown encoding - - return TRUE; -} - -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) -{ - wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented")); - - return TRUE; -} diff --git a/src/mac/carbon/fontutil.cpp b/src/mac/carbon/fontutil.cpp deleted file mode 100644 index 1aa2298245..0000000000 --- a/src/mac/carbon/fontutil.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/fontutil.cpp -// Purpose: font-related helper functions for wxMSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.11.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "fontutil.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include "wx/fontutil.h" -#include "wx/fontmap.h" -#include "wx/encinfo.h" - -#include "wx/tokenzr.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNativeEncodingInfo -// ---------------------------------------------------------------------------- - -// convert to/from the string representation: format is -// facename[;charset] - -bool wxNativeEncodingInfo::FromString(const wxString& s) -{ - wxStringTokenizer tokenizer(s, _T(";")); - - facename = tokenizer.GetNextToken(); - if ( !facename ) - return FALSE; - - wxString tmp = tokenizer.GetNextToken(); - if ( !tmp ) - { - // default charset (don't use DEFAULT_CHARSET though because of subtle - // Windows 9x/NT differences in handling it) - charset = 0; - } - else - { - if ( wxSscanf(tmp, _T("%u"), &charset) != 1 ) - { - // should be a number! - return FALSE; - } - } - - return TRUE; -} - -wxString wxNativeEncodingInfo::ToString() const -{ - wxString s(facename); - if ( charset != 0 ) - { - s << _T(';') << charset; - } - - return s; -} - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -bool wxGetNativeFontEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info) -{ - wxCHECK_MSG( info, FALSE, _T("bad pointer in wxGetNativeFontEncoding") ); - - if ( encoding == wxFONTENCODING_DEFAULT ) - { - encoding = wxFont::GetDefaultEncoding(); - } - - info->encoding = encoding ; - - return TRUE; -} - -bool wxTestFontEncoding(const wxNativeEncodingInfo& info) -{ - // basically we should be able to support every encoding via the OS - return true ; -} - - diff --git a/src/mac/carbon/frame.cpp b/src/mac/carbon/frame.cpp deleted file mode 100644 index b56f24712b..0000000000 --- a/src/mac/carbon/frame.cpp +++ /dev/null @@ -1,338 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp -// Purpose: wxFrame -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "frame.h" -#endif - -#include "wx/frame.h" -#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" - -#include "wx/mac/uma.h" - -extern wxWindowList wxModelessWindows; -extern wxList wxPendingDelete; - -#if !USE_SHARED_LIBRARY -BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) - EVT_ACTIVATE(wxFrame::OnActivate) - // EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) -// EVT_IDLE(wxFrame::OnIdle) -// EVT_CLOSE(wxFrame::OnCloseWindow) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) -#endif - -#define WX_MAC_STATUSBAR_HEIGHT 15 -// ---------------------------------------------------------------------------- -// creation/destruction -// ---------------------------------------------------------------------------- - -void wxFrame::Init() -{ - m_frameMenuBar = NULL; - -#if wxUSE_TOOLBAR - m_frameToolBar = NULL ; -#endif - m_frameStatusBar = NULL; - m_winLastFocused = NULL ; - - m_iconized = FALSE; - -#if wxUSE_TOOLTIPS - m_hwndToolTip = 0; -#endif -} - -wxPoint wxFrame::GetClientAreaOrigin() const -{ - // on mac we are at position -1,-1 with the control - wxPoint pt(0, 0); - -#if wxUSE_TOOLBAR - if ( GetToolBar() ) - { - int w, h; - GetToolBar()->GetSize(& w, & h); - - if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL ) - { - pt.x += w - 1; - } - else - { - pt.y += h - 1 ; - } - } -#endif // wxUSE_TOOLBAR - - return pt; -} - -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; - - MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - wxModelessWindows.Append(this); - - return TRUE; -} - -wxFrame::~wxFrame() -{ - m_isBeingDeleted = TRUE; - DeleteAllBars(); -} - - -bool wxFrame::Enable(bool enable) -{ - if ( !wxWindow::Enable(enable) ) - return FALSE; - - if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) - { - int iMaxMenu = m_frameMenuBar->GetMenuCount(); - for ( int i = 0 ; i < iMaxMenu ; ++ i ) - { - m_frameMenuBar->EnableTop( i , enable ) ; - } - } - - return TRUE; -} - -wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - wxStatusBar *statusBar = NULL; - - statusBar = new wxStatusBar(this, id, - style, name); - statusBar->SetSize( 100 , 15 ) ; - statusBar->SetFieldsCount(number); - return statusBar; -} - -void wxFrame::PositionStatusBar() -{ - if (m_frameStatusBar ) - { - int w, h; - GetClientSize(&w, &h); - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - - // Since we wish the status bar to be directly under the client area, - // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. - m_frameStatusBar->SetSize(0, h, w, sh); - } -} - -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - Refresh(); - - if ( m_frameStatusBar ) - { - wxSysColourChangedEvent event2; - event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->ProcessEvent(event2); - } - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - - -// Default activation behaviour - set the focus for the first child -// subwindow found. -void wxFrame::OnActivate(wxActivateEvent& event) -{ - if ( !event.GetActive() ) - { - // remember the last focused child if it is our child - m_winLastFocused = FindFocus(); - - // so we NULL it out if it's a child from some other frame - wxWindow *win = m_winLastFocused; - while ( win ) - { - if ( win->IsTopLevel() ) - { - if ( win != this ) - { - m_winLastFocused = NULL; - } - - break; - } - - win = win->GetParent(); - } - - event.Skip(); - } - else - { - // restore focus to the child which was last focused - wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent() - : NULL; - if ( !parent ) - { - parent = this; - } - - wxSetFocusToChild(parent, &m_winLastFocused); - - if ( m_frameMenuBar != NULL ) - { - m_frameMenuBar->MacInstallMenuBar() ; - } - else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame))) - { - // Trying toplevel frame menbar - if( ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar() ) - ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar(); - } - } -} - -void wxFrame::DetachMenuBar() -{ - if ( m_frameMenuBar ) - { - m_frameMenuBar->UnsetInvokingWindow(); - } - - wxFrameBase::DetachMenuBar(); -} - -void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) -{ - wxFrameBase::AttachMenuBar(menuBar); - - if (m_frameMenuBar) - { - m_frameMenuBar->SetInvokingWindow( this ); - } -} - -void wxFrame::DoGetClientSize(int *x, int *y) const -{ - wxWindow::DoGetClientSize( x , y ) ; - -#if wxUSE_STATUSBAR - if ( GetStatusBar() && y ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - *y -= statusY; - } -#endif // wxUSE_STATUSBAR - - wxPoint pt(GetClientAreaOrigin()); - if ( y ) - *y -= pt.y; - if ( x ) - *x -= pt.x; -} - -void wxFrame::DoSetClientSize(int clientwidth, int clientheight) -{ - int currentclientwidth , currentclientheight ; - int currentwidth , currentheight ; - - GetClientSize( ¤tclientwidth , ¤tclientheight ) ; - GetSize( ¤twidth , ¤theight ) ; - - // find the current client size - - // Find the difference between the entire window (title bar and all) - // and the client area; add this to the new client size to move the - // window - - DoSetSize( -1 , -1 , currentwidth + clientwidth - currentclientwidth , - currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ; -} - - -#if wxUSE_TOOLBAR -wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) -{ - if ( wxFrameBase::CreateToolBar(style, id, name) ) - { - PositionToolBar(); - } - - return m_frameToolBar; -} - -void wxFrame::PositionToolBar() -{ - int cw, ch; - - cw = m_width ; - ch = m_height ; - - if ( GetStatusBar() ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - ch -= statusY; - } - - if (GetToolBar()) - { - int tw, th; - GetToolBar()->GetSize(& tw, & th); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - // Use the 'real' position. wxSIZE_NO_ADJUSTMENTS - // means, pretend we don't have toolbar/status bar, so we - // have the original client size. - GetToolBar()->SetSize(-1, -1, tw, ch + 2 , wxSIZE_NO_ADJUSTMENTS | wxSIZE_ALLOW_MINUS_ONE ); - } - else - { - // Use the 'real' position - GetToolBar()->SetSize(-1, -1, cw + 2, th, wxSIZE_NO_ADJUSTMENTS | wxSIZE_ALLOW_MINUS_ONE ); - } - } -} -#endif diff --git a/src/mac/carbon/gauge.cpp b/src/mac/carbon/gauge.cpp deleted file mode 100644 index 01a557e17c..0000000000 --- a/src/mac/carbon/gauge.cpp +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp -// Purpose: wxGauge class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gauge.h" -#endif - -#include "wx/gauge.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) -#endif - -#include "wx/mac/uma.h" - -bool wxGauge::Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos, - const wxSize& s, - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) ) - return false; - - wxSize size = s ; - Rect bounds ; - Str255 title ; - m_rangeMax = range ; - m_gaugePos = 0 ; - - if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y) - { - size = wxSize( 200 , 16 ) ; - } - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range, - kControlProgressBarProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxGauge::SetShadowWidth(int w) -{ -} - -void wxGauge::SetBezelFace(int w) -{ -} - -void wxGauge::SetRange(int r) -{ - m_rangeMax = r; - ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ; -} - -void wxGauge::SetValue(int pos) -{ - m_gaugePos = pos; - ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ; -} - -int wxGauge::GetShadowWidth() const -{ - return 0; -} - -int wxGauge::GetBezelFace() const -{ - return 0; -} - -int wxGauge::GetRange() const -{ - return m_rangeMax; -} - -int wxGauge::GetValue() const -{ - return m_gaugePos; -} - diff --git a/src/mac/carbon/gdiobj.cpp b/src/mac/carbon/gdiobj.cpp deleted file mode 100644 index 528c5a7efe..0000000000 --- a/src/mac/carbon/gdiobj.cpp +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp -// Purpose: wxGDIObject class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif - -#include "wx/gdiobj.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) -#endif - -// TODO: Nothing to do, unless you want to. diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp deleted file mode 100644 index e208531ff4..0000000000 --- a/src/mac/carbon/glcanvas.cpp +++ /dev/null @@ -1,385 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: glcanvas.cpp -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "glcanvas.h" -#endif - -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - -#include "wx/setup.h" - -#if wxUSE_GLCANVAS - -#ifndef WX_PRECOMP -#include "wx/frame.h" -#endif - -#include "wx/settings.h" -#include "wx/log.h" - -#include "wx/glcanvas.h" -#include "wx/mac/uma.h" - -// DLL options compatibility check: -#include "wx/build.h" -WX_CHECK_BUILD_OPTIONS("wxGL") - -/* -* GLContext implementation -*/ - -wxGLContext::wxGLContext( - AGLPixelFormat fmt, wxGLCanvas *win, - const wxPalette& palette, - const wxGLContext *other /* for sharing display lists */ - ) -{ - m_window = win; - - m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow())); - - m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL); - wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") ); - - GLboolean b; - b = aglSetDrawable(m_glContext, m_drawable); - wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") ); - aglEnable(m_glContext , AGL_BUFFER_RECT ) ; - b = aglSetCurrentContext(m_glContext); - wxCHECK_RET( b, wxT("Couldn't activate OpenGl context") ); -} - -wxGLContext::~wxGLContext() -{ - if (m_glContext) - { - aglSetCurrentContext(NULL); - aglDestroyContext(m_glContext); - } -} - -void wxGLContext::SwapBuffers() -{ - if (m_glContext) - { - aglSwapBuffers(m_glContext); - } -} - -void wxGLContext::SetCurrent() -{ - if (m_glContext) - { - aglSetCurrentContext(m_glContext); - } -} - -void wxGLContext::Update() -{ - if (m_glContext) - { - aglUpdateContext(m_glContext); - } -} - -void wxGLContext::SetColour(const wxChar *colour) -{ - wxColour col = wxTheColourDatabase->Find(colour); - if (col.Ok()) - { - float r = (float)(col.Red()/256.0); - float g = (float)(col.Green()/256.0); - float b = (float)(col.Blue()/256.0); - glColor3f( r, g, b); - } -} - - -/* -* wxGLCanvas implementation -*/ - -IMPLEMENT_CLASS(wxGLCanvas, wxWindow) - -BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow) - EVT_SIZE(wxGLCanvas::OnSize) -END_EVENT_TABLE() - -wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette) -{ - Create(parent, NULL, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::wxGLCanvas( wxWindow *parent, - const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette ) -{ - Create(parent, shared, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette ) -{ - Create(parent, shared ? shared->GetContext() : NULL, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::~wxGLCanvas() -{ - if (m_glContext != NULL) { - delete m_glContext; - m_glContext = NULL; - } -} - -static AGLPixelFormat ChoosePixelFormat(const int *attribList) -{ - GLint data[512]; - GLint defaultAttribs[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_MINIMUM_POLICY, - AGL_DEPTH_SIZE, 1, // use largest available depth buffer - AGL_RED_SIZE, 1, - AGL_GREEN_SIZE, 1, - AGL_BLUE_SIZE, 1, - AGL_ALPHA_SIZE, 0, - AGL_NONE }; - GLint *attribs; - if (!attribList) - { - attribs = defaultAttribs; - } - else - { - int arg=0, p=0; - - data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX - while( (attribList[arg]!=0) && (p<512) ) - { - switch( attribList[arg++] ) - { - case WX_GL_RGBA: data[p++] = AGL_RGBA; break; - case WX_GL_BUFFER_SIZE: - data[p++]=AGL_BUFFER_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_LEVEL: - data[p++]=AGL_LEVEL; data[p++]=attribList[arg++]; break; - case WX_GL_DOUBLEBUFFER: data[p++] = AGL_DOUBLEBUFFER; break; - case WX_GL_STEREO: data[p++] = AGL_STEREO; break; - case WX_GL_AUX_BUFFERS: - data[p++]=AGL_AUX_BUFFERS; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_RED: - data[p++]=AGL_RED_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_GREEN: - data[p++]=AGL_GREEN_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_BLUE: - data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ALPHA: - data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_DEPTH_SIZE: - data[p++]=AGL_DEPTH_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_STENCIL_SIZE: - data[p++]=AGL_STENCIL_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_RED: - data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_GREEN: - data[p++]=AGL_ACCUM_GREEN_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_BLUE: - data[p++]=AGL_ACCUM_BLUE_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_ALPHA: - data[p++]=AGL_ACCUM_ALPHA_SIZE; data[p++]=attribList[arg++]; break; - default: - break; - } - } - data[p] = 0; - - attribs = data; - } - - return aglChoosePixelFormat(NULL, 0, attribs); -} - -bool wxGLCanvas::Create(wxWindow *parent, const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette) -{ - wxWindow::Create( parent, id, pos, size, style, name ); - - AGLPixelFormat fmt = ChoosePixelFormat(attribList); - wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") ); - - m_glContext = new wxGLContext(fmt, this, palette, shared); - m_macCanvasIsShown = true ; - aglDestroyPixelFormat(fmt); - - return true; -} - -void wxGLCanvas::SwapBuffers() -{ - if (m_glContext) - m_glContext->SwapBuffers(); -} - -void wxGLCanvas::UpdateContext() -{ - if (m_glContext) - m_glContext->Update(); -} - -void wxGLCanvas::SetViewport() -{ - // viewport is initially set to entire port - // adjust glViewport to just this window - int x = 0 ; - int y = 0 ; - - wxWindow* iter = this ; - while( iter->GetParent() ) - { - iter = iter->GetParent() ; - } - - if ( iter && iter->IsTopLevel() ) - { - MacClientToRootWindow( &x , &y ) ; - int width, height; - GetClientSize(& width, & height); - Rect bounds ; - GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ; - GLint parms[4] ; - parms[0] = x ; - parms[1] = bounds.bottom - bounds.top - ( y + height ) ; - parms[2] = width ; - parms[3] = height ; - - if ( !m_macCanvasIsShown ) - parms[0] += 20000 ; - aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ; - } -} - -void wxGLCanvas::OnSize(wxSizeEvent& event) -{ - MacUpdateView() ; -} - -void wxGLCanvas::MacUpdateView() -{ - if (m_glContext) - { - UpdateContext(); - m_glContext->SetCurrent(); - SetViewport(); - } -} - -void wxGLCanvas::MacSuperChangedPosition() -{ - MacUpdateView() ; - wxWindow::MacSuperChangedPosition() ; -} - -void wxGLCanvas::MacTopLevelWindowChangedPosition() -{ - MacUpdateView() ; - wxWindow::MacTopLevelWindowChangedPosition() ; -} - -void wxGLCanvas::SetCurrent() -{ - if (m_glContext) - { - m_glContext->SetCurrent(); - } -} - -void wxGLCanvas::SetColour(const wxChar *colour) -{ - if (m_glContext) - m_glContext->SetColour(colour); -} - -bool wxGLCanvas::Show(bool show) -{ - if ( !wxWindow::Show( show ) ) - return FALSE ; - - if ( !show ) - { - if ( m_macCanvasIsShown ) - { - m_macCanvasIsShown = false ; - SetViewport() ; - } - } - else - { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) - { - m_macCanvasIsShown = true ; - SetViewport() ; - } - } - return TRUE ; -} - -void wxGLCanvas::MacSuperShown( bool show ) -{ - if ( !show ) - { - if ( m_macCanvasIsShown ) - { - m_macCanvasIsShown = false ; - SetViewport() ; - } - } - else - { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) - { - m_macCanvasIsShown = true ; - SetViewport() ; - } - } - - wxWindow::MacSuperShown( show ) ; -} - -//--------------------------------------------------------------------------- -// wxGLApp -//--------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxGLApp, wxApp) - -bool wxGLApp::InitGLVisual(int *attribList) -{ - AGLPixelFormat fmt = ChoosePixelFormat(attribList); - if (fmt != NULL) { - aglDestroyPixelFormat(fmt); - return true; - } else - return false; -} - -wxGLApp::~wxGLApp(void) -{ -} - -#endif // wxUSE_GLCANVAS diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c deleted file mode 100644 index 9e3ba3079a..0000000000 --- a/src/mac/carbon/gsocket.c +++ /dev/null @@ -1,1653 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsocket.c - * Authors: Guilhem Lavaux, - * Guillermo Rodriguez Garcia (maintainer) - * Stefan CSomor - * Purpose: GSocket main mac file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -/* - * PLEASE don't put C++ comments here - this is a C source file. - */ - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/setup.h" -#include "wx/platform.h" -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#ifdef __DARWIN__ - #include - - #ifndef FALSE - #define FALSE 0 - #endif - #ifndef TRUE - #define TRUE 1 - #endif -#else - #include - #define OTUNIXERRORS 1 - #include - #include - #include -#endif -#if TARGET_CARBON && !defined(OTAssert) - #define OTAssert( str , cond ) /* does not exists in Carbon */ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * INADDR_BROADCAST is identical to INADDR_NONE which is not defined - * on all unices. INADDR_BROADCAST should be fine to indicate an error. - */ -#ifndef INADDR_BROADCAST -#define INADDR_BROADCAST 0xFFFFFFFFUL -#endif -#ifndef INADDR_NONE -#define INADDR_NONE INADDR_BROADCAST -#endif -#ifndef INADDR_ANY -#define INADDR_ANY 0x0UL -#endif -#ifndef __GSOCKET_STANDALONE__ - -#include "wx/mac/macnotfy.h" -#include "wx/mac/gsockmac.h" -#include "wx/gsocket.h" - -#else - -#include "gsockmac.h" -#include "gsocket.h" - -#endif /* __GSOCKET_STANDALONE__ */ - -void wxCYield() ; -#ifdef __WXDEBUG__ -#define qDebug 1 -#define qDebug2 1 -extern pascal void OTDebugStr(const char* str); -#endif -#ifndef __DARWIN__ - #include -#endif -InetSvcRef gInetSvcRef = 0 ; -int gOTInited = 0 ; -OTNotifyUPP gOTNotifierUPP = NULL ; - -OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode); - -/* Input: ep - endpointref on which to negotiate the option - enableReuseIPMode - desired option setting - true/false - Return: kOTNoError indicates that the option was successfully negotiated - OSStatus is an error if < 0, otherwise, the status field is - returned and is > 0. - - IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise - this code will not function as desired -*/ - - -OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode) - -{ - UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size - TOption* opt; // option ptr to make items easier to access - TOptMgmt req; - TOptMgmt ret; - OSStatus err; - - if (!OTIsSynchronous(ep)) - { - return (-1); - } - opt = (TOption*)buf; // set option ptr to buffer - req.opt.buf = buf; - req.opt.len = sizeof(buf); - req.flags = T_NEGOTIATE; // negotiate for option - - ret.opt.buf = buf; - ret.opt.maxlen = kOTFourByteOptionSize; - - opt->level = INET_IP; // dealing with an IP Level function -#ifdef __DARWIN__ - opt->name = kIP_REUSEADDR; -#else - opt->name = IP_REUSEADDR; -#endif - opt->len = kOTFourByteOptionSize; - opt->status = 0; - *(UInt32*)opt->value = enableReuseIPMode; // set the desired option level, true or false - - err = OTOptionManagement(ep, &req, &ret); - - // if no error then return the option status value - if (err == kOTNoError) - { - if (opt->status != T_SUCCESS) - err = opt->status; - else - err = kOTNoError; - } - - return err; -} - - -pascal void OTInetEventHandler(void*s, OTEventCode event, OTResult, void *cookie) ; -pascal void OTInetEventHandler(void*s, OTEventCode event, OTResult result, void *cookie) -{ - int wakeUp = true ; - GSocket* sock = (GSocket*) s ; - - if ( event == kOTSyncIdleEvent ) - { - YieldToAnyThread() ; - return ; - } - - if ( s ) - { - wxMacAddEvent( sock->m_mac_events , _GSocket_Internal_Proc , event , s , wakeUp ) ; - } - - return; -} - -static void SetDefaultEndpointModes(EndpointRef ep , void *data ) - // This routine sets the supplied endpoint into the default - // mode used in this application. The specifics are: - // blocking, synchronous, and using synch idle events with - // the standard YieldingNotifier. -{ - OSStatus junk = kOTNoError ; - OTAssert ("SetDefaultEndpointModes:invalid ref", ep != kOTInvalidEndpointRef ) ; - junk = OTSetAsynchronous(ep); - OTAssert("SetDefaultEndpointModes: Could not set asynchronous", junk == noErr); -/* - junk = OTSetBlocking(ep); - OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr); - junk = OTSetSynchronous(ep); - OTAssert("SetDefaultEndpointModes: Could not set synchronous", junk == noErr); - junk = OTSetBlocking(ep); - OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr); -*/ - junk = OTInstallNotifier(ep, gOTNotifierUPP, data); - OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr); -/* - junk = OTUseSyncIdleEvents(ep, true); - OTAssert("SetDefaultEndpointModes: Could not use sync idle events", junk == noErr); -*/ -} - -/* Global initialisers */ - -void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *table) -{ - // do nothing, wxMac doesn't have wxBase-GUI separation yet -} - -int GSocket_Init() -{ - return TRUE; -} - -int GSocket_Verify_Inited() ; -int GSocket_Verify_Inited() -{ - OSStatus err ; -#if TARGET_CARBON - // Marc Newsam: added the clientcontext variable - // however, documentation is unclear how this works - OTClientContextPtr clientcontext; - - if ( gInetSvcRef ) - return TRUE ; - - InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext); - gOTInited = 1 ; - gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath, - NULL, &err, clientcontext); -#else - if ( gInetSvcRef ) - return TRUE ; - - InitOpenTransport() ; - gOTInited = 1 ; - gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); -#endif - if ( gInetSvcRef == NULL || err != kOTNoError ) - { - OTAssert("Could not open Inet Services", err == noErr); - return FALSE ; - } - gOTNotifierUPP = NewOTNotifyUPP( OTInetEventHandler ) ; - return TRUE ; -} - -void GSocket_Cleanup() -{ - if ( gOTInited != 0 ) - { - if ( gInetSvcRef != NULL ) - OTCloseProvider( gInetSvcRef ); - #if TARGET_CARBON - CloseOpenTransportInContext( NULL ) ; - #else - CloseOpenTransport() ; - #endif - if ( gOTNotifierUPP ) - DisposeOTNotifyUPP( gOTNotifierUPP ) ; - } -} - -/* Constructors / Destructors for GSocket */ - -GSocket *GSocket_new() -{ - - int i; - GSocket *socket; - - if ( GSocket_Verify_Inited() == FALSE ) - return NULL ; - - socket = (GSocket *)malloc(sizeof(GSocket)); - - if (socket == NULL) - return NULL; - - socket->m_endpoint = NULL ; - for (i=0;im_cbacks[i] = NULL; - } - socket->m_detected = 0; - socket->m_local = NULL; - socket->m_peer = NULL; - socket->m_error = GSOCK_NOERROR; - socket->m_server = FALSE; - socket->m_stream = TRUE; - socket->m_non_blocking = FALSE; - socket->m_timeout = 1*1000; - /* 10 sec * 1000 millisec */ - socket->m_takesEvents = TRUE ; - socket->m_mac_events = wxMacGetNotifierTable() ; - return socket; -} - -void GSocket_destroy(GSocket *socket) -{ - assert(socket != NULL); - - /* Check that the socket is really shutdowned */ - if (socket->m_endpoint != kOTInvalidEndpointRef) - GSocket_Shutdown(socket); - - - /* Destroy private addresses */ - if (socket->m_local) - GAddress_destroy(socket->m_local); - - if (socket->m_peer) - GAddress_destroy(socket->m_peer); - - /* Destroy the socket itself */ - free(socket); -} - -/* GSocket_Shutdown: - * Disallow further read/write operations on this socket, close - * the fd and disable all callbacks. - */ -void GSocket_Shutdown(GSocket *socket) -{ - OSStatus err ; - int evt; - - assert(socket != NULL); - - /* If socket has been created, shutdown it */ - if (socket->m_endpoint != kOTInvalidEndpointRef ) - { - err = OTSndOrderlyDisconnect( socket->m_endpoint ) ; - if ( err != kOTNoError ) - { - - } - err = OTRcvOrderlyDisconnect( socket->m_endpoint ) ; - err = OTUnbind( socket->m_endpoint ) ; - err = OTCloseProvider( socket->m_endpoint ) ; - socket->m_endpoint = kOTInvalidEndpointRef ; - } - - /* Disable GUI callbacks */ - for (evt = 0; evt < GSOCK_MAX_EVENT; evt++) - socket->m_cbacks[evt] = NULL; - - socket->m_detected = 0; - _GSocket_Disable_Events(socket); - wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable() , socket ) ; -} - - -/* Address handling */ - -/* GSocket_SetLocal: - * GSocket_GetLocal: - * GSocket_SetPeer: - * GSocket_GetPeer: - * Set or get the local or peer address for this socket. The 'set' - * functions return GSOCK_NOERROR on success, an error code otherwise. - * The 'get' functions return a pointer to a GAddress object on success, - * or NULL otherwise, in which case they set the error code of the - * corresponding GSocket. - * - * Error codes: - * GSOCK_INVSOCK - the socket is not valid. - * GSOCK_INVADDR - the address is not valid. - */ -GSocketError GSocket_SetLocal(GSocket *socket, GAddress *address) -{ - assert(socket != NULL); - - /* the socket must be initialized, or it must be a server */ - if ((socket->m_endpoint != kOTInvalidEndpointRef && !socket->m_server)) - { - socket->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - socket->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (socket->m_local) - GAddress_destroy(socket->m_local); - - socket->m_local = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GSocketError GSocket_SetPeer(GSocket *socket, GAddress *address) -{ - assert(socket != NULL); - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - socket->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (socket->m_peer) - GAddress_destroy(socket->m_peer); - - socket->m_peer = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GAddress *GSocket_GetLocal(GSocket *socket) -{ - GAddress *address = NULL ; - GSocketError err; - InetAddress loc ; - - assert(socket != NULL); - - /* try to get it from the m_local var first */ - if (socket->m_local) - return GAddress_copy(socket->m_local); - - /* else, if the socket is initialized, try getsockname */ - if (socket->m_endpoint == kOTInvalidEndpointRef) - { - socket->m_error = GSOCK_INVSOCK; - return NULL; - } - - -/* we do not support multihoming with this code at the moment - OTGetProtAddress will have to be used then - but we don't have a handy - method to use right now -*/ - { - InetInterfaceInfo info; - OTInetGetInterfaceInfo(&info, kDefaultInetInterface); - loc.fHost = info.fAddress ; - loc.fPort = 0 ; - loc.fAddressType = AF_INET ; - } - - /* got a valid address from getsockname, create a GAddress object */ - address = GAddress_new(); - if (address == NULL) - { - socket->m_error = GSOCK_MEMERR; - return NULL; - } - - err = _GAddress_translate_from(address, &loc); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(address); - socket->m_error = err; - return NULL; - } - - return address; -} - -GAddress *GSocket_GetPeer(GSocket *socket) -{ - assert(socket != NULL); - - /* try to get it from the m_peer var */ - if (socket->m_peer) - return GAddress_copy(socket->m_peer); - - return NULL; -} - -/* Server specific parts */ - -/* GSocket_SetServer: - * Sets up this socket as a server. The local address must have been - * set with GSocket_SetLocal() before GSocket_SetServer() is called. - * Returns GSOCK_NOERROR on success, one of the following otherwise: - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use. - * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_SetServer(GSocket *sck) -{ - assert(sck != NULL); - - /* must not be in use */ - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* the local addr must have been set */ - if (!sck->m_local) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - sck->m_stream = TRUE; - sck->m_server = TRUE; - sck->m_oriented = TRUE; - -// TODO -#if 0 - /* Create the socket */ - sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_STREAM, 0); - socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ; - if (sck->m_endpoint == kOTInvalidEndpointRef) - { - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - ioctl(sck->m_endpoint, FIONBIO, &arg); - _GSocket_Enable_Events(sck); - - /* Bind to the local address, - * retrieve the actual address bound, - * and listen up to 5 connections. - */ - if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) || - (getsockname(sck->m_endpoint, - sck->m_local->m_addr, - (SOCKLEN_T *) &sck->m_local->m_len) != 0) || - (listen(sck->m_endpoint, 5) != 0)) - { - close(sck->m_endpoint); - sck->m_endpoint = -1; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -#endif - return GSOCK_NOERROR; -} - -/* GSocket_WaitConnection: - * Waits for an incoming client connection. Returns a pointer to - * a GSocket object, or NULL if there was an error, in which case - * the last error field will be updated for the calling GSocket. - * - * Error codes (set in the calling GSocket) - * GSOCK_INVSOCK - the socket is not valid or not a server. - * GSOCK_TIMEDOUT - timeout, no incoming connections. - * GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking. - * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. - */ -GSocket *GSocket_WaitConnection(GSocket *socket) -{ - GSocket *connection = NULL ; - - assert(socket != NULL); - - /* Reenable CONNECTION events */ - socket->m_detected &= ~GSOCK_CONNECTION_FLAG; - - /* If the socket has already been created, we exit immediately */ - if (socket->m_endpoint == kOTInvalidEndpointRef || !socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return NULL; - } - - /* Create a GSocket object for the new connection */ - connection = GSocket_new(); - - if (!connection) - { - socket->m_error = GSOCK_MEMERR; - return NULL; - } - - /* Wait for a connection (with timeout) */ - if (_GSocket_Input_Timeout(socket) == GSOCK_TIMEDOUT) - { - GSocket_destroy(connection); - /* socket->m_error set by _GSocket_Input_Timeout */ - return NULL; - } - -// TODO -#if 0 - connection->m_endpoint = accept(socket->m_endpoint, &from, (SOCKLEN_T *) &fromlen); -#endif - - if (connection->m_endpoint == kOTInvalidEndpointRef ) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - - GSocket_destroy(connection); - return NULL; - } - - /* Initialize all fields */ - connection->m_server = FALSE; - connection->m_stream = TRUE; - connection->m_oriented = TRUE; - - /* Setup the peer address field */ - connection->m_peer = GAddress_new(); - if (!connection->m_peer) - { - GSocket_destroy(connection); - socket->m_error = GSOCK_MEMERR; - return NULL; - } - // TODO - #if 0 - err = _GAddress_translate_from(connection->m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(connection->m_peer); - GSocket_destroy(connection); - socket->m_error = err; - return NULL; - } - - ioctl(connection->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(connection); - - return connection; -} - -/* Datagram sockets */ - -/* GSocket_SetNonOriented: - * Sets up this socket as a non-connection oriented (datagram) socket. - * Before using this function, the local address must have been set - * with GSocket_SetLocal(), or the call will fail. Returns GSOCK_NOERROR - * on success, or one of the following otherwise. - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use. - * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_SetNonOriented(GSocket *sck) -{ - assert(sck != NULL); - - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!sck->m_local) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - sck->m_stream = FALSE; - sck->m_server = FALSE; - sck->m_oriented = FALSE; - - /* Create the socket */ - -// TODO -#if 0 - sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0); - socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ; -#endif - if (sck->m_endpoint == kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - -// TODO -#if 0 - ioctl(sck->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(sck); - - /* Bind to the local address, - * and retrieve the actual address bound. - */ -// TODO -#if 0 - if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) || - (getsockname(sck->m_endpoint, - sck->m_local->m_addr, - (SOCKLEN_T *) &sck->m_local->m_len) != 0)) - { - close(sck->m_endpoint); - sck->m_endpoint = -1; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -#endif - return GSOCK_NOERROR; -} - -/* Client specific parts */ - -/* GSocket_Connect: - * For stream (connection oriented) sockets, GSocket_Connect() tries - * to establish a client connection to a server using the peer address - * as established with GSocket_SetPeer(). Returns GSOCK_NOERROR if the - * connection has been succesfully established, or one of the error - * codes listed below. Note that for nonblocking sockets, a return - * value of GSOCK_WOULDBLOCK doesn't mean a failure. The connection - * request can be completed later; you should use GSocket_Select() - * to poll for GSOCK_CONNECTION | GSOCK_LOST, or wait for the - * corresponding asynchronous events. - * - * For datagram (non connection oriented) sockets, GSocket_Connect() - * just sets the peer address established with GSocket_SetPeer() as - * default destination. - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use or not valid. - * GSOCK_INVADDR - the peer address has not been established. - * GSOCK_TIMEDOUT - timeout, the connection failed. - * GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only) - * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) -{ - InetAddress addr ; - TEndpointInfo info; - OSStatus err = kOTNoError; - TCall peer ; - - assert(sck != NULL); - - /* Enable CONNECTION events (needed for nonblocking connections) */ - sck->m_detected &= ~GSOCK_CONNECTION_FLAG; - - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!sck->m_peer) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Streamed or dgram socket? */ - sck->m_stream = (stream == GSOCK_STREAMED); - sck->m_oriented = TRUE; - sck->m_server = FALSE; - - /* Create the socket */ -#if TARGET_CARBON - sck->m_endpoint = - OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ; -#else - sck->m_endpoint = - OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ; -#endif - if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError ) - { - sck->m_endpoint = kOTInvalidEndpointRef ; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - err = OTBind( sck->m_endpoint , nil , nil ) ; - if ( err != kOTNoError ) - { - return GSOCK_IOERR; - } - SetDefaultEndpointModes( sck->m_endpoint , sck ) ; -// TODO -#if 0 - ioctl(sck->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(sck); - - _GAddress_translate_to( sck->m_peer , &addr ) ; - memset( &peer , 0 , sizeof( TCall ) ) ; - peer.addr.len = sizeof( InetAddress ) ; - peer.addr.buf = (unsigned char*) &addr ; - err = OTConnect( sck->m_endpoint , &peer , nil ) ; - if ( err != noErr ) - { - /* If connect failed with EINPROGRESS and the GSocket object - * is in blocking mode, we select() for the specified timeout - * checking for writability to see if the connection request - * completes. - */ - - if ((err == kOTNoDataErr ) && (!sck->m_non_blocking)) - { - if (_GSocket_Output_Timeout(sck) == GSOCK_TIMEDOUT) - { - OTSndOrderlyDisconnect( sck->m_endpoint ) ; - sck->m_endpoint = kOTInvalidEndpointRef ; - /* sck->m_error is set in _GSocket_Output_Timeout */ - return GSOCK_TIMEDOUT; - } - else - { -/* - int error; - SOCKLEN_T len = sizeof(error); - - getsockopt(sck->m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len); - - if (!error) -*/ - return GSOCK_NOERROR; - } - } - - /* If connect failed with EINPROGRESS and the GSocket object - * is set to nonblocking, we set m_error to GSOCK_WOULDBLOCK - * (and return GSOCK_WOULDBLOCK) but we don't close the socket; - * this way if the connection completes, a GSOCK_CONNECTION - * event will be generated, if enabled. - */ - if ((err == kOTNoDataErr) && (sck->m_non_blocking)) - { - sck->m_error = GSOCK_WOULDBLOCK; - return GSOCK_WOULDBLOCK; - } - - /* If connect failed with an error other than EINPROGRESS, - * then the call to GSocket_Connect has failed. - */ - OTSndOrderlyDisconnect( sck->m_endpoint ) ; - - sck->m_endpoint = kOTInvalidEndpointRef ; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -// OTInetEventHandler(sck, T_CONNECT , kOTNoError , NULL ) ; - return GSOCK_NOERROR; -} - -/* Generic IO */ - -/* Like recv(), send(), ... */ -int GSocket_Read(GSocket *socket, char *buffer, int size) -{ - int ret = 0 ; - - assert(socket != NULL); - - /* Reenable INPUT events */ - socket->m_detected &= ~GSOCK_INPUT_FLAG; - - if (socket->m_endpoint == kOTInvalidEndpointRef || socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return -1; - } - - /* If the socket is blocking, wait for data (with a timeout) */ - if (_GSocket_Input_Timeout(socket) == GSOCK_TIMEDOUT) - return -1; - - /* Read the data */ - if (socket->m_stream) - ret = _GSocket_Recv_Stream(socket, buffer, size); - else - ret = _GSocket_Recv_Dgram(socket, buffer, size); - - if (ret == -1) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - } - - return ret; -} - -int GSocket_Write(GSocket *socket, const char *buffer, int size) -{ - int ret; - - assert(socket != NULL); - - if (socket->m_endpoint == kOTInvalidEndpointRef || socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return -1; - } - - /* If the socket is blocking, wait for writability (with a timeout) */ - if (_GSocket_Output_Timeout(socket) == GSOCK_TIMEDOUT) - return -1; - - /* Write the data */ - if (socket->m_stream) - ret = _GSocket_Send_Stream(socket, buffer, size); - else - ret = _GSocket_Send_Dgram(socket, buffer, size); - - if (ret == -1) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - - /* Only reenable OUTPUT events after an error (just like WSAAsyncSelect - * in MSW). Once the first OUTPUT event is received, users can assume - * that the socket is writable until a read operation fails. Only then - * will further OUTPUT events be posted. - */ - socket->m_detected &= ~GSOCK_OUTPUT_FLAG; - return -1; - } - - return ret; -} - -/* GSocket_Select: - * Polls the socket to determine its status. This function will - * check for the events specified in the 'flags' parameter, and - * it will return a mask indicating which operations can be - * performed. This function won't block, regardless of the - * mode (blocking | nonblocking) of the socket. - */ -GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) -{ - assert(socket != NULL); - wxMacProcessNotifierEvents() ; - /* - state = OTGetEndpointState(socket->m_endpoint); - - if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) ) - { - size_t sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_OUTPUT_FLAG ) ) - { - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_detected |=GSOCK_OUTPUT_FLAG ; - (socket->m_cbacks[GSOCK_OUTPUT])(socket, GSOCK_OUTPUT, socket->m_data[GSOCK_OUTPUT]); - } - } - */ - return ( flags & socket->m_detected ) ; -} - -/* Flags */ - -/* GSocket_SetNonBlocking: - * Sets the socket to non-blocking mode. All IO calls will return - * immediately. - */ -void GSocket_SetNonBlocking(GSocket *socket, int non_block) -{ - assert(socket != NULL); - - socket->m_non_blocking = non_block; -} - -/* GSocket_SetTimeout: - * Sets the timeout for blocking calls. Time is expressed in - * milliseconds. - */ -void GSocket_SetTimeout(GSocket *socket, unsigned long millisec) -{ - assert(socket != NULL); - -// this is usually set too high and we have not yet been able to detect a closed -// stream, thus we leave the 10 sec timeout -// socket->m_timeout = millisec; -} - -/* GSocket_GetError: - * Returns the last error occured for this socket. Note that successful - * operations do not clear this back to GSOCK_NOERROR, so use it only - * after an error. - */ -GSocketError GSocket_GetError(GSocket *socket) -{ - assert(socket != NULL); - - return socket->m_error; -} - -/* Callbacks */ - -/* GSOCK_INPUT: - * There is data to be read in the input buffer. If, after a read - * operation, there is still data available, the callback function will - * be called again. - * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call - * won't block. This event is generated only once, when the connection is - * first established, and then only if a call failed with GSOCK_WOULDBLOCK, - * when the output buffer empties again. This means that the app should - * assume that it can write since the first OUTPUT event, and no more - * OUTPUT events will be generated unless an error occurs. - * GSOCK_CONNECTION: - * Connection succesfully established, for client sockets, or incoming - * client connection, for server sockets. Wait for this event (also watch - * out for GSOCK_LOST) after you issue a nonblocking GSocket_Connect() call. - * GSOCK_LOST: - * The connection is lost (or a connection request failed); this could - * be due to a failure, or due to the peer closing it gracefully. - */ - -/* GSocket_SetCallback: - * Enables the callbacks specified by 'flags'. Note that 'flags' - * may be a combination of flags OR'ed toghether, so the same - * callback function can be made to accept different events. - * The callback function must have the following prototype: - * - * void function(GSocket *socket, GSocketEvent event, char *cdata) - */ -void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags, - GSocketCallback callback, char *cdata) -{ - int count; - - assert(socket != NULL); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - socket->m_cbacks[count] = callback; - socket->m_data[count] = cdata; - } - } -} - -/* GSocket_UnsetCallback: - * Disables all callbacks specified by 'flags', which may be a - * combination of flags OR'ed toghether. - */ -void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags) -{ - int count; - - assert(socket != NULL); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - socket->m_cbacks[count] = NULL; - socket->m_data[count] = NULL; - } - } -} - - -#define CALL_CALLBACK(socket, event) { \ - _GSocket_Disable(socket, event); \ - if (socket->m_cbacks[event]) \ - socket->m_cbacks[event](socket, event, socket->m_data[event]); \ -} - -int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size) -{ - OTFlags flags ; - OTResult res ; - OTByteCount sz = 0 ; - - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( size > (int)sz ) - size = sz ; - res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ; - if ( res < 0 ) - { - return -1 ; - } - - // we simulate another read event if there are still bytes - if ( socket->m_takesEvents ) - { - OTByteCount sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - return res ; -} - -int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size) -{ -// TODO - int ret = -1; -#if 0 - struct sockaddr from; - SOCKLEN_T fromlen = sizeof(from); - GSocketError err; - - fromlen = sizeof(from); - - ret = recvfrom(socket->m_endpoint, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen); - - if (ret == -1) - return -1; - - /* Translate a system address into a GSocket address */ - if (!socket->m_peer) - { - socket->m_peer = GAddress_new(); - if (!socket->m_peer) - { - socket->m_error = GSOCK_MEMERR; - return -1; - } - } - err = _GAddress_translate_from(socket->m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(socket->m_peer); - socket->m_peer = NULL; - socket->m_error = err; - return -1; - } -#endif - return ret; -} - -int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size) -{ - OTFlags flags = 0 ; - OTResult res ; - - res = OTSnd( socket->m_endpoint , (void*) buffer , size , flags ) ; - return res ; -} - -int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size) -{ - int ret = -1 ; -// TODO -#if 0 - struct sockaddr *addr; - int len ; - GSocketError err; - - if (!socket->m_peer) - { - socket->m_error = GSOCK_INVADDR; - return -1; - } - - err = _GAddress_translate_to(socket->m_peer, &addr, &len); - if (err != GSOCK_NOERROR) - { - socket->m_error = err; - return -1; - } - - ret = sendto(socket->m_endpoint, buffer, size, 0, addr, len); - - /* Frees memory allocated from _GAddress_translate_to */ - free(addr); -#endif - return ret; -} - - -/* - * ------------------------------------------------------------------------- - * GAddress - * ------------------------------------------------------------------------- - */ - -/* CHECK_ADDRESS verifies that the current family is either GSOCK_NOFAMILY - * or GSOCK_*family*, and if it is GSOCK_NOFAMILY, it initalizes address - * to be a GSOCK_*family*. In other cases, it returns GSOCK_INVADDR. - */ -#define CHECK_ADDRESS(address, family, retval) \ -{ \ - if (address->m_family == GSOCK_NOFAMILY) \ - if (_GAddress_Init_##family(address) != GSOCK_NOERROR) \ - return address->m_error; \ - if (address->m_family != GSOCK_##family) \ - { \ - address->m_error = GSOCK_INVADDR; \ - return retval; \ - } \ -} - -GAddress *GAddress_new() -{ - GAddress *address; - - if ((address = (GAddress *) malloc(sizeof(GAddress))) == NULL) - return NULL; - - address->m_family = GSOCK_NOFAMILY; - address->m_host = INADDR_NONE ; - address->m_port = 0 ; - - return address; -} - -GAddress *GAddress_copy(GAddress *address) -{ - GAddress *addr2; - - assert(address != NULL); - - if ((addr2 = (GAddress *) malloc(sizeof(GAddress))) == NULL) - return NULL; - - memcpy(addr2, address, sizeof(GAddress)); - return addr2; -} - -void GAddress_destroy(GAddress *address) -{ - assert(address != NULL); - - free(address); -} - -void GAddress_SetFamily(GAddress *address, GAddressType type) -{ - assert(address != NULL); - - address->m_family = type; -} - -GAddressType GAddress_GetFamily(GAddress *address) -{ - assert(address != NULL); - - return address->m_family; -} - -GSocketError _GAddress_translate_from(GAddress *address, - InetAddress *addr) -{ - switch (addr->fAddressType) - { - case AF_INET: - address->m_family = GSOCK_INET; - break; -#ifdef AF_INET6 - case AF_INET6: - address->m_family = GSOCK_INET6; - break; -#endif - default: - { - address->m_error = GSOCK_INVOP; - return GSOCK_INVOP; - } - } - address->m_host = addr->fHost ; - address->m_port = addr->fPort ; - return GSOCK_NOERROR; -} - -GSocketError _GAddress_translate_to(GAddress *address, - InetAddress *addr) -{ - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - memset(addr, 0 , sizeof(struct InetAddress)); - OTInitInetAddress( addr , address->m_port , address->m_host ) ; - return GSOCK_NOERROR; -} - -/* - * ------------------------------------------------------------------------- - * Internet address family - * ------------------------------------------------------------------------- - */ - -GSocketError _GAddress_Init_INET(GAddress *address) -{ - address->m_family = GSOCK_INET; - address->m_host = kOTAnyInetAddress ; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) -{ - InetHostInfo hinfo ; - OSStatus ret ; - - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - - assert(address != NULL); - - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - ret = OTInetStringToAddress( gInetSvcRef , (char*) hostname , &hinfo ) ; - if ( ret != kOTNoError ) - { - address->m_host = INADDR_NONE ; - address->m_error = GSOCK_NOHOST; - return GSOCK_NOHOST; - } - address->m_host = hinfo.addrs[0] ; - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetAnyAddress(GAddress *address) -{ - return GAddress_INET_SetHostAddress(address, INADDR_ANY); -} - -GSocketError GAddress_INET_SetHostAddress(GAddress *address, - unsigned long hostaddr) -{ - assert(address != NULL); - - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - address->m_host = hostaddr ; - - return GSOCK_NOERROR; -} - -struct service_entry -{ - char * name ; - unsigned short port ; - char * protocol ; -} ; -typedef struct service_entry service_entry ; - -service_entry gServices[] = -{ - { "http" , 80 , "tcp" } -} ; - -GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, - const char *protocol) -{ - size_t i ; - - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - if (!port) - { - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; - } - for ( i = 0 ; i < sizeof( gServices) / sizeof( service_entry ) ; ++i ) - { - if ( strcmp( port , gServices[i].name ) == 0 ) - { - if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) ) - { - address->m_port = gServices[i].port ; - return GSOCK_NOERROR; - } - } - } - - if (isdigit(port[0])) - { - address->m_port = atoi(port); - return GSOCK_NOERROR; - } - - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; -} - -GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - address->m_port = port ; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf) -{ - InetDomainName name ; - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - OTInetAddressToName( gInetSvcRef , address->m_host , name ) ; - strncpy( hostname , name , sbuf ) ; - return GSOCK_NOERROR; -} - -unsigned long GAddress_INET_GetHostAddress(GAddress *address) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, 0); - - return address->m_host; -} - -unsigned short GAddress_INET_GetPort(GAddress *address) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, 0); - - return address->m_port; -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - if ( socket->m_takesEvents ) - return ; - - { - OTResult state ; - socket->m_takesEvents = TRUE ; - state = OTGetEndpointState(socket->m_endpoint); - - { - OTByteCount sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - { - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_detected |=GSOCK_OUTPUT_FLAG ; - (socket->m_cbacks[GSOCK_OUTPUT])(socket, GSOCK_OUTPUT, socket->m_data[GSOCK_OUTPUT]); - } - } - } -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - socket->m_takesEvents = FALSE ; -} - -/* _GSocket_Input_Timeout: - * For blocking sockets, wait until data is available or - * until timeout ellapses. - */ -GSocketError _GSocket_Input_Timeout(GSocket *socket) -{ - if ( !socket->m_non_blocking ) - { - UnsignedWide now , start ; - short formerTakesEvents = socket->m_takesEvents ; - Microseconds(&start); - now = start ; - socket->m_takesEvents = FALSE ; - - while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) - { - OTResult state ; - OTByteCount sz = 0 ; - state = OTGetEndpointState(socket->m_endpoint); - - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_takesEvents = formerTakesEvents ; - return GSOCK_NOERROR; - } - Microseconds(&now); - } - socket->m_takesEvents = formerTakesEvents ; - socket->m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - return GSOCK_NOERROR; -} - -/* _GSocket_Output_Timeout: - * For blocking sockets, wait until data can be sent without - * blocking or until timeout ellapses. - */ -GSocketError _GSocket_Output_Timeout(GSocket *socket) -{ - if ( !socket->m_non_blocking ) - { - UnsignedWide now , start ; - short formerTakesEvents = socket->m_takesEvents ; - Microseconds(&start); - now = start ; - socket->m_takesEvents = FALSE ; - - while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) - { - OTResult state ; - state = OTGetEndpointState(socket->m_endpoint); - - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_takesEvents = formerTakesEvents ; - return GSOCK_NOERROR; - } - Microseconds(&now); - } - socket->m_takesEvents = formerTakesEvents ; - socket->m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - return GSOCK_NOERROR; -} - -/* GSOCK_INPUT: - * There is data to be read in the input buffer. If, after a read - * operation, there is still data available, the callback function will - * be called again. - * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call - * won't block. This event is generated only once, when the connection is - * first established, and then only if a call failed with GSOCK_WOULDBLOCK, - * when the output buffer empties again. This means that the app should - * assume that it can write since the first OUTPUT event, and no more - * OUTPUT events will be generated unless an error occurs. - * GSOCK_CONNECTION: - * Connection succesfully established, for client sockets, or incoming - * client connection, for server sockets. Wait for this event (also watch - * out for GSOCK_LOST) after you issue a nonblocking GSocket_Connect() call. - * GSOCK_LOST: - * The connection is lost (or a connection request failed); this could - * be due to a failure, or due to the peer closing it gracefully. - */ - -void _GSocket_Internal_Proc(unsigned long e , void* d ) -{ - - GSocket * socket = (GSocket*) d ; - OTEventCode ev = (OTEventCode) e ; - GSocketEvent event; - GSocketEvent event2; - GSocketCallback cback; - char *data; - GSocketCallback cback2; - char *data2; - - if ( !socket ) - return ; - event = GSOCK_MAX_EVENT ; - event2 = GSOCK_MAX_EVENT ; - cback = NULL; - data = NULL; - cback2 = NULL; - data2 = NULL; - - /* Check that the socket still exists (it has not been - * destroyed) and for safety, check that the m_endpoint field - * is what we expect it to be. - */ - if ((socket != NULL) && (socket->m_takesEvents)) - { - switch (ev) - { - case T_LISTEN : - event = GSOCK_CONNECTION ; - break ; - case T_CONNECT : - event = GSOCK_CONNECTION ; - event2 = GSOCK_OUTPUT ; - { - TCall retCall; - - retCall.addr.buf = NULL; - retCall.addr.maxlen = 0; - retCall.opt.buf = NULL; - retCall.opt.maxlen = 0; - retCall.udata.buf = NULL; - retCall.udata.maxlen= 0; - OTRcvConnect( socket->m_endpoint , &retCall ) ; - } - break ; - case T_DISCONNECT : - event = GSOCK_LOST ; - break ; - case T_GODATA : - case T_GOEXDATA : - event = GSOCK_OUTPUT ; - break ; - case T_DATA : - event = GSOCK_INPUT ; - break ; - case T_EXDATA : - event = GSOCK_INPUT ; - break ; - } - if (event != GSOCK_MAX_EVENT) - { - cback = socket->m_cbacks[event]; - data = socket->m_data[event]; - - if (event == GSOCK_LOST) - socket->m_detected = GSOCK_LOST_FLAG; - else - socket->m_detected |= (1 << event); - } - if (event2 != GSOCK_MAX_EVENT) - { - cback2 = socket->m_cbacks[event2]; - data2 = socket->m_data[event2]; - - if (event2 == GSOCK_LOST) - socket->m_detected = GSOCK_LOST_FLAG; - else - socket->m_detected |= (1 << event2); - } - } - - /* OK, we can now leave the critical section because we have - * already obtained the callback address (we make no further - * accesses to socket->whatever). However, the app should - * be prepared to handle events from a socket that has just - * been closed! - */ - - if (cback != NULL) - (cback)(socket, event, data); - if (cback2 != NULL) - (cback2)(socket, event2, data2); - -} - -/* Hack added for Mac OS X */ -GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf) -{ - return GSOCK_INVADDR; -} - -GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path) -{ - return GSOCK_INVADDR; -} - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ diff --git a/src/mac/carbon/gsockosx.c b/src/mac/carbon/gsockosx.c deleted file mode 100644 index 614ed425c8..0000000000 --- a/src/mac/carbon/gsockosx.c +++ /dev/null @@ -1,181 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockosx.c - * Purpose: GSocket: Mac OS X mach-o part - * CVSID: $Id$ - * Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu - * ------------------------------------------------------------------------- */ - -#include "wx/setup.h" - -#if wxUSE_SOCKETS - -#include -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#include - -#define ALL_CALLBACK_TYPES (kCFSocketReadCallBack | kCFSocketWriteCallBack | kCFSocketConnectCallBack) - -struct MacGSocketData -{ - CFSocketRef socket; - CFRunLoopSourceRef source; -}; - -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) -{ - GSocket* socket = (GSocket*)info; - struct MacGSocketData* macdata; - macdata = (struct MacGSocketData*)socket->m_gui_dependent; - if (!macdata) return; - switch (callbackType) - { - case kCFSocketConnectCallBack: - assert(!socket->m_server); - socket->m_functions->Detected_Write(socket); - break; - case kCFSocketReadCallBack: - socket->m_functions->Detected_Read(socket); - break; - case kCFSocketWriteCallBack: - socket->m_functions->Detected_Write(socket); - break; - default: - break; /* We shouldn't get here. */ - } -} - -struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket) -{ - /* If socket is already created, returns a pointer to the data */ - /* Otherwise, creates socket and returns the pointer */ - CFSocketContext cont; - struct MacGSocketData* data = (struct MacGSocketData*)socket->m_gui_dependent; - - if (data && data->source) return data; - - /* CFSocket has not been created, create it: */ - if (socket->m_fd < 0 || !data) return NULL; - cont.version = 0; cont.retain = NULL; - cont.release = NULL; cont.copyDescription = NULL; - cont.info = socket; - - CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, - ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont); - CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0); - assert(source); - socket->m_gui_dependent = (char*)data; - - /* Keep the source and the socket around. */ - data->source = source; - data->socket = cf; - - return data; -} - -int _GSocket_GUI_Init(void) -{ - return 1; -} - -void _GSocket_GUI_Cleanup(void) -{ -} - -int _GSocket_GUI_Init_Socket(GSocket *socket) -{ - struct MacGSocketData *data = malloc(sizeof(struct MacGSocketData)); - if (data) - { - socket->m_gui_dependent = (char*)data; - data->socket = NULL; - data->source = NULL; - return 1; - } - return 0; -} - -void _GSocket_GUI_Destroy_Socket(GSocket *socket) -{ - struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent); - if (data) - { - CFRelease(data->socket); - free(data); - } -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketEnableCallBacks(data->socket, c); -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketDisableCallBacks(data->socket, c); -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - CFRunLoopAddSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopDefaultMode); -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */ - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes); - CFSocketInvalidate(data->socket); -} - -#endif // wxUSE_SOCKETS diff --git a/src/mac/carbon/gsockosx.cpp b/src/mac/carbon/gsockosx.cpp deleted file mode 100644 index 614ed425c8..0000000000 --- a/src/mac/carbon/gsockosx.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockosx.c - * Purpose: GSocket: Mac OS X mach-o part - * CVSID: $Id$ - * Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu - * ------------------------------------------------------------------------- */ - -#include "wx/setup.h" - -#if wxUSE_SOCKETS - -#include -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#include - -#define ALL_CALLBACK_TYPES (kCFSocketReadCallBack | kCFSocketWriteCallBack | kCFSocketConnectCallBack) - -struct MacGSocketData -{ - CFSocketRef socket; - CFRunLoopSourceRef source; -}; - -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) -{ - GSocket* socket = (GSocket*)info; - struct MacGSocketData* macdata; - macdata = (struct MacGSocketData*)socket->m_gui_dependent; - if (!macdata) return; - switch (callbackType) - { - case kCFSocketConnectCallBack: - assert(!socket->m_server); - socket->m_functions->Detected_Write(socket); - break; - case kCFSocketReadCallBack: - socket->m_functions->Detected_Read(socket); - break; - case kCFSocketWriteCallBack: - socket->m_functions->Detected_Write(socket); - break; - default: - break; /* We shouldn't get here. */ - } -} - -struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket) -{ - /* If socket is already created, returns a pointer to the data */ - /* Otherwise, creates socket and returns the pointer */ - CFSocketContext cont; - struct MacGSocketData* data = (struct MacGSocketData*)socket->m_gui_dependent; - - if (data && data->source) return data; - - /* CFSocket has not been created, create it: */ - if (socket->m_fd < 0 || !data) return NULL; - cont.version = 0; cont.retain = NULL; - cont.release = NULL; cont.copyDescription = NULL; - cont.info = socket; - - CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, - ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont); - CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0); - assert(source); - socket->m_gui_dependent = (char*)data; - - /* Keep the source and the socket around. */ - data->source = source; - data->socket = cf; - - return data; -} - -int _GSocket_GUI_Init(void) -{ - return 1; -} - -void _GSocket_GUI_Cleanup(void) -{ -} - -int _GSocket_GUI_Init_Socket(GSocket *socket) -{ - struct MacGSocketData *data = malloc(sizeof(struct MacGSocketData)); - if (data) - { - socket->m_gui_dependent = (char*)data; - data->socket = NULL; - data->source = NULL; - return 1; - } - return 0; -} - -void _GSocket_GUI_Destroy_Socket(GSocket *socket) -{ - struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent); - if (data) - { - CFRelease(data->socket); - free(data); - } -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketEnableCallBacks(data->socket, c); -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketDisableCallBacks(data->socket, c); -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - CFRunLoopAddSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopDefaultMode); -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */ - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes); - CFSocketInvalidate(data->socket); -} - -#endif // wxUSE_SOCKETS diff --git a/src/mac/carbon/helpxxxx.cpp b/src/mac/carbon/helpxxxx.cpp deleted file mode 100644 index 7d0e4d1531..0000000000 --- a/src/mac/carbon/helpxxxx.cpp +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpxxxx.cpp -// Purpose: Help system: native implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "helpxxxx.h" -#endif - -#include "wx/stubs/helpxxxx.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxXXXXHelpController, wxHelpControllerBase) -#endif - -wxXXXXHelpController::wxXXXXHelpController() -{ - m_helpFile = ""; -} - -wxXXXXHelpController::~wxXXXXHelpController() -{ -} - -bool wxXXXXHelpController::Initialize(const wxString& filename) -{ - m_helpFile = filename; - // TODO any other inits - return TRUE; -} - -bool wxXXXXHelpController::LoadFile(const wxString& file) -{ - m_helpFile = file; - // TODO - return TRUE; -} - -bool wxXXXXHelpController::DisplayContents() -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplaySection(int section) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplayBlock(long block) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::KeywordSearch(const wxString& k, - wxHelpSearchMode WXUNUSED(mode)) -{ - if (m_helpFile == "") return FALSE; - - // TODO - return FALSE; -} - -// Can't close the help window explicitly in WinHelp -bool wxXXXXHelpController::Quit() -{ - // TODO - return FALSE; -} - -void wxXXXXHelpController::OnQuit() -{ -} - diff --git a/src/mac/carbon/hid.cpp b/src/mac/carbon/hid.cpp deleted file mode 100644 index f4ce8a1874..0000000000 --- a/src/mac/carbon/hid.cpp +++ /dev/null @@ -1,417 +0,0 @@ -#include "hid.h" - -#define wxFORCECHECK_MSG(arg, msg) \ -{\ - if (arg) \ - {\ - wxLogSysError(wxString::Format(wxT("Message:%s\nHID: %s failed!"), wxT(msg), wxT(#arg)));\ - return false;\ - }\ -} -#define wxIOCHECK(arg, msg) wxFORCECHECK_MSG(arg != kIOReturnSuccess, msg) -#define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg) -#define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg) - -void CFShowTypeIDDescription(CFTypeRef pData) -{ - if(!pData) - { - wxMessageBox("AHHH!"); - return; - } - - wxMessageBox( - CFStringGetCStringPtr( - CFCopyTypeIDDescription(CFGetTypeID(pData)),CFStringGetSystemEncoding() - ) - ); -} - -// ============================================================================ -// implementation -// ============================================================================ - - -bool wxHIDDevice::Create (const int& nClass, const int& nType) -{ - //Create the mach port - wxIOCHECK(IOMasterPort(bootstrap_port, &m_pPort), "Could not create mach port"); - - //Dictionary that will hold first - //the matching dictionary for determining which kind of devices we want, - //then later some registry properties from an iterator (see below) - CFMutableDictionaryRef pDictionary; - - //Create a dictionary - //The call to IOServiceMatching filters down the - //the services we want to hid services (and also eats the - //dictionary up for us (consumes one reference)) - wxASSERT((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL ); - - //Here we'll filter down the services to what we want - if (nType != -1) - { - CFNumberRef pType = CFNumberCreate(kCFAllocatorDefault, - kCFNumberIntType, &nType); - CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsageKey), pType); - CFRelease(pType); - } - if (nClass != -1) - { - CFNumberRef pClass = CFNumberCreate(kCFAllocatorDefault, - kCFNumberIntType, &nClass); - CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsagePageKey), pClass); - CFRelease(pClass); - } - - //Now get the maching services - io_iterator_t pIterator; - wxIOCHECK(IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator), "No Matching HID Services"); - wxASSERT(pIterator != NULL); - - //Now we iterate through them - io_object_t pObject; - while ( (pObject = IOIteratorNext(pIterator)) != NULL) - { - wxASSERT(IORegistryEntryCreateCFProperties(pObject, &pDictionary, - kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS); - - //Just for sanity :) - wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID()); - - //Get [product] name - m_szName = CFStringGetCStringPtr ( - (CFStringRef) CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey)), - CFStringGetSystemEncoding() - ); - - // - //Now the hard part - in order to scan things we need "cookies" - - // - wxCFArray CookieArray = CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDElementKey)); - BuildCookies(CookieArray); - if (m_ppQueue != NULL) - wxASSERT((*m_ppQueue)->start(m_ppQueue) == S_OK); - - //Create the interface (good grief - long function names!) - SInt32 nScore; - IOCFPlugInInterface** ppPlugin; - wxIOCHECK(IOCreatePlugInInterfaceForService(pObject, kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, &ppPlugin, &nScore), ""); - - //Now, the final thing we can check before we fall back to asserts - //(because the dtor only checks if the device is ok, so if anything - //fails from now on the dtor will delete the device anyway, so we can't break from this). - - //Get the HID interface from the plugin to the mach port - wxSCHECK((*ppPlugin)->QueryInterface(ppPlugin, - CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void**) &m_ppDevice), ""); - - //release the plugin - (*ppPlugin)->Release(ppPlugin); - - //open the HID interface... - wxASSERT((*m_ppDevice)->open(m_ppDevice, 0) == S_OK); - - //cleanup - CFRelease(pDictionary); - IOObjectRelease(pObject); - break; - } - //iterator cleanup - IOObjectRelease(pIterator); - - return true; -}//end Create() - -void wxHIDDevice::AddCookie(CFTypeRef Data, const int& i) -{ - CFNumberGetValue( - (CFNumberRef) CFDictionaryGetValue ( (CFDictionaryRef) Data - , CFSTR(kIOHIDElementCookieKey) - ), - kCFNumberIntType, - &m_pCookies[i] - ); -} - -void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, const int& i) -{ - AddCookie(Data, i); - wxASSERT((*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) == S_OK);//3rd Param flags (none yet) -} - -void wxHIDDevice::InitCookies(const size_t& dwSize, bool bQueue) -{ - m_pCookies = new IOHIDElementCookie[dwSize]; - if (bQueue) - { - wxASSERT( m_ppQueue != NULL); - wxASSERT( (m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice)) != NULL); - wxASSERT( (*m_ppQueue)->create(m_ppQueue, 0, 512) == S_OK); //Param 2, flags, none yet - } -} - -bool wxHIDDevice::IsActive(const int& nIndex) -{ - wxASSERT(m_pCookies[nIndex] != NULL); - IOHIDEventStruct Event; - (*m_ppDevice)->getElementValue(m_ppDevice, m_pCookies[nIndex], &Event); - return !!Event.value; -} - - -wxHIDDevice::~wxHIDDevice() -{ - if (m_ppDevice != NULL) - { - (*m_ppDevice)->close(m_ppDevice); - (*m_ppDevice)->Release(m_ppDevice); - mach_port_deallocate(mach_task_self(), m_pPort); - } - - if (m_pCookies != NULL) - { - delete [] m_pCookies; - if (m_ppQueue != NULL) - { - (*m_ppQueue)->stop(m_ppQueue); - (*m_ppQueue)->dispose(m_ppQueue); - (*m_ppQueue)->Release(m_ppQueue); - } - } -} -/* -enum -{ - kHIDUsage_KeyboardHyphen = 0x2D, - kHIDUsage_KeyboardEqualSign = 0x2E, - kHIDUsage_KeyboardOpenBracket = 0x2F, - kHIDUsage_KeyboardCloseBracket = 0x30, - kHIDUsage_KeyboardBackslash = 0x31, //* \ or | * - kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ * - kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : * - kHIDUsage_KeyboardQuote = 0x34, /* ' or " * - kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde * - kHIDUsage_KeyboardComma = 0x36, /* , or < * - kHIDUsage_KeyboardPeriod = 0x37, /* . or > * - kHIDUsage_KeyboardSlash = 0x38, /* / or ? * - kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock * - - kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen * - kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock * - kHIDUsage_KeyboardPause = 0x48, /* Pause * - kHIDUsage_KeyboardInsert = 0x49, /* Insert * - kHIDUsage_KeyboardHome = 0x4A, /* Home * - kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward * - - kHIDUsage_KeyboardUpArrow - kHIDUsage_KeypadNumLock - kHIDUsage_KeypadSlash - kHIDUsage_KeypadAsterisk - kHIDUsage_KeypadHyphen - kHIDUsage_KeypadPlus - kHIDUsage_KeypadEnter - kHIDUsage_KeypadPeriod - kHIDUsage_KeyboardNonUSBackslash - kHIDUsage_KeyboardApplication - kHIDUsage_KeyboardPower - kHIDUsage_KeypadEqualSign -}; -/* - enum wxKeyCode - { - - WXK_START = 300, - WXK_LBUTTON, - WXK_RBUTTON, - WXK_CANCEL, - WXK_MBUTTON, - WXK_CLEAR, - WXK_SHIFT, - WXK_ALT, - WXK_CONTROL, - WXK_MENU, - WXK_PAUSE, - WXK_PRIOR, * Page up * - WXK_NEXT, * Page down * - WXK_END, - WXK_HOME, - WXK_LEFT, - WXK_UP, - WXK_RIGHT, - WXK_DOWN, - WXK_SELECT, - WXK_PRINT, - WXK_EXECUTE, - WXK_SNAPSHOT, - WXK_INSERT, - WXK_HELP, - WXK_MULTIPLY, - WXK_ADD, - WXK_SEPARATOR, - WXK_SUBTRACT, - WXK_DECIMAL, - WXK_DIVIDE, - WXK_PAGEUP, - WXK_PAGEDOWN, - - WXK_NUMPAD_SPACE, - WXK_NUMPAD_TAB, - WXK_NUMPAD_ENTER, - WXK_NUMPAD_HOME, - WXK_NUMPAD_LEFT, - WXK_NUMPAD_UP, - WXK_NUMPAD_RIGHT, - WXK_NUMPAD_DOWN, - WXK_NUMPAD_PRIOR, - WXK_NUMPAD_PAGEUP, - WXK_NUMPAD_NEXT, - WXK_NUMPAD_PAGEDOWN, - WXK_NUMPAD_END, - WXK_NUMPAD_BEGIN, - WXK_NUMPAD_INSERT, - WXK_NUMPAD_DELETE, - WXK_NUMPAD_EQUAL, - WXK_NUMPAD_MULTIPLY, - WXK_NUMPAD_ADD, - WXK_NUMPAD_SEPARATOR, - WXK_NUMPAD_SUBTRACT, - WXK_NUMPAD_DECIMAL, - WXK_NUMPAD_DIVIDE, - - WXK_WINDOWS_LEFT, - WXK_WINDOWS_RIGHT, - WXK_WINDOWS_MENU , - WXK_COMMAND - }; - - */ -enum -{ - WXK_RSHIFT = 400, - WXK_RALT, - WXK_RCONTROL, - WXK_RMENU - -}; - -bool wxHIDKeyboard::Create() -{ - return wxHIDDevice::Create(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard); -} - -void wxHIDKeyboard::BuildCookies(wxCFArray& Array) -{ - Array = CFDictionaryGetValue((CFDictionaryRef)Array[0], CFSTR(kIOHIDElementKey)); - InitCookies(500); - int i, - nUsage; - for (i = 0; i < Array.Count(); ++i) - { - CFNumberGetValue( - (CFNumberRef) CFDictionaryGetValue((CFDictionaryRef) Array[i], CFSTR(kIOHIDElementUsageKey)), - kCFNumberLongType, &nUsage); - - if (nUsage >= kHIDUsage_KeyboardA && nUsage <= kHIDUsage_KeyboardZ) - AddCookie(Array[i], 'A' + (nUsage - kHIDUsage_KeyboardA) ); - else if (nUsage >= kHIDUsage_Keyboard1 && nUsage <= kHIDUsage_Keyboard9) - AddCookie(Array[i], '1' + (nUsage - kHIDUsage_Keyboard1) ); - else if (nUsage >= kHIDUsage_KeyboardF1 && nUsage <= kHIDUsage_KeyboardF12) - AddCookie(Array[i], WXK_F1 + (nUsage - kHIDUsage_KeyboardF1) ); - else if (nUsage >= kHIDUsage_KeyboardF13 && nUsage <= kHIDUsage_KeyboardF24) - AddCookie(Array[i], WXK_F13 + (nUsage - kHIDUsage_KeyboardF13) ); - else if (nUsage >= kHIDUsage_Keypad1 && nUsage <= kHIDUsage_Keypad9) - AddCookie(Array[i], WXK_NUMPAD1 + (nUsage - kHIDUsage_Keypad1) ); - else switch (nUsage) - { - //0's (wx & ascii go 0-9, but HID goes 1-0) - case kHIDUsage_Keyboard0: - AddCookie(Array[i],'0'); - break; - case kHIDUsage_Keypad0: - AddCookie(Array[i],WXK_NUMPAD0); - break; - - //Basic - case kHIDUsage_KeyboardReturnOrEnter: - AddCookie(Array[i], WXK_RETURN); - break; - case kHIDUsage_KeyboardEscape: - AddCookie(Array[i], WXK_ESCAPE); - break; - case kHIDUsage_KeyboardDeleteOrBackspace: - AddCookie(Array[i], WXK_BACK); - break; - case kHIDUsage_KeyboardTab: - AddCookie(Array[i], WXK_TAB); - break; - case kHIDUsage_KeyboardSpacebar: - AddCookie(Array[i], WXK_SPACE); - break; - case kHIDUsage_KeyboardPageUp: - AddCookie(Array[i], WXK_PRIOR); - break; - case kHIDUsage_KeyboardEnd: - AddCookie(Array[i], WXK_END); - break; - case kHIDUsage_KeyboardPageDown: - AddCookie(Array[i], WXK_NEXT); - break; - case kHIDUsage_KeyboardRightArrow: - AddCookie(Array[i], WXK_RIGHT); - break; - case kHIDUsage_KeyboardLeftArrow: - AddCookie(Array[i], WXK_LEFT); - break; - case kHIDUsage_KeyboardDownArrow: - AddCookie(Array[i], WXK_DOWN); - break; - case kHIDUsage_KeyboardUpArrow: - AddCookie(Array[i], WXK_UP); - break; - - //LEDS - case kHIDUsage_KeyboardCapsLock: - AddCookie(Array[i],WXK_CAPITAL); - break; - case kHIDUsage_KeypadNumLock: - AddCookie(Array[i],WXK_NUMLOCK); - break; - case kHIDUsage_KeyboardScrollLock: - AddCookie(Array[i],WXK_SCROLL); - break; - - //Menu keys, Shift, other specials - case kHIDUsage_KeyboardLeftControl: - AddCookie(Array[i],WXK_CONTROL); - break; - case kHIDUsage_KeyboardLeftShift: - AddCookie(Array[i],WXK_SHIFT); - break; - case kHIDUsage_KeyboardLeftAlt: - AddCookie(Array[i],WXK_ALT); - break; - case kHIDUsage_KeyboardLeftGUI: - AddCookie(Array[i],WXK_MENU); - break; - case kHIDUsage_KeyboardRightControl: - AddCookie(Array[i],WXK_RCONTROL); - break; - case kHIDUsage_KeyboardRightShift: - AddCookie(Array[i],WXK_RSHIFT); - break; - case kHIDUsage_KeyboardRightAlt: - AddCookie(Array[i],WXK_RALT); - break; - case kHIDUsage_KeyboardRightGUI: - AddCookie(Array[i],WXK_RMENU); - break; - - //Default - default: - //not in wx keycodes - do nothing.... - break; - } - } -}//end buildcookies diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp deleted file mode 100644 index bd1937bc2a..0000000000 --- a/src/mac/carbon/icon.cpp +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.cpp -// Purpose: wxIcon class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "icon.h" -#endif - -#include "wx/icon.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap) -#endif - -#include "wx/mac/private.h" - - -/* - * Icons - */ - -wxIcon::wxIcon() -{ -} - -wxIcon::wxIcon(const char bits[], int width, int height) : - wxBitmap(bits, width, height) -{ - -} - -wxIcon::wxIcon( const char **bits ) : - wxBitmap(bits) -{ -} - -wxIcon::wxIcon( char **bits ) : - wxBitmap(bits) -{ -} - -wxIcon::wxIcon(const wxString& icon_file, int flags, - int desiredWidth, int desiredHeight) -{ - LoadFile(icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight); -} - -wxIcon::~wxIcon() -{ -} - -bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, - int desiredWidth, int desiredHeight) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - wxBitmapHandler *handler = FindHandler((wxBitmapType)type); - - if ( handler ) - return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight); - else - return FALSE; -} - -void wxIcon::CopyFromBitmap(const wxBitmap& bmp) -{ - wxIcon *icon = (wxIcon*)(&bmp); - *this = *icon; -} - -IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler) - -bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - short theId = -1 ; - if ( name == wxT("wxICON_INFORMATION") ) - { - theId = kNoteIcon ; - } - else if ( name == wxT("wxICON_QUESTION") ) - { - theId = kCautionIcon ; - } - else if ( name == wxT("wxICON_WARNING") ) - { - theId = kCautionIcon ; - } - else if ( name == wxT("wxICON_ERROR") ) - { - theId = kStopIcon ; - } - else - { - Str255 theName ; - OSType theType ; - wxMacStringToPascal( name , theName ) ; - - Handle resHandle = GetNamedResource( 'cicn' , theName ) ; - if ( resHandle != 0L ) - { - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - } - } - if ( theId != -1 ) - { - CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ; - if ( theIcon ) - { - M_BITMAPHANDLERDATA->m_hIcon = theIcon ; - M_BITMAPHANDLERDATA->m_width = 32 ; - M_BITMAPHANDLERDATA->m_height = 32 ; - - M_BITMAPHANDLERDATA->m_depth = 8 ; - M_BITMAPHANDLERDATA->m_ok = true ; - M_BITMAPHANDLERDATA->m_numColors = 256 ; - M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeIcon ; - return TRUE ; - } - } - return FALSE ; -} diff --git a/src/mac/carbon/joystick.cpp b/src/mac/carbon/joystick.cpp deleted file mode 100644 index 156b9b2657..0000000000 --- a/src/mac/carbon/joystick.cpp +++ /dev/null @@ -1,286 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.cpp -// Purpose: wxJoystick class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "joystick.h" -#endif - -#include "wx/setup.h" - -#include "wx/joystick.h" - -#if wxUSE_JOYSTICK - -IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -wxPoint wxJoystick::GetPosition() const -{ - // TODO - return wxPoint(0, 0); -} - -int wxJoystick::GetZPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetButtonState() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVCTSPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMovementThreshold() const -{ - // TODO - return 0; -} - -void wxJoystick::SetMovementThreshold(int threshold) -{ - // TODO -} - -// Capabilities -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::IsOk() const -{ - // TODO - return FALSE; -} - -int wxJoystick::GetNumberJoysticks() const -{ - // TODO - return 0; -} - -int wxJoystick::GetManufacturerId() const -{ - // TODO - return 0; -} - -int wxJoystick::GetProductId() const -{ - // TODO - return 0; -} - -wxString wxJoystick::GetProductName() const -{ - // TODO - return wxString(wxT("")); -} - -int wxJoystick::GetXMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetXMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMax() const -{ - // TODO - return 0; -} - -bool wxJoystick::HasRudder() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasZ() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasU() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV4Dir() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOVCTS() const -{ - // TODO - return FALSE; -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) -{ - // TODO - return FALSE; -} - -bool wxJoystick::ReleaseCapture() -{ - // TODO - return FALSE; -} - -#endif - // wxUSE_JOYSTICK - diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp deleted file mode 100644 index 8322a7a2f2..0000000000 --- a/src/mac/carbon/listbox.cpp +++ /dev/null @@ -1,1023 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp -// Purpose: wxListBox -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "listbox.h" -#endif - -#include "wx/app.h" -#include "wx/listbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/toplevel.h" -#include "wx/dynarray.h" -#include "wx/log.h" - -#include "wx/utils.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) - -BEGIN_EVENT_TABLE(wxListBox, wxControl) - EVT_SIZE( wxListBox::OnSize ) - EVT_CHAR( wxListBox::OnChar ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} ldefRec, *ldefPtr, **ldefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#if TARGET_CARBON -const short kwxMacListItemHeight = 19 ; -#else -const short kwxMacListItemHeight = 14 ; -#endif - -extern "C" -{ -static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) ; -} - -static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) -{ - wxListBox* list; - list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); - if ( list == NULL ) - return ; - - GrafPtr savePort; - GrafPtr grafPtr; - RgnHandle savedClipRegion; - SInt32 savedPenMode; - GetPort(&savePort); - SetPort((**listHandle).port); - grafPtr = (**listHandle).port ; - // typecast our refCon - - // Calculate the cell rect. - - switch( message ) { - case lInitMsg: - break; - - case lCloseMsg: - break; - - case lDrawMsg: - { - const wxString linetext = list->m_stringArray[cell.v] ; - - // Save the current clip region, and set the clip region to the area we are about - // to draw. - - savedClipRegion = NewRgn(); - GetClip( savedClipRegion ); - - ClipRect( drawRect ); - EraseRect( drawRect ); - - const wxFont& font = list->GetFont(); - if ( font.Ok() ) - { - ::TextFont( font.GetMacFontNum() ) ; - ::TextSize( font.GetMacFontSize() ) ; - ::TextFace( font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - -#if TARGET_CARBON - { - Rect frame = { drawRect->top, drawRect->left + 4, - drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ; - CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ; - ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ; - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - CFRelease( mString ) ; - } -#else - { - wxCharBuffer text = linetext.mb_str( wxConvLocal) ; - MoveTo(drawRect->left + 4 , drawRect->top + 10 ); - DrawText(text, 0 , strlen(text) ); - } -#endif - // If the cell is hilited, do the hilite now. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - if( isSelected ) { - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr)grafPtr, savedPenMode ); - } - - // Restore the saved clip region. - - SetClip( savedClipRegion ); - DisposeRgn( savedClipRegion ); - } - break; - case lHiliteMsg: - - // Hilite or unhilite the cell. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - GetPort( &grafPtr ); - savedPenMode = GetPortPenMode( (CGrafPtr)grafPtr ); - SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr)grafPtr, savedPenMode ); - break; - default : - break ; - } - SetPort(savePort); -} - -extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ; -// resources ldef ids -const short kwxMacListWithVerticalScrollbar = 128 ; -const short kwxMacListWithVerticalAndHorizontalScrollbar = 129 ; - -// ============================================================================ -// list box control implementation -// ============================================================================ - -// Listbox item -wxListBox::wxListBox() -{ - m_noItems = 0; - m_selected = 0; - m_macList = NULL ; -} - -static ListDefUPP macListDefUPP = NULL ; - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) - return false; - - m_noItems = 0 ; // this will be increased by our append command - m_selected = 0; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - - ListDefSpec listDef; - listDef.defType = kListDefUserProcType; - if ( macListDefUPP == NULL ) - { - macListDefUPP = NewListDefUPP( wxMacListDefinition ); - } - listDef.u.userProc = macListDefUPP ; - - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; -#if TARGET_CARBON - GetThemeFont(kThemeViewsFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; -#else - GetFontName( kFontIDMonaco , fontName ) ; - fontSize = 9 ; - fontStyle = normal ; -#endif - SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , wxMacMakeStringFromPascal( fontName ) ) ) ; -#if TARGET_CARBON - Size asize; - - - CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, (style & wxLB_HSCROLL), true, - kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl ); - - GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, - sizeof(ListHandle), (Ptr) &m_macList, &asize); - - SetControlReference( (ControlHandle) m_macControl, (long) this); - SetControlVisibility( (ControlHandle) m_macControl, false, false); - -#else - - long result ; - wxStAppResource resload ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , - (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , - 0 , 0, kControlListBoxProc , (long) this ) ; - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , - sizeof( ListHandle ) , (char*) &m_macList , &result ) ; - - HLock( (Handle) m_macList ) ; - ldefHandle ldef ; - ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ; - if ( (**(ListHandle)m_macList).listDefProc != NULL ) - { - (**ldef).instruction = 0x4EF9; /* JMP instruction */ - (**ldef).function = (void(*)()) listDef.u.userProc; - (**(ListHandle)m_macList).listDefProc = (Handle) ldef ; - } - - Point pt = (**(ListHandle)m_macList).cellSize ; - pt.v = kwxMacListItemHeight ; - LCellSize( pt , (ListHandle)m_macList ) ; - LAddColumn( 1 , 0 , (ListHandle)m_macList ) ; -#endif - OptionBits options = 0; - if ( style & wxLB_MULTIPLE ) - { - options += lExtendDrag + lUseSense ; - } - else if ( style & wxLB_EXTENDED ) - { - // default behaviour - } - else - { - options = (OptionBits) lOnlyOne ; - } - SetListSelectionFlags((ListHandle)m_macList, options); - - for ( int i = 0 ; i < n ; i++ ) - { - Append( choices[i] ) ; - } - - MacPostControlCreate() ; - - LSetDrawingMode( true , (ListHandle)m_macList ) ; - - return TRUE; -} - -wxListBox::~wxListBox() -{ - FreeData() ; - // avoid access during destruction - SetControlReference( (ControlHandle) m_macControl , NULL ) ; - if ( m_macList ) - { -#if !TARGET_CARBON - DisposeHandle( (**(ListHandle)m_macList).listDefProc ) ; - (**(ListHandle)m_macList).listDefProc = NULL ; -#endif - m_macList = NULL ; - } -} - -void wxListBox::FreeData() -{ -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) - { - size_t uiCount = m_aItems.Count(); - while ( uiCount-- != 0 ) { - delete m_aItems[uiCount]; - m_aItems[uiCount] = NULL; - } - - m_aItems.Clear(); - } - else -#endif // wxUSE_OWNER_DRAWN - if ( HasClientObjectData() ) - { - for ( size_t n = 0; n < (size_t)m_noItems; n++ ) - { - delete GetClientObject(n); - } - } -} - -void wxListBox::DoSetSize(int x, int y, - int width, int height, - int sizeFlags ) -{ - wxControl::DoSetSize( x , y , width , height , sizeFlags ) ; -#if TARGET_CARBON - Rect bounds ; - GetControlBounds( (ControlHandle) m_macControl , &bounds ) ; - ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ; - if ( control ) - { - Rect scrollbounds ; - GetControlBounds( control , &scrollbounds ) ; - if( scrollbounds.right != bounds.right + 1 ) - { - UMAMoveControl( control , bounds.right - (scrollbounds.right - scrollbounds.left) + 1 , - scrollbounds.top ) ; - } - } -#endif -} -void wxListBox::DoSetFirstItem(int N) -{ - MacScrollTo( N ) ; -} - -void wxListBox::Delete(int N) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::Delete") ); - -#if wxUSE_OWNER_DRAWN - delete m_aItems[N]; - m_aItems.RemoveAt(N); -#else // !wxUSE_OWNER_DRAWN - if ( HasClientObjectData() ) - { - delete GetClientObject(N); - } -#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN - m_stringArray.RemoveAt( N ) ; - m_dataArray.RemoveAt( N ) ; - m_noItems --; - - MacDelete( N ) ; -} - -int wxListBox::DoAppend(const wxString& item) -{ - int index = m_noItems ; - m_stringArray.Add( item ) ; - m_dataArray.Add( NULL ); - m_noItems ++; - DoSetItemClientData( index , NULL ) ; - MacAppend( item ) ; - - return index ; -} - -void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) -{ - MacSetRedraw( false ) ; - Clear() ; - int n = choices.GetCount(); - - for( int i = 0 ; i < n ; ++i ) - { - if ( clientData ) - { -#if wxUSE_OWNER_DRAWN - wxASSERT_MSG(clientData[i] == NULL, - wxT("Can't use client data with owner-drawn listboxes")); -#else // !wxUSE_OWNER_DRAWN - Append( choices[i] , clientData[i] ) ; -#endif - } - else - Append( choices[i] ) ; - } - -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) { - // first delete old items - size_t ui = m_aItems.Count(); - while ( ui-- != 0 ) { - delete m_aItems[ui]; - m_aItems[ui] = NULL; - } - m_aItems.Empty(); - - // then create new ones - for ( ui = 0; ui < (size_t)m_noItems; ui++ ) { - wxOwnerDrawn *pNewItem = CreateItem(ui); - pNewItem->SetName(choices[ui]); - m_aItems.Add(pNewItem); - } - } -#endif // wxUSE_OWNER_DRAWN - MacSetRedraw( true ) ; -} - -bool wxListBox::HasMultipleSelection() const -{ - return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED); -} - -int wxListBox::FindString(const wxString& s) const -{ - - if ( s.Right(1) == wxT("*") ) - { - wxString search = s.Left( s.Length() - 1 ) ; - int len = search.Length() ; - Str255 s1 , s2 ; - wxMacStringToPascal( search , s2 ) ; - - for ( int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ; - - if ( EqualString( s1 , s2 , false , false ) ) - return i ; - } - if ( s.Left(1) == wxT("*") && s.Length() > 1 ) - { - wxString st = s ; - st.MakeLower() ; - for ( int i = 0 ; i < m_noItems ; ++i ) - { - if ( GetString(i).Lower().Matches(st) ) - return i ; - } - } - - } - else - { - Str255 s1 , s2 ; - - wxMacStringToPascal( s , s2 ) ; - - for ( int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i] , s1 ) ; - - if ( EqualString( s1 , s2 , false , false ) ) - return i ; - } - } - return -1; -} - -void wxListBox::Clear() -{ - FreeData(); - m_noItems = 0; - m_stringArray.Empty() ; - m_dataArray.Empty() ; - MacClear() ; -} - -void wxListBox::SetSelection(int N, bool select) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::SetSelection") ); - MacSetSelection( N , select ) ; - GetSelections( m_selectionPreImage ) ; -} - -bool wxListBox::IsSelected(int N) const -{ - wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE, - wxT("invalid index in wxListBox::Selected") ); - - return MacIsSelected( N ) ; -} - -void *wxListBox::DoGetItemClientData(int N) const -{ - wxCHECK_MSG( N >= 0 && N < m_noItems, NULL, - wxT("invalid index in wxListBox::GetClientData")); - - return (void *)m_dataArray[N]; -} - -wxClientData *wxListBox::DoGetItemClientObject(int N) const -{ - return (wxClientData *) DoGetItemClientData( N ) ; -} - -void wxListBox::DoSetItemClientData(int N, void *Client_data) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::SetClientData") ); - -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) - { - // client data must be pointer to wxOwnerDrawn, otherwise we would crash - // in OnMeasure/OnDraw. - wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes")); - } -#endif // wxUSE_OWNER_DRAWN - wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ; - - if ( m_dataArray.GetCount() > (size_t) N ) - { - m_dataArray[N] = (char*) Client_data ; - } - else - { - m_dataArray.Add( (char*) Client_data ) ; - } -} - -void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData) -{ - DoSetItemClientData(n, clientData); -} - -// Return number of selections and an array of selected integers -int wxListBox::GetSelections(wxArrayInt& aSelections) const -{ - return MacGetSelections( aSelections ) ; -} - -// Get single selection, for single choice list items -int wxListBox::GetSelection() const -{ - return MacGetSelection() ; -} - -// Find string for position -wxString wxListBox::GetString(int N) const -{ - return m_stringArray[N] ; -} - -void wxListBox::DoInsertItems(const wxArrayString& items, int pos) -{ - wxCHECK_RET( pos >= 0 && pos <= m_noItems, - wxT("invalid index in wxListBox::InsertItems") ); - - int nItems = items.GetCount(); - - for ( int i = 0 ; i < nItems ; i++ ) - { - m_stringArray.Insert( items[i] , pos + i ) ; - m_dataArray.Insert( NULL , pos + i ) ; - MacInsert( pos + i , items[i] ) ; - } - - m_noItems += nItems; -} - -void wxListBox::SetString(int N, const wxString& s) -{ - m_stringArray[N] = s ; - MacSet( N , s ) ; -} - -wxSize wxListBox::DoGetBestSize() const -{ - int lbWidth = 100; // some defaults - int lbHeight = 110; - int wLine; - - { - wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( m_font.GetMacFontSize() ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - - // Find the widest line - for(int i = 0; i < GetCount(); i++) { - wxString str(GetString(i)); - #if wxUSE_UNICODE - Point bounds={0,0} ; - SInt16 baseline ; - ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) , - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - wLine = bounds.h ; - #else - wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ; - #endif - lbWidth = wxMax(lbWidth, wLine); - } - - // Add room for the scrollbar - lbWidth += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); - - // And just a bit more - int cy = 12 ; - int cx = ::TextWidth( "X" , 0 , 1 ) ; - lbWidth += cx ; - - // don't make the listbox too tall (limit height to around 10 items) but don't - // make it too small neither - lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10); - } - return wxSize(lbWidth, lbHeight); -} - -int wxListBox::GetCount() const -{ - return m_noItems; -} - -void wxListBox::SetupColours() -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetForegroundColour(GetParent()->GetForegroundColour()); -} - -void wxListBox::Refresh(bool eraseBack, const wxRect *rect) -{ - wxControl::Refresh( eraseBack , rect ) ; - // MacRedrawControl() ; -} - -#if wxUSE_OWNER_DRAWN - -class wxListBoxItem : public wxOwnerDrawn -{ -public: - wxListBoxItem(const wxString& str = ""); -}; - -wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE) -{ - // no bitmaps/checkmarks - SetMarginWidth(0); -} - -wxOwnerDrawn *wxListBox::CreateItem(size_t n) -{ - return new wxListBoxItem(); -} - -#endif //USE_OWNER_DRAWN - -// ============================================================================ -// list box control implementation -// ============================================================================ - -/* -void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) -{ -wxListBox* list; -// typecast our refCon -list = (wxListBox*)refCon; - - MoveTo(cellRect->left + 4 , cellRect->top + 10 ); - const wxString text = list->m_stringArray[lCell.v] ; - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - DrawText(text, 0 , text.Length()); - - } -*/ -void wxListBox::MacDelete( int N ) -{ - LDelRow( 1 , N , (ListHandle)m_macList) ; - Refresh(); -} - -void wxListBox::MacInsert( int n , const wxString& text) -{ - Cell cell = { 0 , 0 } ; - cell.v = n ; - LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacAppend( const wxString& text) -{ - Cell cell = { 0 , 0 } ; - cell.v = (**(ListHandle)m_macList).dataBounds.bottom ; - LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacClear() -{ - LDelRow( (**(ListHandle)m_macList).dataBounds.bottom , 0 ,(ListHandle) m_macList ) ; - Refresh(); -} - -void wxListBox::MacSetSelection( int n , bool select ) -{ - Cell cell = { 0 , 0 } ; - if ( ! (m_windowStyle & wxLB_MULTIPLE) ) - { - if ( LGetSelect( true , &cell , (ListHandle)m_macList ) ) - { - LSetSelect( false , cell , (ListHandle)m_macList ) ; - } - } - - cell.v = n ; - LSetSelect( select , cell , (ListHandle)m_macList ) ; - LAutoScroll( (ListHandle)m_macList ) ; - Refresh(); -} - -bool wxListBox::MacIsSelected( int n ) const -{ - Cell cell = { 0 , 0 } ; - cell.v = n ; - return LGetSelect( false , &cell , (ListHandle)m_macList ) ; -} - -void wxListBox::MacDestroy() -{ - // DisposeExtLDEFInfo( m_macList ) ; -} - -int wxListBox::MacGetSelection() const -{ - Cell cell = { 0 , 0 } ; - if ( LGetSelect( true , &cell , (ListHandle)m_macList ) ) - return cell.v ; - else - return -1 ; -} - -int wxListBox::MacGetSelections( wxArrayInt& aSelections ) const -{ - int no_sel = 0 ; - - aSelections.Empty(); - - Cell cell = { 0 , 0 } ; - cell.v = 0 ; - - while ( LGetSelect( true , &cell ,(ListHandle) m_macList ) ) - { - aSelections.Add( cell.v ) ; - no_sel++ ; - cell.v++ ; - } - return no_sel ; -} - -void wxListBox::MacSet( int n , const wxString& text ) -{ - // our implementation does not store anything in the list - // so we just have to redraw - Cell cell = { 0 , 0 } ; - cell.v = n ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacScrollTo( int n ) -{ - // TODO implement scrolling -} - -void wxListBox::OnSize( wxSizeEvent &event) -{ - Point pt; - -#if TARGET_CARBON - GetListCellSize((ListHandle)m_macList, &pt); -#else - pt = (**(ListHandle)m_macList).cellSize ; -#endif - pt.h = m_width - 15 ; - LCellSize( pt , (ListHandle)m_macList ) ; -} - -void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - Boolean wasDoubleClick = false ; - long result ; - - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ; - if ( !wasDoubleClick ) - { - MacDoClick() ; - } - else - { - MacDoDoubleClick() ; - } -} - -void wxListBox::MacSetRedraw( bool doDraw ) -{ - LSetDrawingMode( doDraw , (ListHandle)m_macList ) ; - -} - -void wxListBox::MacDoClick() -{ - wxArrayInt aSelections; - int n ; - size_t count = GetSelections(aSelections); - - if ( count == m_selectionPreImage.GetCount() ) - { - bool hasChanged = false ; - for ( size_t i = 0 ; i < count ; ++i ) - { - if ( aSelections[i] != m_selectionPreImage[i] ) - { - hasChanged = true ; - break ; - } - } - if ( !hasChanged ) - { - return ; - } - } - - m_selectionPreImage = aSelections; - - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - if ( count > 0 ) - { - n = aSelections[0]; - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - event.SetString( GetString(n) ); - } - else - { - n = -1; - } - - event.m_commandInt = n; - - GetEventHandler()->ProcessEvent(event); -} - -void wxListBox::MacDoDoubleClick() -{ - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, m_windowId); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event) ; -} - -void wxListBox::OnChar(wxKeyEvent& event) -{ - if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER) - { - wxWindow* parent = GetParent() ; - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) - parent = parent->GetParent() ; - - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - event.Skip() ; - } - /* generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) */ - else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) ) - { - // FIXME: look in ancestors, not just parent. - wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ; - if (win) - { - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); - new_event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( new_event ); - } - } - else if ( event.GetKeyCode() == WXK_TAB ) - { - wxNavigationKeyEvent new_event; - new_event.SetEventObject( this ); - new_event.SetDirection( !event.ShiftDown() ); - /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - new_event.SetWindowChange( event.ControlDown() ); - new_event.SetCurrentFocus( this ); - if ( !GetEventHandler()->ProcessEvent( new_event ) ) - event.Skip() ; - } - else if ( event.GetKeyCode() == WXK_DOWN || event.GetKeyCode() == WXK_UP ) - { - // perform the default key handling first - wxControl::OnKeyDown( event ) ; - - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - wxArrayInt aSelections; - int n, count = GetSelections(aSelections); - if ( count > 0 ) - { - n = aSelections[0]; - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - event.SetString( GetString(n) ); - } - else - { - n = -1; - } - - event.m_commandInt = n; - - GetEventHandler()->ProcessEvent(event); - } - else - { - if ( event.GetTimestamp() > m_lastTypeIn + 60 ) - { - m_typeIn = wxEmptyString ; - } - m_lastTypeIn = event.GetTimestamp() ; - m_typeIn += (char) event.GetKeyCode() ; - int line = FindString(wxT("*")+m_typeIn+wxT("*")) ; - if ( line >= 0 ) - { - if ( GetSelection() != line ) - { - SetSelection(line) ; - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject( line ) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(line) ); - event.SetString( GetString(line) ); - - event.m_commandInt = line ; - - GetEventHandler()->ProcessEvent(event); - } - } - } -} - diff --git a/src/mac/carbon/macnotfy.cpp b/src/mac/carbon/macnotfy.cpp deleted file mode 100644 index 690f83b214..0000000000 --- a/src/mac/carbon/macnotfy.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: Mac Notifier Support - * Name: macnotfy.c - * Author: Stefan CSomor - * Purpose: Mac Notifier main file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#include "wx/wx.h" - -#include "wx/mac/private.h" - -#include "wx/mac/macnotfy.h" - -const short kMaxEvents = 1000 ; - -struct wxMacNotificationEvents -{ - short top ; - short bottom ; - - wxMacNotificationProcPtr proc[kMaxEvents] ; - unsigned long events[kMaxEvents] ; - void* data[kMaxEvents] ; -} ; - -typedef struct wxMacNotificationEvents wxMacNotificationEvents ; -static wxMacNotificationEvents gMacNotificationEvents ; - -static ProcessSerialNumber gAppProcess ; - -void wxMacWakeUp() -{ - ProcessSerialNumber psn ; - Boolean isSame ; - psn.highLongOfPSN = 0 ; - psn.lowLongOfPSN = kCurrentProcess ; - SameProcess( &gAppProcess , &psn , &isSame ) ; - if ( isSame ) - { -#if TARGET_CARBON - EventRef dummyEvent ; - OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(), - kEventAttributeNone, &dummyEvent); - if (err == noErr) - { - err = PostEventToQueue(GetMainEventQueue(), dummyEvent, - kEventPriorityHigh); - } -#else - PostEvent( nullEvent , 0 ) ; -#endif - } - else - { - WakeUpProcess( &gAppProcess ) ; - } -} - -void wxMacCreateNotifierTable() -{ - GetCurrentProcess(&gAppProcess); - gMacNotificationEvents.top = 0 ; - gMacNotificationEvents.bottom = 0 ; - for ( int i = 0 ; i < kMaxEvents ; ++i ) - { - gMacNotificationEvents.proc[i] = NULL ; - gMacNotificationEvents.events[i] = NULL ; - gMacNotificationEvents.data[i] = NULL ; - } -} - -void wxMacDestroyNotifierTable() -{ -} - -wxMacNotifierTableRef wxMacGetNotifierTable() -{ - return (wxMacNotifierTableRef) &gMacNotificationEvents ; -} - -void wxMacAddEvent( - wxMacNotifierTableRef table , - wxMacNotificationProcPtr handler , - unsigned long event , - void* data , - short wakeUp ) -{ - wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ; - wxASSERT_MSG( handler != NULL , wxT("illegal notification proc ptr") ) ; - /* this should be protected eventually */ - short index = e->top++ ; - - if ( e->top == kMaxEvents ) - e->top = 0 ; - - e->proc[index] = handler ; - e->events[index] = event ; - e->data[index] = data ; - if ( wakeUp ) - wxMacWakeUp() ; -} - -bool gInProcessing = false ; - -void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data ) -{ - wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ; - /* this should be protected eventually */ - short index = e->bottom ; - - while ( e->top != index ) - { - if ( e->data[index] == data ) - e->data[index] = NULL ; - index++ ; - if ( index == kMaxEvents ) - index = 0 ; - } -} - -void wxMacProcessNotifierEvents() -{ - // if ( gInProcessing ) - // return ; - - gInProcessing = true ; - if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom ) - { - // we only should process the notifiers that were here when we entered it - // otherwise we might never get out... - short count = gMacNotificationEvents.top - gMacNotificationEvents.bottom ; - if ( count < 0 ) - count += kMaxEvents ; - - while ( count-- ) - { - // consume event at bottom - short index = gMacNotificationEvents.bottom++ ; - if ( gMacNotificationEvents.bottom == kMaxEvents ) - gMacNotificationEvents.bottom = 0 ; - void* data = gMacNotificationEvents.data[index] ; - unsigned long event = gMacNotificationEvents.events[index] ; - wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ; - - gMacNotificationEvents.data[index] = NULL ; - gMacNotificationEvents.events[index] = NULL ; - gMacNotificationEvents.proc[index] = NULL ; - - if ( handler ) - handler( event , data ) ; - } - } - gInProcessing = false ; -} - -void wxMacProcessNotifierAndPendingEvents() -{ - wxMacProcessNotifierEvents() ; - wxTheApp->ProcessPendingEvents() ; -} diff --git a/src/mac/carbon/main.cpp b/src/mac/carbon/main.cpp deleted file mode 100644 index ad5bd33263..0000000000 --- a/src/mac/carbon/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: main.cpp -// Purpose: Entry point -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// We don't put main() in the library any more. GD. diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp deleted file mode 100644 index add9482e11..0000000000 --- a/src/mac/carbon/mdi.cpp +++ /dev/null @@ -1,395 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.cpp -// Purpose: MDI classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mdi.h" -#endif - -#include "wx/mdi.h" -#include "wx/menu.h" -#include "wx/settings.h" -#include "wx/log.h" - -#include "wx/mac/private.h" -#include "wx/mac/uma.h" - -extern wxWindowList wxModelessWindows; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_ACTIVATE(wxMDIParentFrame::OnActivate) - EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow) - EVT_SCROLL(wxMDIClientWindow::OnScroll) -END_EVENT_TABLE() - -#endif - -static const int IDM_WINDOWTILE = 4001; -static const int IDM_WINDOWTILEHOR = 4001; -static const int IDM_WINDOWCASCADE = 4002; -static const int IDM_WINDOWICONS = 4003; -static const int IDM_WINDOWNEXT = 4004; -static const int IDM_WINDOWTILEVERT = 4005; -static const int IDM_WINDOWPREV = 4006; - -// This range gives a maximum of 500 MDI children. Should be enough :-) -static const int wxFIRST_MDI_CHILD = 4100; -static const int wxLAST_MDI_CHILD = 4600; - -// Status border dimensions -static const int wxTHICK_LINE_BORDER = 3; - -// Parent frame - -wxMDIParentFrame::wxMDIParentFrame() -{ - m_clientWindow = NULL; - m_currentChild = NULL; - m_windowMenu = (wxMenu*) NULL; - m_parentFrameActive = TRUE; -} - -bool wxMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_clientWindow = NULL; - m_currentChild = NULL; - - // this style can be used to prevent a window from having the standard MDI - // "Window" menu - if ( style & wxFRAME_NO_WINDOW_MENU ) - { - m_windowMenu = (wxMenu *)NULL; - style -= wxFRAME_NO_WINDOW_MENU ; - } - else // normal case: we have the window menu, so construct it - { - m_windowMenu = new wxMenu; - - m_windowMenu->Append(IDM_WINDOWCASCADE, wxT("&Cascade")); - m_windowMenu->Append(IDM_WINDOWTILEHOR, wxT("Tile &Horizontally")); - m_windowMenu->Append(IDM_WINDOWTILEVERT, wxT("Tile &Vertically")); - m_windowMenu->AppendSeparator(); - m_windowMenu->Append(IDM_WINDOWICONS, wxT("&Arrange Icons")); - m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next")); - } - - wxFrame::Create( parent , id , title , pos , size , style , name ) ; - m_parentFrameActive = TRUE; - - OnCreateClient(); - - return TRUE; -} - -wxMDIParentFrame::~wxMDIParentFrame() -{ - DestroyChildren(); - // already delete by DestroyChildren() -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif - m_clientWindow = NULL ; - - if (m_windowMenu) - { - delete m_windowMenu; - m_windowMenu = (wxMenu*) NULL; - } - - if ( m_clientWindow ) - { - delete m_clientWindow; - m_clientWindow = NULL ; - } -} - - -void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - wxFrame::SetMenuBar( menu_bar ) ; -} - -void wxMDIParentFrame::MacActivate(long timestamp, bool activating) -{ - wxLogDebug(wxT("MDI PARENT=%p MacActivate(0x%08lx,%s)"),this,timestamp,activating?wxT("ACTIV"):wxT("deact")); - if(activating) - { - if(s_macDeactivateWindow && s_macDeactivateWindow->GetParent()==this) - { - wxLogDebug(wxT("child had been scheduled for deactivation, rehighlighting")); - UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->MacGetWindowRef(), true); - wxLogDebug(wxT("done highliting child")); - s_macDeactivateWindow = NULL; - } - else if(s_macDeactivateWindow == this) - { - wxLogDebug(wxT("Avoided deactivation/activation of this=%p"), this); - s_macDeactivateWindow = NULL; - } - else // window to deactivate is NULL or is not us or one of our kids - { - // activate kid instead - if(m_currentChild) - m_currentChild->MacActivate(timestamp,activating); - else - wxFrame::MacActivate(timestamp,activating); - } - } - else - { - // We were scheduled for deactivation, and now we do it. - if(s_macDeactivateWindow==this) - { - s_macDeactivateWindow = NULL; - if(m_currentChild) - m_currentChild->MacActivate(timestamp,activating); - wxFrame::MacActivate(timestamp,activating); - } - else // schedule ourselves for deactivation - { - if(s_macDeactivateWindow) - wxLogDebug(wxT("window=%p SHOULD have been deactivated, oh well!"),s_macDeactivateWindow); - wxLogDebug(wxT("Scheduling delayed MDI Parent deactivation")); - s_macDeactivateWindow = this; - } - } -} - -void wxMDIParentFrame::OnActivate(wxActivateEvent& event) -{ - event.Skip(); -} - -// Returns the active MDI child window -wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const -{ - return m_currentChild ; -} - -// Create the client window class (don't Create the window, -// just return a new class) -wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() -{ - m_clientWindow = new wxMDIClientWindow( this ); - return m_clientWindow; -} - -// Responds to colour changes, and passes event on to children. -void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - // TODO - - // Propagate the event to the non-top-level children - wxFrame::OnSysColourChanged(event); -} - -// MDI operations -void wxMDIParentFrame::Cascade() -{ - // TODO -} - -void wxMDIParentFrame::Tile() -{ - // TODO -} - -void wxMDIParentFrame::ArrangeIcons() -{ - // TODO -} - -void wxMDIParentFrame::ActivateNext() -{ - // TODO -} - -void wxMDIParentFrame::ActivatePrevious() -{ - // TODO -} - -// Child frame - -wxMDIChildFrame::wxMDIChildFrame() -{ - Init() ; -} -void wxMDIChildFrame::Init() -{ -} - -bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - wxModelessWindows.Append(this); - return FALSE; -} - -wxMDIChildFrame::~wxMDIChildFrame() -{ - wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame); - wxASSERT(mdiparent); - if(mdiparent->m_currentChild == this) - mdiparent->m_currentChild = NULL; - DestroyChildren(); - // already delete by DestroyChildren() -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif -} - -void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - return wxFrame::SetMenuBar( menu_bar ) ; -} - -void wxMDIChildFrame::MacActivate(long timestamp, bool activating) -{ - wxLogDebug(wxT("MDI child=%p MacActivate(0x%08lx,%s)"),this,timestamp,activating?wxT("ACTIV"):wxT("deact")); - wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame); - wxASSERT(mdiparent); - if(activating) - { - if(s_macDeactivateWindow == m_parent) - { - wxLogDebug(wxT("parent had been scheduled for deactivation, rehighlighting")); - UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->MacGetWindowRef(), true); - wxLogDebug(wxT("done highliting parent")); - s_macDeactivateWindow = NULL; - } - else if((mdiparent->m_currentChild==this) || !s_macDeactivateWindow) - mdiparent->wxFrame::MacActivate(timestamp,activating); - - if(mdiparent->m_currentChild && mdiparent->m_currentChild!=this) - mdiparent->m_currentChild->wxFrame::MacActivate(timestamp,false); - mdiparent->m_currentChild = this; - - if(s_macDeactivateWindow==this) - { - wxLogDebug(wxT("Avoided deactivation/activation of this=%p"),this); - s_macDeactivateWindow=NULL; - } - else - wxFrame::MacActivate(timestamp, activating); - } - else - { - // We were scheduled for deactivation, and now we do it. - if(s_macDeactivateWindow==this) - { - s_macDeactivateWindow = NULL; - wxFrame::MacActivate(timestamp,activating); - if(mdiparent->m_currentChild==this) - mdiparent->wxFrame::MacActivate(timestamp,activating); - } - else // schedule ourselves for deactivation - { - if(s_macDeactivateWindow) - wxLogDebug(wxT("window=%p SHOULD have been deactivated, oh well!"),s_macDeactivateWindow); - wxLogDebug(wxT("Scheduling delayed deactivation")); - s_macDeactivateWindow = this; - } - } -} - -// MDI operations -void wxMDIChildFrame::Maximize() -{ - wxFrame::Maximize() ; -} - -void wxMDIChildFrame::Restore() -{ - wxFrame::Restore() ; -} - -void wxMDIChildFrame::Activate() -{ -} - -//----------------------------------------------------------------------------- -// wxMDIClientWindow -//----------------------------------------------------------------------------- - -wxMDIClientWindow::wxMDIClientWindow() -{ -} - -wxMDIClientWindow::~wxMDIClientWindow() -{ - DestroyChildren(); -} - -bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) -{ - - m_windowId = (int)NewControlId(); - - if ( parent ) - { - parent->AddChild(this); - } - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); - - wxModelessWindows.Append(this); - return TRUE; -} - -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const -{ - wxDisplaySize( x , y ) ; -} - -// Explicitly call default scroll behaviour -void wxMDIClientWindow::OnScroll(wxScrollEvent& event) -{ -} - diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp deleted file mode 100644 index 9a04c36935..0000000000 --- a/src/mac/carbon/menu.cpp +++ /dev/null @@ -1,881 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp -// Purpose: wxMenu, wxMenuBar, wxMenuItem -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "menu.h" -#pragma implementation "menuitem.h" -#endif - -// ============================================================================ -// headers & declarations -// ============================================================================ - -// wxWindows headers -// ----------------- - -#include "wx/app.h" -#include "wx/menu.h" -#include "wx/menuitem.h" -#include "wx/window.h" -#include "wx/log.h" -#include "wx/utils.h" -#include "wx/frame.h" - -#include "wx/mac/uma.h" - -// other standard headers -// ---------------------- -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) -#endif - -// the (popup) menu title has this special id -static const int idMenuTitle = -2; -static MenuItemIndex firstUserHelpMenuItem = 0 ; - -const short kwxMacMenuBarResource = 1 ; -const short kwxMacAppleMenuId = 1 ; - -// ============================================================================ -// implementation -// ============================================================================ -static void wxMenubarUnsetInvokingWindow( wxMenu *menu ) ; -static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ); - -// Menus - -// Construct a menu with optional title (then use append) - -#ifdef __DARWIN__ -short wxMenu::s_macNextMenuId = 3 ; -#else -short wxMenu::s_macNextMenuId = 2 ; -#endif - -void wxMenu::Init() -{ - m_doBreak = FALSE; - m_startRadioGroup = -1; - - // create the menu - m_macMenuId = s_macNextMenuId++; - m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() ); - - if ( !m_hMenu ) - { - wxLogLastError(wxT("UMANewMenu failed")); - } - - // if we have a title, insert it in the beginning of the menu - if ( !!m_title ) - { - Append(idMenuTitle, m_title) ; - AppendSeparator() ; - } -} - -wxMenu::~wxMenu() -{ - if (MAC_WXHMENU(m_hMenu)) - ::DisposeMenu(MAC_WXHMENU(m_hMenu)); -} - -void wxMenu::Break() -{ - // not available on the mac platform -} - -void wxMenu::Attach(wxMenuBarBase *menubar) -{ - wxMenuBase::Attach(menubar); - - EndRadioGroup(); -} - -// function appends a new item or submenu to the menu -// append a new item or submenu to the menu -bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) -{ - wxASSERT_MSG( pItem != NULL, wxT("can't append NULL item to the menu") ); - - if ( pItem->IsSeparator() ) - { - if ( pos == (size_t)-1 ) - MacAppendMenu(MAC_WXHMENU(m_hMenu), "\p-"); - else - MacInsertMenuItem(MAC_WXHMENU(m_hMenu), "\p-" , pos); - } - else - { - wxMenu *pSubMenu = pItem->GetSubMenu() ; - if ( pSubMenu != NULL ) - { - wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added")); - pSubMenu->m_menuParent = this ; - - if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar) - { - pSubMenu->MacBeforeDisplay( true ) ; - } - - if ( pos == (size_t)-1 ) - UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pSubMenu->m_macMenuId); - else - UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pos, pSubMenu->m_macMenuId); - pItem->UpdateItemBitmap() ; - pItem->UpdateItemStatus() ; - } - else - { - if ( pos == (size_t)-1 ) - { - UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , wxFont::GetDefaultEncoding() ); - pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ; - } - else - { - // MacOS counts menu items from 1 and inserts after, therefore having the - // same effect as wx 0 based and inserting before, we must correct pos - // after however for updates to be correct - UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos); - pos += 1 ; - } - - SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ; - pItem->UpdateItemText() ; - pItem->UpdateItemBitmap() ; - pItem->UpdateItemStatus() ; - - if ( pItem->GetId() == idMenuTitle ) - { - UMAEnableMenuItem(MAC_WXHMENU(m_hMenu) , pos , false ) ; - } - } - } - // if we're already attached to the menubar, we must update it - if ( IsAttached() ) - { - m_menuBar->Refresh(); - } - return TRUE ; -} - -void wxMenu::EndRadioGroup() -{ - // we're not inside a radio group any longer - m_startRadioGroup = -1; -} - -wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); - - bool check = FALSE; - - if ( item->GetKind() == wxITEM_RADIO ) - { - int count = GetMenuItemCount(); - - if ( m_startRadioGroup == -1 ) - { - // start a new radio group - m_startRadioGroup = count; - - // for now it has just one element - item->SetAsRadioGroupStart(); - item->SetRadioGroupEnd(m_startRadioGroup); - - // ensure that we have a checked item in the radio group - check = TRUE; - } - else // extend the current radio group - { - // we need to update its end item - item->SetRadioGroupStart(m_startRadioGroup); - wxMenuItemList::Node *node = GetMenuItems().Item(m_startRadioGroup); - - if ( node ) - { - node->GetData()->SetRadioGroupEnd(count); - } - else - { - wxFAIL_MSG( _T("where is the radio group start item?") ); - } - } - } - else // not a radio item - { - EndRadioGroup(); - } - - if ( !wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item) ) - { - return NULL; - } - - if ( check ) - { - // check the item initially - item->Check(TRUE); - } - - return item; -} - -wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) -{ - if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos)) - return item; - else - return NULL; -} - -wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) -{ - // we need to find the items position in the child list - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData() == item ) - break; - - node = node->GetNext(); - } - - // DoRemove() (unlike Remove) can only be called for existing item! - wxCHECK_MSG( node, NULL, wxT("bug in wxMenu::Remove logic") ); - - ::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1); - - if ( IsAttached() ) - { - // otherwise, the change won't be visible - m_menuBar->Refresh(); - } - - // and from internal data structures - return wxMenuBase::DoRemove(item); -} - -void wxMenu::SetTitle(const wxString& label) -{ - m_title = label ; - UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ; -} -bool wxMenu::ProcessCommand(wxCommandEvent & event) -{ - bool processed = FALSE; - - // Try the menu's event handler - if ( !processed && GetEventHandler()) - { - processed = GetEventHandler()->ProcessEvent(event); - } - - // Try the window the menu was popped up from (and up through the - // hierarchy) - wxWindow *win = GetInvokingWindow(); - if ( !processed && win ) - processed = win->GetEventHandler()->ProcessEvent(event); - - return processed; -} - - -// --------------------------------------------------------------------------- -// other -// --------------------------------------------------------------------------- - -wxWindow *wxMenu::GetWindow() const -{ - if ( m_invokingWindow != NULL ) - return m_invokingWindow; - else if ( m_menuBar != NULL) - return (wxWindow *) m_menuBar->GetFrame(); - - return NULL; -} - -// helper functions returning the mac menu position for a certain item, note that this is -// mac-wise 1 - based, i.e. the first item has index 1 whereas on MSWin it has pos 0 - -int wxMenu::MacGetIndexFromId( int id ) -{ - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData()->GetId() == id ) - break; - - node = node->GetNext(); - } - - if (!node) - return 0; - - return pos + 1 ; -} - -int wxMenu::MacGetIndexFromItem( wxMenuItem *pItem ) -{ - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData() == pItem ) - break; - - node = node->GetNext(); - } - - if (!node) - return 0; - - return pos + 1 ; -} - -void wxMenu::MacEnableMenu( bool bDoEnable ) -{ - UMAEnableMenuItem(MAC_WXHMENU(m_hMenu) , 0 , bDoEnable ) ; - - ::DrawMenuBar() ; -} - -// MacOS needs to know about submenus somewhere within this menu -// before it can be displayed , also hide special menu items like preferences -// that are handled by the OS -void wxMenu::MacBeforeDisplay( bool isSubMenu ) -{ - wxMenuItem* previousItem = NULL ; - size_t pos ; - wxMenuItemList::Node *node; - wxMenuItem *item; - for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - wxMenu* subMenu = item->GetSubMenu() ; - if (subMenu) - { - subMenu->MacBeforeDisplay( true ) ; - } - else - { - #if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) - { - if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId) - { - ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 ); - if ( GetMenuItems().GetCount() == pos + 1 && - previousItem != NULL && - previousItem->IsSeparator() ) - { - ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 ); - } - } - } - #endif - } - previousItem = item ; - } - - if ( isSubMenu ) - ::InsertMenu(MAC_WXHMENU( GetHMenu()), -1); - -} -// undo all changes from the MacBeforeDisplay call -void wxMenu::MacAfterDisplay( bool isSubMenu ) -{ - if ( isSubMenu ) - ::DeleteMenu(MacGetMenuId()); - - wxMenuItem* previousItem = NULL ; - int pos ; - wxMenuItemList::Node *node; - wxMenuItem *item; - for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - wxMenu* subMenu = item->GetSubMenu() ; - if (subMenu) - { - subMenu->MacAfterDisplay( true ) ; - } - else - { - // no need to undo hidings - } - previousItem = item ; - } -} - -// Menu Bar - -/* - -Mac Implementation note : - -The Mac has only one global menubar, so we attempt to install the currently -active menubar from a frame, we currently don't take into account mdi-frames -which would ask for menu-merging - -Secondly there is no mac api for changing a menubar that is not the current -menubar, so we have to wait for preparing the actual menubar until the -wxMenubar is to be used - -We can in subsequent versions use MacInstallMenuBar to provide some sort of -auto-merge for MDI in case this will be necessary - -*/ - -wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ; -wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ; - -void wxMenuBar::Init() -{ - m_eventHandler = this; - m_menuBarFrame = NULL; - m_invokingWindow = (wxWindow*) NULL; -} - -wxMenuBar::wxMenuBar() -{ - Init(); -} - -wxMenuBar::wxMenuBar( long WXUNUSED(style) ) -{ - Init(); -} - - -wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[]) -{ - Init(); - - m_titles.Alloc(count); - - for ( int i = 0; i < count; i++ ) - { - m_menus.Append(menus[i]); - m_titles.Add(titles[i]); - - menus[i]->Attach(this); - } -} - -wxMenuBar::~wxMenuBar() -{ - if (s_macCommonMenuBar == this) - s_macCommonMenuBar = NULL; - if (s_macInstalledMenuBar == this) - { - ::ClearMenuBar(); - s_macInstalledMenuBar = NULL; - } - -} - -void wxMenuBar::Refresh(bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect)) -{ - wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") ); - - DrawMenuBar(); -} - -void wxMenuBar::MacInstallMenuBar() -{ - if ( s_macInstalledMenuBar == this ) - return ; - - wxStAppResource resload ; - - Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; - wxString message ; - wxCHECK_RET( menubar != NULL, wxT("can't read MBAR resource") ); - ::SetMenuBar( menubar ) ; -#if TARGET_API_MAC_CARBON - ::DisposeMenuBar( menubar ) ; -#else - ::DisposeHandle( menubar ) ; -#endif - -#if TARGET_API_MAC_OS8 - MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; - if ( CountMenuItems( menu ) == 2 ) - { - ::AppendResMenu(menu, 'DRVR'); - } -#endif - - // clean-up the help menu before adding new items - MenuHandle mh = NULL ; - if ( UMAGetHelpMenu( &mh , &firstUserHelpMenuItem) == noErr ) - { - for ( int i = CountMenuItems( mh ) ; i >= firstUserHelpMenuItem ; --i ) - { - DeleteMenuItem( mh , i ) ; - } - } - else - { - mh = NULL ; - } -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 && wxApp::s_macPreferencesMenuItemId) - { - wxMenuItem *item = FindItem( wxApp::s_macPreferencesMenuItemId , NULL ) ; - if ( item == NULL || !(item->IsEnabled()) ) - DisableMenuCommand( NULL , kHICommandPreferences ) ; - else - EnableMenuCommand( NULL , kHICommandPreferences ) ; - } -#endif - for (size_t i = 0; i < m_menus.GetCount(); i++) - { - wxMenuItemList::Node *node; - wxMenuItem *item; - int pos ; - wxMenu* menu = m_menus[i] , *subMenu = NULL ; - - if( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName ) - { - if ( mh == NULL ) - { - continue ; - } - - for (pos = 0 , node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - subMenu = item->GetSubMenu() ; - if (subMenu) - { - // we don't support hierarchical menus in the help menu yet - } - else - { - if ( item->IsSeparator() ) - { - if ( mh ) - MacAppendMenu(mh, "\p-" ); - } - else - { - wxAcceleratorEntry* entry = wxGetAccelFromString( item->GetText() ) ; - - if ( item->GetId() == wxApp::s_macAboutMenuItemId ) - { - UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() , wxFont::GetDefaultEncoding() ); - UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true ); - SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ; - UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ; - } - else - { - if ( mh ) - { - UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry); - SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ; - } - } - - delete entry ; - } - } - } - } - else - { - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], m_font.GetEncoding() ) ; - m_menus[i]->MacBeforeDisplay(false) ; - ::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0); - } - } - ::DrawMenuBar() ; - s_macInstalledMenuBar = this; -} - -void wxMenuBar::EnableTop(size_t pos, bool enable) -{ - wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") ); - m_menus[pos]->MacEnableMenu( enable ) ; - Refresh(); -} - -void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) -{ - wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") ); - - m_titles[pos] = label; - - if ( !IsAttached() ) - { - return; - } - - m_menus[pos]->SetTitle( label ) ; - if (wxMenuBar::s_macInstalledMenuBar == this) // are we currently installed ? - { - ::SetMenuBar( GetMenuBar() ) ; - ::InvalMenuBar() ; - } -} - -wxString wxMenuBar::GetLabelTop(size_t pos) const -{ - wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString, - wxT("invalid menu index in wxMenuBar::GetLabelTop") ); - - return m_titles[pos]; -} - -int wxMenuBar::FindMenu(const wxString& title) -{ - wxString menuTitle = wxStripMenuCodes(title); - - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title = wxStripMenuCodes(m_titles[i]); - if ( menuTitle == title ) - return i; - } - - return wxNOT_FOUND; - -} - - -// --------------------------------------------------------------------------- -// wxMenuBar construction -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// wxMenuBar construction -// --------------------------------------------------------------------------- - -wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) -{ - wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title); - if ( !menuOld ) - return FALSE; - m_titles[pos] = title; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - menuOld->MacAfterDisplay( false ) ; - ::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; - { - menu->MacBeforeDisplay( false ) ; - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - if ( pos == m_menus.GetCount() - 1) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - else - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , m_menus[pos+1]->MacGetMenuId() ) ; - } - } - } - - Refresh(); - } - - return menuOld; -} - -bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) -{ - if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; - - m_titles.Insert(title, pos); - - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - - if ( IsAttached() && s_macInstalledMenuBar == this ) - { - if (s_macInstalledMenuBar == this) - { - menu->MacBeforeDisplay( false ) ; - if ( pos == (size_t) -1 || pos + 1 == m_menus.GetCount() ) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - else - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , m_menus[pos+1]->MacGetMenuId() ) ; - } - } - Refresh(); - } - - return TRUE; -} - -wxMenu *wxMenuBar::Remove(size_t pos) -{ - wxMenu *menu = wxMenuBarBase::Remove(pos); - if ( !menu ) - return NULL; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - ::DeleteMenu( menu->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; - } - - Refresh(); - } - - m_titles.RemoveAt(pos); - - return menu; -} - -bool wxMenuBar::Append(wxMenu *menu, const wxString& title) -{ - WXHMENU submenu = menu ? menu->GetHMenu() : 0; - wxCHECK_MSG( submenu, FALSE, wxT("can't append invalid menu to menubar") ); - - if ( !wxMenuBarBase::Append(menu, title) ) - return FALSE; - - m_titles.Add(title); - - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - - Refresh(); - } - - // m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables - // adding menu later on. - if (m_invokingWindow) - wxMenubarSetInvokingWindow( menu, m_invokingWindow ); - - return TRUE; -} - -static void wxMenubarUnsetInvokingWindow( wxMenu *menu ) -{ - menu->SetInvokingWindow( (wxWindow*) NULL ); - - wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst(); - while (node) - { - wxMenuItem *menuitem = node->GetData(); - if (menuitem->IsSubMenu()) - wxMenubarUnsetInvokingWindow( menuitem->GetSubMenu() ); - node = node->GetNext(); - } -} - -static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ) -{ - menu->SetInvokingWindow( win ); - - wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst(); - while (node) - { - wxMenuItem *menuitem = node->GetData(); - if (menuitem->IsSubMenu()) - wxMenubarSetInvokingWindow( menuitem->GetSubMenu() , win ); - node = node->GetNext(); - } -} - -void wxMenuBar::UnsetInvokingWindow() -{ - m_invokingWindow = (wxWindow*) NULL; - wxMenuList::Node *node = m_menus.GetFirst(); - while (node) - { - wxMenu *menu = node->GetData(); - wxMenubarUnsetInvokingWindow( menu ); - node = node->GetNext(); - } -} - -void wxMenuBar::SetInvokingWindow(wxFrame *frame) -{ - m_invokingWindow = frame; - wxMenuList::Node *node = m_menus.GetFirst(); - while (node) - { - wxMenu *menu = node->GetData(); - wxMenubarSetInvokingWindow( menu, frame ); - node = node->GetNext(); - } -} - -void wxMenuBar::Detach() -{ - wxMenuBarBase::Detach() ; -} - -void wxMenuBar::Attach(wxFrame *frame) -{ - wxMenuBarBase::Attach( frame ) ; -} -// --------------------------------------------------------------------------- -// wxMenuBar searching for menu items -// --------------------------------------------------------------------------- - -// Find the itemString in menuString, and return the item id or wxNOT_FOUND -int wxMenuBar::FindMenuItem(const wxString& menuString, - const wxString& itemString) const -{ - wxString menuLabel = wxStripMenuCodes(menuString); - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title = wxStripMenuCodes(m_titles[i]); - if ( menuString == title ) - return m_menus[i]->FindItem(itemString); - } - - return wxNOT_FOUND; -} - -wxMenuItem *wxMenuBar::FindItem(int id, wxMenu **itemMenu) const -{ - if ( itemMenu ) - *itemMenu = NULL; - - wxMenuItem *item = NULL; - size_t count = GetMenuCount(); - for ( size_t i = 0; !item && (i < count); i++ ) - { - item = m_menus[i]->FindItem(id, itemMenu); - } - - return item; -} - - diff --git a/src/mac/carbon/menuitem.cpp b/src/mac/carbon/menuitem.cpp deleted file mode 100644 index 6cc3aa1a79..0000000000 --- a/src/mac/carbon/menuitem.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp -// Purpose: wxMenuItem implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers & declarations -// ============================================================================ - -#include "wx/app.h" -#include "wx/menu.h" -#include "wx/menuitem.h" - -#include "wx/mac/uma.h" -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// dynamic classes implementation -// ---------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) -#endif //USE_SHARED_LIBRARY - -// ---------------------------------------------------------------------------- -// wxMenuItem -// ---------------------------------------------------------------------------- - -// -// ctor & dtor -// ----------- - -wxMenuItem::wxMenuItem(wxMenu *pParentMenu, - int id, - const wxString& text, - const wxString& strHelp, - wxItemKind kind, - wxMenu *pSubMenu) - : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) -{ - // TO DISCUSS on dev : whether we can veto id 0 - // wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ; - - // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines - // therefore these item must not be translated - if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) - { - m_text =wxT("Quit\tCtrl+Q") ; - } - - m_radioGroup.start = -1; - m_isRadioGroupStart = FALSE; -} - -wxMenuItem::~wxMenuItem() -{ -} - -// change item state -// ----------------- - -void wxMenuItem::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - UpdateItemBitmap() ; -} - -void wxMenuItem::UpdateItemBitmap() -{ - if ( !m_parentMenu ) - return ; - - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - if ( m_bitmap.Ok() ) - { - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bitmap , kControlContentCIconHandle ) ; - if ( info.contentType != kControlNoContent ) - { - if ( info.contentType == kControlContentCIconHandle ) - SetMenuItemIconHandle( mhandle , index , - kMenuColorIconType , (Handle) info.u.cIconHandle ) ; - } - - } -} - -void wxMenuItem::UpdateItemStatus() -{ - if ( !m_parentMenu ) - return ; - -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId) - { - if ( !IsEnabled() ) - DisableMenuCommand( NULL , kHICommandPreferences ) ; - else - EnableMenuCommand( NULL , kHICommandPreferences ) ; - } - if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId) - { - if ( !IsEnabled() ) - DisableMenuCommand( NULL , kHICommandQuit ) ; - else - EnableMenuCommand( NULL , kHICommandQuit ) ; - } -#endif - { - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - UMAEnableMenuItem( mhandle , index , m_isEnabled ) ; - if ( IsCheckable() && IsChecked() ) - ::SetItemMark( mhandle , index , 0x12 ) ; // checkmark - else - ::SetItemMark( mhandle , index , 0 ) ; // no mark - - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; - wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; - UMASetMenuItemShortcut( mhandle , index , entry ) ; - delete entry ; - } -} - -void wxMenuItem::UpdateItemText() -{ - if ( !m_parentMenu ) - return ; - - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; - wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; - UMASetMenuItemShortcut( mhandle , index , entry ) ; - delete entry ; -} - - -void wxMenuItem::Enable(bool bDoEnable) -{ - if ( m_isEnabled != bDoEnable ) - { - wxMenuItemBase::Enable( bDoEnable ) ; - UpdateItemStatus() ; - } -} -void wxMenuItem::UncheckRadio() -{ - if ( m_isChecked ) - { - wxMenuItemBase::Check( false ) ; - UpdateItemStatus() ; - } -} - -void wxMenuItem::Check(bool bDoCheck) -{ - wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); - - if ( m_isChecked != bDoCheck ) - { - if ( GetKind() == wxITEM_RADIO ) - { - if ( bDoCheck ) - { - wxMenuItemBase::Check( bDoCheck ) ; - UpdateItemStatus() ; - - // get the index of this item in the menu - const wxMenuItemList& items = m_parentMenu->GetMenuItems(); - int pos = items.IndexOf(this); - wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); - - // get the radio group range - int start, - end; - - if ( m_isRadioGroupStart ) - { - // we already have all information we need - start = pos; - end = m_radioGroup.end; - } - else // next radio group item - { - // get the radio group end from the start item - start = m_radioGroup.start; - end = items.Item(start)->GetData()->m_radioGroup.end; - } - - // also uncheck all the other items in this radio group - wxMenuItemList::Node *node = items.Item(start); - for ( int n = start; n <= end && node; n++ ) - { - if ( n != pos ) - { - ((wxMenuItem*)node->GetData())->UncheckRadio(); - } - node = node->GetNext(); - } - } - } - else - { - wxMenuItemBase::Check( bDoCheck ) ; - UpdateItemStatus() ; - } - } -} - -void wxMenuItem::SetText(const wxString& text) -{ - // don't do anything if label didn't change - if ( m_text == text ) - return; - - wxMenuItemBase::SetText(text); - - UpdateItemText() ; -} - -// radio group stuff -// ----------------- - -void wxMenuItem::SetAsRadioGroupStart() -{ - m_isRadioGroupStart = TRUE; -} - -void wxMenuItem::SetRadioGroupStart(int start) -{ - wxASSERT_MSG( !m_isRadioGroupStart, - _T("should only be called for the next radio items") ); - - m_radioGroup.start = start; -} - -void wxMenuItem::SetRadioGroupEnd(int end) -{ - wxASSERT_MSG( m_isRadioGroupStart, - _T("should only be called for the first radio item") ); - - m_radioGroup.end = end; -} - -// ---------------------------------------------------------------------------- -// wxMenuItemBase -// ---------------------------------------------------------------------------- - -/* static */ -wxString wxMenuItemBase::GetLabelFromText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - -wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, - int id, - const wxString& name, - const wxString& help, - wxItemKind kind, - wxMenu *subMenu) -{ - return new wxMenuItem(parentMenu, id, name, help, kind, subMenu); -} diff --git a/src/mac/carbon/metafile.cpp b/src/mac/carbon/metafile.cpp deleted file mode 100644 index 594fe43af5..0000000000 --- a/src/mac/carbon/metafile.cpp +++ /dev/null @@ -1,219 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: metafile.cpp -// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional. -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "metafile.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/setup.h" -#endif - -#if wxUSE_METAFILE - -#ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/app.h" -#endif - -#include "wx/metafile.h" -#include "wx/clipbrd.h" - -#include "wx/mac/private.h" - -#include -#include - -extern bool wxClipboardIsOpen; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMetafile, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC, wxDC) -#endif - -/* - * Metafiles - * Currently, the only purpose for making a metafile is to put - * it on the clipboard. - */ - -wxMetafileRefData::wxMetafileRefData(void) -{ - m_metafile = 0; -} - -wxMetafileRefData::~wxMetafileRefData(void) -{ - if (m_metafile) - { - KillPicture( (PicHandle) m_metafile ) ; - m_metafile = 0; - } -} - -wxMetaFile::wxMetaFile(const wxString& file) -{ - m_refData = new wxMetafileRefData; - - - M_METAFILEDATA->m_metafile = 0; - wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ; -/* - if (!file.IsNull() && (file.Cmp("") == 0)) - M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file); -*/ -} - -wxMetaFile::~wxMetaFile() -{ -} - -bool wxMetaFile::SetClipboard(int width, int height) -{ -#if wxUSE_DRAG_AND_DROP - //TODO finishi this port , we need the data obj first - if (!m_refData) - return FALSE; - - bool alreadyOpen=wxTheClipboard->IsOpened() ; - if (!alreadyOpen) - { - wxTheClipboard->Open(); - wxTheClipboard->Clear(); - } - wxDataObject *data = - new wxMetafileDataObject( *this) ; - bool success = wxTheClipboard->SetData(data); - if (!alreadyOpen) - wxTheClipboard->Close(); - return (bool) success; -#endif - return TRUE ; -} - -void wxMetafile::SetHMETAFILE(WXHMETAFILE mf) -{ - if (!m_refData) - m_refData = new wxMetafileRefData; - if ( M_METAFILEDATA->m_metafile ) - KillPicture( (PicHandle) M_METAFILEDATA->m_metafile ) ; - - M_METAFILEDATA->m_metafile = mf; -} - -bool wxMetaFile::Play(wxDC *dc) -{ - if (!m_refData) - return FALSE; - - if (!dc->Ok() ) - return FALSE; - - { - wxMacPortSetter helper( dc ) ; - PicHandle pict = (PicHandle) GetHMETAFILE() ; - DrawPicture( pict , &(**pict).picFrame ) ; - } - return TRUE; -} - -wxSize wxMetaFile::GetSize() const -{ - wxSize size = wxDefaultSize ; - if ( Ok() ) - { - PicHandle pict = (PicHandle) GetHMETAFILE() ; - Rect &r = (**pict).picFrame ; - size.x = r.right - r.left ; - size.y = r.bottom - r.top ; - } - - return size; -} - -/* - * Metafile device context - * - */ - -// New constructor that takes origin and extent. If you use this, don't -// give origin/extent arguments to wxMakeMetaFilePlaceable. - -wxMetaFileDC::wxMetaFileDC(const wxString& filename , - int width , int height , - const wxString& WXUNUSED(description) ) -{ - wxASSERT_MSG( width == 0 || height == 0 , _T("no arbitration of metafilesize supported") ) ; - wxASSERT_MSG( filename.IsEmpty() , _T("no file based metafile support yet")) ; - - m_metaFile = new wxMetaFile(filename) ; - Rect r={0,0,height,width} ; - - RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - - m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ; - ::GetPort( (GrafPtr*) &m_macPort ) ; - m_ok = TRUE ; - - SetMapMode(wxMM_TEXT); -} - -wxMetaFileDC::~wxMetaFileDC() -{ -} - -void wxMetaFileDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_metaFile , _T("GetSize() doesn't work without a metafile") ); - - wxSize sz = m_metaFile->GetSize() ; - if (width) (*width) = sz.x; - if (height) (*height) = sz.y; -} - -wxMetaFile *wxMetaFileDC::Close() -{ - ClosePicture() ; - return m_metaFile; -} - -#if wxUSE_DATAOBJ -size_t wxMetafileDataObject::GetDataSize() const -{ - return GetHandleSize( (Handle) (*((wxMetafile*)&m_metafile)).GetHMETAFILE() ) ; -} - -bool wxMetafileDataObject::GetDataHere(void *buf) const -{ - memcpy( buf , (*(PicHandle)(*((wxMetafile*)&m_metafile)).GetHMETAFILE()) , - GetHandleSize( (Handle) (*((wxMetafile*)&m_metafile)).GetHMETAFILE() ) ) ; - return true ; -} - -bool wxMetafileDataObject::SetData(size_t len, const void *buf) -{ - Handle handle = NewHandle( len ) ; - SetHandleSize( handle , len ) ; - memcpy( *handle , buf , len ) ; - m_metafile.SetHMETAFILE( handle ) ; - return true ; -} -#endif - -#endif diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp deleted file mode 100644 index 1ea83612c2..0000000000 --- a/src/mac/carbon/mimetmac.cpp +++ /dev/null @@ -1,228 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/mimetype.cpp -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mimetype.h" -#endif - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif -#endif //WX_PRECOMP - - -#include "wx/log.h" -#include "wx/file.h" -#include "wx/intl.h" -#include "wx/dynarray.h" -#include "wx/confbase.h" - -#include "wx/mac/mimetype.h" - -// other standard headers -#include - -// in case we're compiling in non-GUI mode -class WXDLLEXPORT wxIcon; - -bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt) -{ - return FALSE; -} - -bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int index) -{ - return FALSE; -} - -bool wxFileTypeImpl::GetCommand(wxString *command, const char *verb) const -{ - return FALSE; -} - -// @@ this function is half implemented -bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) -{ - return FALSE; -} - -bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const -{ - if ( m_strFileType.Length() > 0 ) - { - *mimeType = m_strFileType ; - return TRUE ; - } - else - return FALSE; -} - -bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const -{ - wxString s; - - if (GetMimeType(&s)) - { - mimeTypes.Clear(); - mimeTypes.Add(s); - return TRUE; - } - else - return FALSE; -} - -bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const -{ - // no such file type or no value or incorrect icon entry - return FALSE; -} - -bool wxFileTypeImpl::GetDescription(wxString *desc) const -{ - return FALSE; -} - -size_t -wxFileTypeImpl::GetAllCommands(wxArrayString * verbs, wxArrayString * commands, - const wxFileType::MessageParameters& params) const -{ - wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") ); - return 0; -} - -void -wxMimeTypesManagerImpl::Initialize(int mailcapStyles, const wxString& extraDir) -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") ); -} - -void -wxMimeTypesManagerImpl::ClearData() -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::ClearData() not yet implemented") ); -} - -// extension -> file type -wxFileType * -wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& e) -{ - wxString ext = e ; - ext = ext.Lower() ; - if ( ext == wxT("txt") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("text/text")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("htm") || ext == wxT("html") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("text/html")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("gif") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/gif")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("png" )) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/png")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("jpg" )|| ext == wxT("jpeg") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/jpeg")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("bmp") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/bmp")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("tif") || ext == wxT("tiff") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/tiff")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("xpm") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/xpm")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("xbm") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/xbm")); - fileType->m_impl->SetExt(ext); - return fileType; - } - - // unknown extension - return NULL; -} - -// MIME type -> extension -> file type -wxFileType * -wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) -{ - return NULL; -} - -size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) -{ - // VZ: don't know anything about this for Mac - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") ); - - return 0; -} - -wxFileType * -wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") ); - - return NULL; -} - -bool -wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) -{ - return FALSE; -} - diff --git a/src/mac/carbon/minifram.cpp b/src/mac/carbon/minifram.cpp deleted file mode 100644 index 6b49b9bdc7..0000000000 --- a/src/mac/carbon/minifram.cpp +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: minifram.cpp -// Purpose: wxMiniFrame. Optional; identical to wxFrame if not supported. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "minifram.h" -#endif - -#include "wx/minifram.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) -#endif - - diff --git a/src/mac/carbon/msgdlg.cpp b/src/mac/carbon/msgdlg.cpp deleted file mode 100644 index 73548ad9f2..0000000000 --- a/src/mac/carbon/msgdlg.cpp +++ /dev/null @@ -1,262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msgdlg.cpp -// Purpose: wxMessageDialog -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "msgdlg.h" -#endif - -#include "wx/app.h" -#include "wx/msgdlg.h" -#include "wx/intl.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -#endif - -wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption, - long style, const wxPoint& pos) -{ - m_caption = caption; - m_message = message; - m_dialogStyle = style; - m_parent = parent; -} - -int wxMessageDialog::ShowModal() -{ - int resultbutton = wxID_CANCEL ; - - short result ; - - wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , wxT("this style is not supported on mac") ) ; - - AlertType alertType = kAlertPlainAlert ; - if (m_dialogStyle & wxICON_EXCLAMATION) - alertType = kAlertNoteAlert ; - else if (m_dialogStyle & wxICON_HAND) - alertType = kAlertStopAlert ; - else if (m_dialogStyle & wxICON_INFORMATION) - alertType = kAlertNoteAlert ; - else if (m_dialogStyle & wxICON_QUESTION) - alertType = kAlertCautionAlert ; - -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) - { - AlertStdCFStringAlertParamRec param ; - wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ; - wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ; - - wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding()); - wxMacCFStringHolder cfText(m_message , m_font.GetEncoding()); - - param.movable = true; - param.flags = 0 ; - - bool skipDialog = false ; - - if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = cfYesString ; - param.cancelText = (CFStringRef) kAlertDefaultCancelText; - param.otherText = cfNoString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = kAlertStdAlertCancelButton; - } - else - { - param.defaultText = cfYesString ; - param.cancelText = NULL; - param.otherText = cfNoString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - // the msw implementation even shows an ok button if it is not specified, we'll do the same - else - { - if (m_dialogStyle & wxCANCEL) - { - // thats a cancel missing - param.defaultText = (CFStringRef) kAlertDefaultOKText ; - param.cancelText = (CFStringRef) kAlertDefaultCancelText ; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - else - { - param.defaultText = (CFStringRef) kAlertDefaultOKText ; - param.cancelText = NULL; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - /* - else - { - skipDialog = true ; - } - */ - - param.position = kWindowDefaultPosition; - if ( !skipDialog ) - { - DialogRef alertRef ; - CreateStandardAlert( alertType , cfTitle , cfText , ¶m , &alertRef ) ; - RunStandardAlert( alertRef , NULL , &result ) ; - } - if ( skipDialog ) - return wxID_CANCEL ; - } - else -#endif - { - AlertStdAlertParamRec param; - - Str255 yesPString ; - Str255 noPString ; - - Str255 pascalTitle ; - Str255 pascalText ; - wxMacStringToPascal( m_caption , pascalTitle ) ; - wxMacStringToPascal( _("Yes") , yesPString ) ; - wxMacStringToPascal( _("No") , noPString ) ; - wxMacStringToPascal( m_message , pascalText ) ; - - param.movable = true; - param.filterProc = NULL ; - if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = yesPString ; - param.cancelText = (StringPtr) kAlertDefaultCancelText; - param.otherText = noPString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = kAlertStdAlertCancelButton; - } - else - { - param.defaultText = yesPString ; - param.cancelText = NULL; - param.otherText = noPString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - else if (m_dialogStyle & wxOK) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = (StringPtr) kAlertDefaultOKText ; - param.cancelText = (StringPtr) kAlertDefaultCancelText ; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - else - { - param.defaultText = (StringPtr) kAlertDefaultOKText ; - param.cancelText = NULL; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - else - { - return resultbutton ; - } - - param.position = 0; - - StandardAlert( alertType, pascalTitle, pascalText, ¶m, &result ); - } - - if (m_dialogStyle & wxOK) - { - if (m_dialogStyle & wxCANCEL) - { - //TODO add Cancelbutton - switch( result ) - { - case 1 : - resultbutton = wxID_OK ; - break ; - case 2 : - break ; - case 3 : - break ; - } - } - else - { - switch( result ) - { - case 1 : - resultbutton = wxID_OK ; - break ; - case 2 : - break ; - case 3 : - break ; - } - } - } - else if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - switch( result ) - { - case 1 : - resultbutton = wxID_YES ; - break ; - case 2 : - resultbutton = wxID_CANCEL ; - break ; - case 3 : - resultbutton = wxID_NO ; - break ; - } - } - else - { - switch( result ) - { - case 1 : - resultbutton = wxID_YES ; - break ; - case 2 : - break ; - case 3 : - resultbutton = wxID_NO ; - break ; - } - } - } - - return resultbutton ; -} - diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp deleted file mode 100644 index 9aa4fdf5b9..0000000000 --- a/src/mac/carbon/notebmac.cpp +++ /dev/null @@ -1,729 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: notebook.cpp -// Purpose: implementation of wxNotebook -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "notebook.h" -#endif - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/app.h" -#include "wx/string.h" -#include "wx/log.h" -#include "wx/imaglist.h" -#include "wx/image.h" -#include "wx/notebook.h" -#include "wx/mac/uma.h" -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) - - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) - -BEGIN_EVENT_TABLE(wxNotebook, wxControl) - EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) - EVT_MOUSE_EVENTS(wxNotebook::OnMouse) - - EVT_SIZE(wxNotebook::OnSize) - EVT_SET_FOCUS(wxNotebook::OnSetFocus) - EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// The Appearance Manager docs show using tab controls in either edge to edge -// mode, or inset. I think edge to edge conforms better to the other ports, -// and inset mode is better accomplished with space around the wxNotebook rather -// than within it. --Robin - -// CS : had to switch off tight spacing due to 10.3 problems -#define wxMAC_EDGE_TO_EDGE 0 - -static inline int wxMacTabMargin(long nbStyle, long side) -{ - static int tabMargin = -1; - static int otherMargin = -1; - - if ( tabMargin == -1) - { - if ( UMAHasAquaLayout() ) - { - tabMargin = 26; // From Appearance Manager docs for small tab control dimensions -#if wxMAC_EDGE_TO_EDGE - otherMargin = 0; -#else -// otherMargin = 20; - // JACS - this seems fine on 10.3; 20 is way too much - otherMargin = 8; -#endif - } - else - { - tabMargin = 30; -#if wxMAC_EDGE_TO_EDGE - otherMargin = 0; -#else - otherMargin = 16; -#endif - } - } - - // If the style matches the side asked for then return the tab margin, - // but we have to special case wxNB_TOP since it is zero... - if ( side == wxNB_TOP) - { - if ( nbStyle != 0 && nbStyle & (wxNB_LEFT|wxNB_RIGHT|wxNB_BOTTOM)) - { - return otherMargin; - } - else - { - return tabMargin; - } - } - else if ( nbStyle & side) - return tabMargin; - else - return otherMargin; -} - -static inline int wxMacTabLeftMargin(long style) -{ - return wxMacTabMargin(style, wxNB_LEFT); -} - -static inline int wxMacTabTopMargin(long style) -{ - return wxMacTabMargin(style, wxNB_TOP); -} - -static inline int wxMacTabRightMargin(long style) -{ - return wxMacTabMargin(style, wxNB_RIGHT); -} - -static inline int wxMacTabBottomMargin(long style) -{ - return wxMacTabMargin(style, wxNB_BOTTOM); -} - -// ---------------------------------------------------------------------------- -// wxNotebook construction -// ---------------------------------------------------------------------------- - -// common part of all ctors -void wxNotebook::Init() -{ - if ( UMAHasAquaLayout() ) - { - // Should these depend on wxMAC_EDGE_TO_EDGE too? - m_macHorizontalBorder = 7; - m_macVerticalBorder = 8; - } - - m_nSelection = -1; -} - -// default for dynamic class -wxNotebook::wxNotebook() -{ - Init(); -} - -// the same arguments as for wxControl -wxNotebook::wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - Create(parent, id, pos, size, style, name); -} - -// Create() function -bool wxNotebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - int tabstyle = kControlTabSmallNorthProc ; - if ( HasFlag(wxNB_LEFT) ) - tabstyle = kControlTabSmallWestProc ; - else if ( HasFlag( wxNB_RIGHT ) ) - tabstyle = kControlTabSmallEastProc ; - else if ( HasFlag( wxNB_BOTTOM ) ) - tabstyle = kControlTabSmallSouthProc ; - - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - tabstyle , (long) this ) ; - - MacPostControlCreate() ; - return TRUE ; -} - -// dtor -wxNotebook::~wxNotebook() -{ -} - -// ---------------------------------------------------------------------------- -// wxNotebook accessors -// ---------------------------------------------------------------------------- - -void wxNotebook::SetPadding(const wxSize& padding) -{ - // unsupported by OS -} - -void wxNotebook::SetTabSize(const wxSize& sz) -{ - // unsupported by OS -} - -void wxNotebook::SetPageSize(const wxSize& size) -{ - SetSize( CalcSizeFromPage( size ) ); -} - -wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - wxSize sizeTotal = sizePage; - sizeTotal.x += 2 * m_macHorizontalBorder + wxMacTabLeftMargin(GetWindowStyle()) + - wxMacTabRightMargin(GetWindowStyle()) ; - sizeTotal.y += 2 * m_macVerticalBorder + wxMacTabTopMargin(GetWindowStyle()) + - wxMacTabBottomMargin(GetWindowStyle()) ; - - return sizeTotal; -} - -wxSize wxNotebook::DoGetBestSize() const -{ - // calculate the max page size - wxSize size(0, 0); - - size_t count = GetPageCount(); - if ( count ) - { - for ( size_t n = 0; n < count; n++ ) - { - wxSize sizePage = m_pages[n]->GetSize(); - - if ( size.x < sizePage.x ) - size.x = sizePage.x; - if ( size.y < sizePage.y ) - size.y = sizePage.y; - } - } - else // no pages - { - // use some arbitrary default size - size.x = - size.y = 100; - } - - return CalcSizeFromPage(size); -} - -int wxNotebook::SetSelection(size_t nPage) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); - - if ( int(nPage) != m_nSelection ) - { - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId); - event.SetSelection(nPage); - event.SetOldSelection(m_nSelection); - event.SetEventObject(this); - if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) - { - // program allows the page change - event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED); - (void)GetEventHandler()->ProcessEvent(event); - - ChangePage(m_nSelection, nPage); - } - } - - return m_nSelection; -} - -bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage *page = m_pages[nPage]; - page->SetLabel(strText); - MacSetupTabs(); - - return true; -} - -wxString wxNotebook::GetPageText(size_t nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage *page = m_pages[nPage]; - return page->GetLabel(); -} - -int wxNotebook::GetPageImage(size_t nPage) const -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); - - return m_images[nPage]; -} - -bool wxNotebook::SetPageImage(size_t nPage, int nImage) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); - - wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, - _T("invalid image index in SetPageImage()") ); - - if ( nImage != m_images[nPage] ) - { - // if the item didn't have an icon before or, on the contrary, did have - // it but has lost it now, its size will change - but if the icon just - // changes, it won't - m_images[nPage] = nImage; - - MacSetupTabs() ; - } - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxNotebook operations -// ---------------------------------------------------------------------------- - -// remove one page from the notebook, without deleting the window -wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), NULL ); - wxNotebookPage* page = m_pages[nPage] ; - m_pages.RemoveAt(nPage); - - MacSetupTabs(); - - if(m_nSelection >= (int)GetPageCount()) { - m_nSelection = GetPageCount() - 1; - } - if(m_nSelection >= 0) { - m_pages[m_nSelection]->Show(true); - } - return page; -} - -// remove all pages -bool wxNotebook::DeleteAllPages() -{ - WX_CLEAR_ARRAY(m_pages) ; - MacSetupTabs(); - m_nSelection = -1 ; - return TRUE; -} - - -// same as AddPage() but does it at given position -bool wxNotebook::InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - if ( !wxNotebookBase::InsertPage(nPage, pPage, strText, bSelect, imageId) ) - return false; - - wxASSERT_MSG( pPage->GetParent() == this, - _T("notebook pages must have notebook as parent") ); - - // don't show pages by default (we'll need to adjust their size first) - pPage->Show( false ) ; - - pPage->SetLabel(strText); - - m_images.Insert(imageId, nPage); - - MacSetupTabs(); - - wxRect rect = GetPageRect() ; - pPage->SetSize(rect); - if ( pPage->GetAutoLayout() ) { - pPage->Layout(); - } - - - // now deal with the selection - // --------------------------- - - // if the inserted page is before the selected one, we must update the - // index of the selected page - - if ( int(nPage) <= m_nSelection ) - { - m_nSelection++; - // while this still is the same page showing, we need to update the tabs - SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; - } - - // some page should be selected: either this one or the first one if there - // is still no selection - int selNew = -1; - if ( bSelect ) - selNew = nPage; - else if ( m_nSelection == -1 ) - selNew = 0; - - if ( selNew != -1 ) - SetSelection(selNew); - - return true; -} - -/* Added by Mark Newsam -* When a page is added or deleted to the notebook this function updates -* information held in the m_macControl so that it matches the order -* the user would expect. -*/ -void wxNotebook::MacSetupTabs() -{ - SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; - - wxNotebookPage *page; - ControlTabInfoRec info; - - const size_t countPages = GetPageCount(); - for(size_t ii = 0; ii < countPages; ii++) - { - page = m_pages[ii]; - info.version = 0; - info.iconSuiteID = 0; - wxMacStringToPascal( page->GetLabel() , info.name ) ; - - SetControlData( (ControlHandle) m_macControl, ii+1, kControlTabInfoTag, - sizeof( ControlTabInfoRec) , (char*) &info ) ; - SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ; -#if TARGET_CARBON - if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 ) - { - // tab controls only support very specific types of images, therefore we are doing an odyssee - // accross the icon worlds (even Apple DTS did not find a shorter path) - // in order not to pollute the icon registry we put every icon into (OSType) 1 and immediately - // afterwards Unregister it (IconRef is ref counted, so it will stay on the tab even if we - // unregister it) in case this will ever lead to having the same icon everywhere add some kind - // of static counter - const wxBitmap* bmap = GetImageList()->GetBitmap( GetPageImage(ii ) ) ; - if ( bmap ) - { - wxBitmap scaledBitmap ; - if ( bmap->GetWidth() != 16 || bmap->GetHeight() != 16 ) - { - scaledBitmap = wxBitmap( bmap->ConvertToImage().Scale(16,16) ) ; - bmap = &scaledBitmap ; - } - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , *bmap , kControlContentPictHandle) ; - IconFamilyHandle iconFamily = (IconFamilyHandle) NewHandle(0) ; - OSErr err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; - wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ; - IconRef iconRef ; - err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) 1, iconFamily, &iconRef ) ; - wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ; - info.contentType = kControlContentIconRef ; - info.u.iconRef = iconRef ; - SetControlData( (ControlHandle) m_macControl, ii+1,kControlTabImageContentTag, - sizeof( info ), (Ptr)&info ); - wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ; - if ( UMAGetSystemVersion() < 0x1030 ) - { - UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; - } - - ReleaseIconRef( iconRef ) ; - DisposeHandle( (Handle) iconFamily ) ; - } - } -#endif - } - Rect bounds; - GetControlBounds((ControlHandle)m_macControl, &bounds); - InvalWindowRect((WindowRef)MacGetRootWindow(), &bounds); -} - -wxRect wxNotebook::GetPageRect() const -{ - // fit the notebook page to the tab control's display area - int w, h; - GetSize(&w, &h); - - return wxRect( - wxMacTabLeftMargin(GetWindowStyle()) + m_macHorizontalBorder, - wxMacTabTopMargin(GetWindowStyle()) + m_macVerticalBorder, - w - wxMacTabLeftMargin(GetWindowStyle()) - wxMacTabRightMargin(GetWindowStyle()) - 2*m_macHorizontalBorder, - h - wxMacTabTopMargin(GetWindowStyle()) - wxMacTabBottomMargin(GetWindowStyle()) - 2*m_macVerticalBorder); -} -// ---------------------------------------------------------------------------- -// wxNotebook callbacks -// ---------------------------------------------------------------------------- - -// @@@ OnSize() is used for setting the font when it's called for the first -// time because doing it in ::Create() doesn't work (for unknown reasons) -void wxNotebook::OnSize(wxSizeEvent& event) -{ - - unsigned int nCount = m_pages.Count(); - wxRect rect = GetPageRect() ; - for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { - wxNotebookPage *pPage = m_pages[nPage]; - pPage->SetSize(rect); - if ( pPage->GetAutoLayout() ) { - pPage->Layout(); - } - } - - // Processing continues to next OnSize - event.Skip(); -} - -void wxNotebook::OnSelChange(wxNotebookEvent& event) -{ - // is it our tab control? - if ( event.GetEventObject() == this ) - ChangePage(event.GetOldSelection(), event.GetSelection()); - - // we want to give others a chance to process this message as well - event.Skip(); -} - -void wxNotebook::OnSetFocus(wxFocusEvent& event) -{ - // set focus to the currently selected page if any - if ( m_nSelection != -1 ) - m_pages[m_nSelection]->SetFocus(); - - event.Skip(); -} - -void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) -{ - if ( event.IsWindowChange() ) { - // change pages - AdvanceSelection(event.GetDirection()); - } - else { - // we get this event in 2 cases - // - // a) one of our pages might have generated it because the user TABbed - // out from it in which case we should propagate the event upwards and - // our parent will take care of setting the focus to prev/next sibling - // - // or - // - // b) the parent panel wants to give the focus to us so that we - // forward it to our selected page. We can't deal with this in - // OnSetFocus() because we don't know which direction the focus came - // from in this case and so can't choose between setting the focus to - // first or last panel child - wxWindow *parent = GetParent(); - // the cast is here to fic a GCC ICE - if ( ((wxWindow*)event.GetEventObject()) == parent ) - { - // no, it doesn't come from child, case (b): forward to a page - if ( m_nSelection != -1 ) - { - // so that the page knows that the event comes from it's parent - // and is being propagated downwards - event.SetEventObject(this); - - wxWindow *page = m_pages[m_nSelection]; - if ( !page->GetEventHandler()->ProcessEvent(event) ) - { - page->SetFocus(); - } - //else: page manages focus inside it itself - } - else - { - // we have no pages - still have to give focus to _something_ - SetFocus(); - } - } - else - { - // it comes from our child, case (a), pass to the parent - if ( parent ) { - event.SetCurrentFocus(this); - parent->GetEventHandler()->ProcessEvent(event); - } - } - } -} - -// ---------------------------------------------------------------------------- -// wxNotebook base class virtuals -// ---------------------------------------------------------------------------- - -#if wxUSE_CONSTRAINTS - -// override these 2 functions to do nothing: everything is done in OnSize - -void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse)) -{ - // don't set the sizes of the pages - their correct size is not yet known - wxControl::SetConstraintSizes(FALSE); -} - -bool wxNotebook::DoPhase(int WXUNUSED(nPhase)) -{ - return TRUE; -} - -#endif // wxUSE_CONSTRAINTS - -void wxNotebook::Command(wxCommandEvent& event) -{ - wxFAIL_MSG(wxT("wxNotebook::Command not implemented")); -} - -// ---------------------------------------------------------------------------- -// wxNotebook helper functions -// ---------------------------------------------------------------------------- - -// hide the currently active panel and show the new one -void wxNotebook::ChangePage(int nOldSel, int nSel) -{ - if ( nOldSel != -1 ) - { - m_pages[nOldSel]->Show(FALSE); - } - - if ( nSel != -1 ) - { - wxNotebookPage *pPage = m_pages[nSel]; - pPage->Show(TRUE); - pPage->SetFocus(); - } - - m_nSelection = nSel; - SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; -} - - -void wxNotebook::OnMouse( wxMouseEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - { - event.Skip() ; - return ; - } - - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - - control = (ControlHandle) m_macControl ; - if ( control && ::IsControlActive( control ) ) - { - { - wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId, - ::GetControl32BitValue(control) - 1, m_nSelection); - changing.SetEventObject(this); - GetEventHandler()->ProcessEvent(changing); - - if(changing.IsAllowed()) - { - controlpart = ::HandleControlClick(control, localwhere, modifiers, - (ControlActionUPP) -1); - wxTheApp->s_lastMouseDown = 0 ; - - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, - ::GetControl32BitValue(control) - 1, m_nSelection); - event.SetEventObject(this); - - GetEventHandler()->ProcessEvent(event); - } - } - } - } -} - - -void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ -#if 0 - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControl32BitValue((ControlHandle)m_macControl) - 1, m_nSelection); - event.SetEventObject(this); - - ProcessEvent(event); -#endif -} - diff --git a/src/mac/carbon/palette.cpp b/src/mac/carbon/palette.cpp deleted file mode 100644 index 60a0de6a8a..0000000000 --- a/src/mac/carbon/palette.cpp +++ /dev/null @@ -1,118 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.cpp -// Purpose: wxPalette -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "palette.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_PALETTE - -#include "wx/palette.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) -#endif - -/* - * Palette - * - */ - -wxPaletteRefData::wxPaletteRefData() -{ - m_palette = NULL ; - m_count = 0 ; -} - -wxPaletteRefData::~wxPaletteRefData() -{ - if (m_palette != NULL) { - delete[] m_palette ; - m_palette = NULL; - } -} - -wxPalette::wxPalette() -{ -} - -wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - Create(n, red, green, blue); -} - -wxPalette::~wxPalette() -{ -} - -bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - UnRef(); - - m_refData = new wxPaletteRefData; - - M_PALETTEDATA->m_count = n ; - M_PALETTEDATA->m_palette = new wxColour[n] ; - - for ( int i = 0 ; i < n ; ++i) - { - M_PALETTEDATA->m_palette[i].Set( red[i] , green[i] , blue[i] ) ; - } - - return FALSE; -} - -int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const -{ - if ( !m_refData ) - return -1; - - long bestdiff = 3 * 256 ; - long bestpos = 0 ; - long currentdiff ; - - for ( int i = 0 ; i < M_PALETTEDATA->m_count ; ++i ) - { - const wxColour& col = &M_PALETTEDATA->m_palette[i] ; - currentdiff = abs ( col.Red() - red ) + abs( col.Green() - green ) + abs ( col.Blue() - blue ) ; - if ( currentdiff < bestdiff ) - { - bestdiff = currentdiff ; - bestpos = i ; - if ( bestdiff == 0 ) - break ; - } - } - - return bestpos; -} - -bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const -{ - if ( !m_refData ) - return FALSE; - - if (index < 0 || index >= M_PALETTEDATA->m_count) - return FALSE; - - const wxColour& col = &M_PALETTEDATA->m_palette[index] ; - *red = col.Red() ; - *green = col.Green() ; - *blue = col.Blue() ; - - return TRUE; -} - -#endif -// wxUSE_PALETTE - diff --git a/src/mac/carbon/pen.cpp b/src/mac/carbon/pen.cpp deleted file mode 100644 index fea55ab34e..0000000000 --- a/src/mac/carbon/pen.cpp +++ /dev/null @@ -1,186 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp -// Purpose: wxPen -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "pen.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/pen.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) -#endif - -wxPenRefData::wxPenRefData() -{ - m_style = wxSOLID; - m_width = 1; - m_join = wxJOIN_ROUND ; - m_cap = wxCAP_ROUND ; - m_nbDash = 0 ; - m_dash = 0 ; -} - -wxPenRefData::wxPenRefData(const wxPenRefData& data) -: wxGDIRefData() -{ - m_style = data.m_style; - m_width = data.m_width; - m_join = data.m_join; - m_cap = data.m_cap; - m_nbDash = data.m_nbDash; - m_dash = data.m_dash; - m_colour = data.m_colour; -} - -wxPenRefData::~wxPenRefData() -{ -} - -// Pens - -wxPen::wxPen() -{ -} - -wxPen::~wxPen() -{ -} - -// Should implement Create -wxPen::wxPen(const wxColour& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = 0 ; - - RealizeResource(); -} - -wxPen::wxPen(const wxBitmap& stipple, int Width) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_stipple = stipple; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = wxSTIPPLE; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = 0 ; - - RealizeResource(); -} - -void wxPen::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxPenRefData(); - } - else - { - wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxPen::SetColour(const wxColour& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - Unshare(); - - M_PENDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxPen::SetWidth(int Width) -{ - Unshare(); - - M_PENDATA->m_width = Width; - - RealizeResource(); -} - -void wxPen::SetStyle(int Style) -{ - Unshare(); - - M_PENDATA->m_style = Style; - - RealizeResource(); -} - -void wxPen::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_PENDATA->m_stipple = Stipple; - M_PENDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) -{ - Unshare(); - - M_PENDATA->m_nbDash = nb_dashes; - M_PENDATA->m_dash = (wxDash *)Dash; - - RealizeResource(); -} - -void wxPen::SetJoin(int Join) -{ - Unshare(); - - M_PENDATA->m_join = Join; - - RealizeResource(); -} - -void wxPen::SetCap(int Cap) -{ - Unshare(); - - M_PENDATA->m_cap = Cap; - - RealizeResource(); -} - -bool wxPen::RealizeResource() -{ - // nothing to do here for mac - return TRUE; -} - - diff --git a/src/mac/carbon/pnghand.cpp b/src/mac/carbon/pnghand.cpp deleted file mode 100644 index f25141d7e9..0000000000 --- a/src/mac/carbon/pnghand.cpp +++ /dev/null @@ -1,904 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pnghand.cpp -// Purpose: Implements a PNG reader class + handler -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -# pragma implementation "pngread.h" -# pragma implementation "pnghand.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -# pragma hdrstop -#endif - -#include -#include -#include - -#if wxUSE_IOSTREAMH -# include -#else -# include -#endif - -#ifndef __DARWIN__ -# include -#endif -#include "wx/msgdlg.h" -#include "wx/palette.h" -#include "wx/bitmap.h" -#include "wx/mac/pnghand.h" -#include "wx/mac/pngread.h" -#include "wx/mac/private.h" - -extern "C" { -#include "png.h" -} - -extern "C" void png_read_init PNGARG((png_structp png_ptr)); -extern "C" void png_write_init PNGARG((png_structp png_ptr)); - -extern CTabHandle wxMacCreateColorTable( int numColors ) ; -extern void wxMacDestroyColorTable( CTabHandle colors ) ; -extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ; -extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ; -extern void wxMacDestroyGWorld( GWorldPtr gw ) ; - -void -ima_png_error(png_struct *png_ptr, char *message) -{ - wxMessageBox(wxString::FromAscii(message), wxT("PNG error")); - longjmp(png_ptr->jmpbuf, 1); -} - - -// static wxGifReaderIter* iter; -wxPalette *wxCopyPalette(const wxPalette *cmap); - -wxPNGReader::wxPNGReader(void) -{ - filetype = 0; - RawImage = NULL; // Image data - - Width = 0; Height = 0; // Dimensions - Depth = 0; // (bits x pixel) - ColorType = 0; // Bit 1 = Palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - EfeWidth = 0; // Efective Width - - lpbi = NULL; - bgindex = -1; - m_palette = 0; - imageOK = FALSE; -} - -wxPNGReader::wxPNGReader ( char* ImageFileName ) -{ - imageOK = FALSE; - filetype = 0; - RawImage = NULL; // Image data - - Width = 0; Height = 0; // Dimensions - Depth = 0; // (bits x pixel) - ColorType = 0; // Bit 1 = m_palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - EfeWidth = 0; // Efective Width - - lpbi = NULL; - bgindex = -1; - m_palette = 0; - - imageOK = ReadFile (ImageFileName); -} - -void -wxPNGReader::Create(int width, int height, int depth, int colortype) -{ - Width = width; Height = height; Depth = depth; - ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0); - delete m_palette; - m_palette = NULL; - delete[] RawImage; - RawImage = NULL; - - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - } - lpbi = wxMacCreateGWorld( Width , Height , Depth); - if (lpbi) - { - EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4; - int bitwidth = width ; - if ( EfeWidth > bitwidth ) - bitwidth = EfeWidth ; - - RawImage = (byte*) new char[ ( bitwidth * Height * ((Depth+7)>>3) ) ]; - imageOK = TRUE; - } -} - -wxPNGReader::~wxPNGReader ( ) -{ - if (RawImage != NULL) { - delete[] RawImage ; - RawImage = NULL; - } - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - lpbi = NULL; - } - if (m_palette != NULL) { - delete m_palette; - m_palette = NULL; - } -} - - -int wxPNGReader::GetIndex(int x, int y) -{ - if (!Inside(x, y) || (Depth>8)) return -1; - - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - int index = (int)(*ImagePointer); - return index; -} - -bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b) -{ - if (!Inside(x, y)) return FALSE; - - if (m_palette) { - return m_palette->GetRGB(GetIndex(x, y), r, g, b); - /* PALETTEENTRY entry; - ::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry); - *r = entry.peRed; - *g = entry.peGreen; - *b = entry.peBlue; */ - } else { - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - *b = ImagePointer[0]; - *g = ImagePointer[1]; - *r = ImagePointer[2]; - } - return TRUE; -} - - -bool wxPNGReader::SetIndex(int x, int y, int index) -{ - if (!Inside(x, y) || (Depth>8)) return FALSE; - - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - *ImagePointer = index; - - return TRUE; -} - -bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b) -{ - if (!Inside(x, y)) return FALSE; - - if (ColorType & COLORTYPE_PALETTE) - { - if (!m_palette) return FALSE; - SetIndex(x, y, m_palette->GetPixel(r, g, b)); - - } else { - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - ImagePointer[0] = b; - ImagePointer[1] = g; - ImagePointer[2] = r; - } - - return TRUE; -} - -bool wxPNGReader::SetPalette(wxPalette* colourmap) -{ - delete m_palette ; - if (!colourmap) - return FALSE; - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - m_palette = new wxPalette( *colourmap ); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -bool -wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b) -{ - delete m_palette ; - m_palette = new wxPalette(); - if (!m_palette) - return FALSE; - - if (!g) g = r; - if (!b) b = g; - m_palette->Create(n, r, g, b); - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -bool -wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct) -{ - delete m_palette ; - m_palette = new wxPalette(); - if (!m_palette) - return FALSE; - - byte r[256], g[256], b[256]; - - for(int i=0; iCreate(n, r, g, b); - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -void wxPNGReader::NullData() -{ - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - lpbi = NULL; - } - if (m_palette != NULL) { - delete m_palette; - m_palette = NULL; - } -} - -wxBitmap* wxPNGReader::GetBitmap(void) -{ - wxBitmap *bitmap = new wxBitmap; - if ( InstantiateBitmap(bitmap) ) - return bitmap; - else - { - delete bitmap; - return NULL; - } -} - -bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap) -{ - if ( lpbi ) - { - bitmap->SetHBITMAP((WXHBITMAP) lpbi); - bitmap->SetWidth(GetWidth()); - bitmap->SetHeight(GetHeight()); - bitmap->SetDepth(GetDepth()); - if ( GetDepth() > 1 && m_palette ) - bitmap->SetPalette(*m_palette); - bitmap->SetOk(TRUE); - - - // Make a mask if appropriate - /* - if ( bgindex > -1 ) - { - wxMask *mask = CreateMask(); - bitmap->SetMask(mask); - } - */ - lpbi = NULL ; // bitmap has taken over ownership - return TRUE; - } - else - { - return FALSE; - } - /* - HDC dc = ::CreateCompatibleDC(NULL); - - if (dc) - { - // tmpBitmap is a dummy, to satisfy ::CreateCompatibleDC (it - // is a memory dc that must have a bitmap selected into it) - HDC dc2 = GetDC(NULL); - HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight()); - ReleaseDC(NULL, dc2); - HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap); - - if ( m_palette ) - { - HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) m_palette->GetHPALETTE(), FALSE); - ::RealizePalette(dc); - } - - HBITMAP hBitmap = ::CreateDIBitmap(dc, lpbi, - CBM_INIT, RawImage, (LPBITMAPINFO) lpbi, DIB_PAL_COLORS); - - ::SelectPalette(dc, NULL, TRUE); - ::SelectObject(dc, oldBitmap); - ::DeleteObject(tmpBitmap); - ::DeleteDC(dc); - - if ( hBitmap ) - { - bitmap->SetHBITMAP((WXHBITMAP) hBitmap); - bitmap->SetWidth(GetWidth()); - bitmap->SetHeight(GetHeight()); - bitmap->SetDepth(GetDepth()); - if ( GetDepth() > 1 && m_palette ) - bitmap->SetPalette(*m_palette); - bitmap->SetOk(TRUE); - - - // Make a mask if appropriate - if ( bgindex > -1 ) - { - wxMask *mask = CreateMask(); - bitmap->SetMask(mask); - } - return TRUE; - } - else - { - return FALSE; - } - } - else - { - return FALSE; - } - */ - return false ; -} - -wxPalette *wxCopyPalette(const wxPalette *cmap) -{ - wxPalette *newCmap = new wxPalette( *cmap ) ; - return newCmap; -} - -wxMask *wxPNGReader::CreateMask(void) -{ -/* -HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); - - HDC dc = ::CreateCompatibleDC(NULL); - HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); - - int bgIndex = GetBGIndex(); - - int x,y; - - for (x=0; xSetMaskBitmap((WXHBITMAP) hBitmap); - return mask; - */ - return NULL ; -} - -bool wxPNGReader::ReadFile(char * ImageFileName) -{ - int number_passes; - - if (ImageFileName) - strcpy(filename, ImageFileName); - - FILE *fp; - png_struct *png_ptr; - png_info *info_ptr; - wxPNGReaderIter iter(this); - - /* open the file */ - fp = fopen( ImageFileName , "rb" ); - - if (!fp) - return FALSE; - - /* allocate the necessary structures */ - png_ptr = new (png_struct); - if (!png_ptr) - { - fclose(fp); - return FALSE; - } - - info_ptr = new (png_info); - if (!info_ptr) - { - fclose(fp); - delete png_ptr; - return FALSE; - } - /* set error handling */ - if (setjmp(png_ptr->jmpbuf)) - { - png_read_destroy(png_ptr, info_ptr, (png_info *)0); - fclose(fp); - delete png_ptr; - delete info_ptr; - - /* If we get here, we had a problem reading the file */ - return FALSE; - } - //png_set_error(ima_png_error, NULL); - - /* initialize the structures, info first for error handling */ - png_info_init(info_ptr); - png_read_init(png_ptr); - - /* set up the input control */ - png_init_io(png_ptr, fp); - - /* read the file information */ - png_read_info(png_ptr, info_ptr); - - /* allocate the memory to hold the image using the fields - of png_info. */ - png_color_16 my_background={ 0, 31, 127, 255, 0 }; - - if (info_ptr->valid & PNG_INFO_bKGD) - { - png_set_background(png_ptr, &(info_ptr->background), - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - if ( info_ptr->num_palette > 0 ) - bgindex = info_ptr->background.index; - } - else { - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - - // Added by JACS: guesswork! - if ( info_ptr->num_trans != 0 ) - bgindex = info_ptr->num_trans - 1 ; - } - - /* tell libpng to strip 16 bit depth files down to 8 bits */ - if (info_ptr->bit_depth == 16) - png_set_strip_16(png_ptr); - - int pixel_depth=(info_ptr->pixel_depth<24) ? info_ptr->pixel_depth: 24; - Create(info_ptr->width, info_ptr->height, pixel_depth, - info_ptr->color_type); - - if (info_ptr->num_palette>0) - { - SetPalette((int)info_ptr->num_palette, (rgb_color_struct*)info_ptr->palette); - } - - int row_stride = info_ptr->width * ((pixel_depth+7)>>3); - // printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride); - // printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth); - - byte *row_pointers = new byte[row_stride]; - - /* turn on interlace handling */ - if (info_ptr->interlace_type) - number_passes = png_set_interlace_handling(png_ptr); - else - number_passes = 1; - // printf("NP = %d ", number_passes); - - for (int pass=0; pass< number_passes; pass++) - { - iter.upset(); - int y=0; - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - // ignore shapedc - SetGWorld( (GWorldPtr) lpbi , NULL ) ; - do - { - // (unsigned char *)iter.GetRow(); - if (info_ptr->interlace_type) - { - if (pass>0) - iter.GetRow(row_pointers, row_stride); - png_read_row(png_ptr, row_pointers, NULL); - } - else - png_read_row(png_ptr, row_pointers, NULL); - - if ( info_ptr->palette ) - { - if ( pixel_depth == 8 ) - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - - int index = row_pointers[i] ; - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - /* - png_color_struct* color ; - RGBColor col ; - unsigned char* p = &row_pointers[0] ; - PenNormal() ; - MoveTo( 0 , y ) ; - int index = *p ; - color = &info_ptr->palette[index] ; - col.red = (color->red << 8) | color->red ; - col.green = (color->green << 8) | color->green ; - col.blue = (color->blue << 8) | color->blue ; - RGBForeColor( &col ) ; - col.red = col.green = col.blue = 0xFFFF ; - RGBBackColor( &col ) ; - for ( int i = 0 ; i < info_ptr->width ; ++i , ++p) - { - if ( *p != index ) - { - LineTo( i , y ) ; - index = *p ; - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - RGBForeColor( &col ) ; - } - } - LineTo( info_ptr->width , y ) ; - */ - } - else - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - - int byte = ( i * pixel_depth ) / 8 ; - int offset = ( 8 - pixel_depth ) - ( i * pixel_depth ) % 8 ; - - int index = ( row_pointers[byte] >> offset ) & ( 0xFF >> ( 8 - pixel_depth ) ); - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - } - } - else - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - color =(png_color_struct*) (&row_pointers[i*3]) ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - } - if (number_passes) - iter.SetRow(row_pointers, row_stride); - y++; - } - while(iter.PrevRow()); - SetGWorld( origPort , origDevice ) ; - - // printf("Y=%d ",y); - } - delete[] row_pointers; - - /* read the rest of the file, getting any additional chunks - in info_ptr */ - png_read_end(png_ptr, info_ptr); - - /* clean up after the read, and free any memory allocated */ - png_read_destroy(png_ptr, info_ptr, (png_info *)0); - - /* free the structures */ - delete png_ptr; - delete info_ptr; - - /* close the file */ - fclose(fp); - - /* that's it */ - return TRUE; -} - - -/* write a png file */ - -bool wxPNGReader::SaveFile(char * ImageFileName) -{ - if (ImageFileName) - strcpy(filename, ImageFileName); - - wxPNGReaderIter iter(this); - FILE *fp; - png_struct *png_ptr; - png_info *info_ptr; - - /* open the file */ - fp = fopen(filename, "wb"); - if (!fp) - return FALSE; - - /* allocate the necessary structures */ - png_ptr = new (png_struct); - if (!png_ptr) - { - fclose(fp); - return FALSE; - } - - info_ptr = new (png_info); - if (!info_ptr) - { - fclose(fp); - delete png_ptr; - return FALSE; - } - - /* set error handling */ - if (setjmp(png_ptr->jmpbuf)) - { - png_write_destroy(png_ptr); - fclose(fp); - delete png_ptr; - delete info_ptr; - - /* If we get here, we had a problem reading the file */ - return FALSE; - } - //png_set_error(ima_png_error, NULL); - - // printf("writig pg %s ", filename); - /* initialize the structures */ - png_info_init(info_ptr); - png_write_init(png_ptr); - - int row_stride = GetWidth() * ((GetDepth()+7)>>3); - /* set up the output control */ - png_init_io(png_ptr, fp); - - /* set the file information here */ - info_ptr->width = GetWidth(); - info_ptr->height = GetHeight(); - info_ptr->pixel_depth = GetDepth(); - info_ptr->channels = (GetDepth()>8) ? 3: 1; - info_ptr->bit_depth = GetDepth()/info_ptr->channels; - info_ptr->color_type = GetColorType(); - info_ptr->compression_type = info_ptr->filter_type = info_ptr->interlace_type=0; - info_ptr->valid = 0; - info_ptr->rowbytes = row_stride; - - - // printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels); - /* set the palette if there is one */ - if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette()) - { - // printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); - info_ptr->valid |= PNG_INFO_PLTE; - info_ptr->palette = new png_color[256]; - info_ptr->num_palette = 256; - for (int i=0; i<256; i++) - GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); - } - // printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); - - - /* optional significant bit chunk */ - // info_ptr->valid |= PNG_INFO_sBIT; - // info_ptr->sig_bit = true_bit_depth; - - /* optional gamma chunk */ - // info_ptr->valid |= PNG_INFO_gAMA; - // info_ptr->gamma = gamma; - - /* other optional chunks */ - - /* write the file information */ - png_write_info(png_ptr, info_ptr); - - /* set up the transformations you want. Note that these are - all optional. Only call them if you want them */ - - /* shift the pixels up to a legal bit depth and fill in - as appropriate to correctly scale the image */ - // png_set_shift(png_ptr, &(info_ptr->sig_bit)); - - /* pack pixels into bytes */ - // png_set_packing(png_ptr); - - /* flip bgr pixels to rgb */ - // png_set_bgr(png_ptr); - - /* swap bytes of 16 bit files to most significant bit first */ - // png_set_swap(png_ptr); - - /* get rid of filler bytes, pack rgb into 3 bytes */ - // png_set_rgbx(png_ptr); - - /* If you are only writing one row at a time, this works */ - - byte *row_pointers = new byte[row_stride]; - iter.upset(); - do { - // (unsigned char *)iter.GetRow(); - iter.GetRow(row_pointers, row_stride); - png_write_row(png_ptr, row_pointers); - } while(iter.PrevRow()); - - delete[] row_pointers; - - /* write the rest of the file */ - png_write_end(png_ptr, info_ptr); - - /* clean up after the write, and free any memory allocated */ - png_write_destroy(png_ptr); - - /* if you malloced the palette, free it here */ - if (info_ptr->palette) - delete[] (info_ptr->palette); - - /* free the structures */ - delete png_ptr; - delete info_ptr; - - /* close the file */ - fclose(fp); - - /* that's it */ - return TRUE; -} - -static int Power(int x, int y) -{ - int z = 1; - int i; - for ( i = 0; i < y; i++) - { - z *= x; - } - return z; -} - -static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', -'C', 'D', 'E', 'F' }; - -static void DecToHex(int dec, char *buf) -{ - int firstDigit = (int)(dec/16.0); - int secondDigit = (int)(dec - (firstDigit*16.0)); - buf[0] = hexArray[firstDigit]; - buf[1] = hexArray[secondDigit]; - buf[2] = 0; -} - - -bool wxPNGReader::SaveXPM(char *filename, char *name) -{ - char nameStr[256]; - if ( name ) - strcpy(nameStr, name); - else - { - wxString str = wxString::FromAscii(filename) ; - wxStripExtension( str ) ; - strcpy(nameStr, str.ToAscii() ); - } - - if ( GetDepth() > 4 ) - { - // Only a depth of 4 and below allowed - return FALSE; - } - - if ( !GetPalette() ) - return FALSE; - - wxSTD ofstream str(filename); - if ( str.bad() ) - return FALSE; - - int noColours = Power(2, GetDepth()); - - // Output header - str << "/* XPM */\n"; - str << "static char * " << nameStr << "_xpm[] = {\n"; - str << "\"" << GetWidth() << " " << GetHeight() << " " << noColours << " 1\",\n"; - - // Output colourmap - int base = 97 ; // start from 'a' - - unsigned char red, green, blue; - char hexBuf[4]; - int i; - for ( i = 0; i < noColours; i ++) - { - str << "\"" << (char)(base + i) << " c #"; - GetPalette()->GetRGB(i, &red, &green, &blue); - DecToHex(red, hexBuf); - str << hexBuf; - DecToHex(green, hexBuf); - str << hexBuf; - DecToHex(blue, hexBuf); - str << hexBuf; - str << "\",\n"; - } - - // Output the data - int x, y; - for ( y = 0; y < GetHeight(); y++) - { - str << "\""; - for ( x = 0; x < GetWidth(); x++) - { - int index = GetIndex(x, y); - str << (char)(base + index) ; - } - str << "\",\n"; - } - - str << "};\n"; - str.flush(); - - return TRUE; -} - - -IMPLEMENT_DYNAMIC_CLASS(wxPNGFileHandler, wxBitmapHandler) - -bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - wxPNGReader reader; - if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) ) - { - return reader.InstantiateBitmap(bitmap); - } - else - return FALSE; -} - -bool wxPNGFileHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal) -{ - return FALSE; -} - diff --git a/src/mac/carbon/printdlg.cpp b/src/mac/carbon/printdlg.cpp deleted file mode 100644 index 89f2789250..0000000000 --- a/src/mac/carbon/printdlg.cpp +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.cpp -// Purpose: wxPrintDialog, wxPageSetupDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "printdlg.h" -#endif - -#include "wx/object.h" -#include "wx/printdlg.h" -#include "wx/dcprint.h" -#include "wx/msgdlg.h" -#include "wx/mac/private/print.h" - -// Use generic page setup dialog: use your own native one if one exists. - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog) -IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog) -#endif - -wxPrintDialog::wxPrintDialog() -{ - m_dialogParent = NULL; - m_printerDC = NULL; - m_destroyDC = TRUE; -} - -wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data) -{ - Create(p, data); -} - -wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data) -{ - wxPrintDialogData data2; - if ( data ) - data2 = *data; - - Create(p, &data2); -} - -bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data) -{ - m_dialogParent = p; - m_printerDC = NULL; - m_destroyDC = TRUE; - - if ( data ) - m_printDialogData = *data; - - return TRUE; -} - -wxPrintDialog::~wxPrintDialog() -{ - if (m_destroyDC && m_printerDC) { - delete m_printerDC; - m_printerDC = NULL; - } -} - -int wxPrintDialog::ShowModal() -{ - m_printDialogData.ConvertToNative() ; - int result = m_printDialogData.GetPrintData().m_nativePrintData->ShowPrintDialog() ; - if ( result == wxID_OK ) - m_printDialogData.ConvertFromNative() ; - - return result ; -} - -wxDC *wxPrintDialog::GetPrintDC() -{ - return new wxPrinterDC( m_printDialogData.GetPrintData() ) ; -} - -/* -* wxPageSetupDialog -*/ - -wxPageSetupDialog::wxPageSetupDialog(): -wxDialog() -{ - m_dialogParent = NULL; -} - -wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data): -wxDialog() -{ - Create(p, data); -} - -bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data) -{ - m_dialogParent = p; - - if (data) - m_pageSetupData = (*data); - - return TRUE; -} - -wxPageSetupDialog::~wxPageSetupDialog() -{ -} - -int wxPageSetupDialog::ShowModal() -{ - m_pageSetupData.ConvertToNative() ; - int result = m_pageSetupData.GetPrintData().m_nativePrintData->ShowPageSetupDialog() ; - if (result == wxID_OK ) - m_pageSetupData.ConvertFromNative() ; - - return result ; -} - diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp deleted file mode 100644 index a053eb7d80..0000000000 --- a/src/mac/carbon/printmac.cpp +++ /dev/null @@ -1,781 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printwin.cpp -// Purpose: wxMacPrinter framework -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "printwin.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/dc.h" -#include "wx/app.h" -#include "wx/msgdlg.h" -#endif - -#include "wx/mac/uma.h" - -#include "wx/mac/printmac.h" -#include "wx/mac/private/print.h" - -#define mm2pt 2.83464566929 -#define pt2mm 0.352777777778 - -#include "wx/dcprint.h" -#include "wx/printdlg.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMacPrinter, wxPrinterBase) -IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase) -#endif - -#if TARGET_CARBON - -wxNativePrintData* wxNativePrintData::Create() -{ - return new wxMacCarbonPrintData() ; -} - -wxMacCarbonPrintData::wxMacCarbonPrintData() -{ - m_macPageFormat = kPMNoPageFormat; - m_macPrintSettings = kPMNoPrintSettings; - m_macPrintSession = kPMNoReference ; - ValidateOrCreate() ; -} - -wxMacCarbonPrintData::~wxMacCarbonPrintData() -{ - if (m_macPageFormat != kPMNoPageFormat) - { - (void)PMRelease(m_macPageFormat); - m_macPageFormat = kPMNoPageFormat; - } - - if (m_macPrintSettings != kPMNoPrintSettings) - { - (void)PMRelease(m_macPrintSettings); - m_macPrintSettings = kPMNoPrintSettings; - } - - if ( m_macPrintSession != kPMNoReference ) - { - (void)PMRelease(m_macPrintSession); - m_macPrintSession = kPMNoReference; - } -} - -void wxMacCarbonPrintData::ValidateOrCreate() -{ - OSStatus err = noErr ; - if ( m_macPrintSession == kPMNoReference ) - { - err = PMCreateSession( (PMPrintSession *) &m_macPrintSession ) ; - } - // Set up a valid PageFormat object. - if ( m_macPageFormat == kPMNoPageFormat) - { - err = PMCreatePageFormat((PMPageFormat *) &m_macPageFormat); - - // Note that PMPageFormat is not session-specific, but calling - // PMSessionDefaultPageFormat assigns values specific to the printer - // associated with the current printing session. - if ((err == noErr) && - ( m_macPageFormat != kPMNoPageFormat)) - { - err = PMSessionDefaultPageFormat((PMPrintSession) m_macPrintSession, - (PMPageFormat) m_macPageFormat); - } - } - else - { - err = PMSessionValidatePageFormat((PMPrintSession) m_macPrintSession, - (PMPageFormat) m_macPageFormat, - kPMDontWantBoolean); - } - - // Set up a valid PrintSettings object. - if ( m_macPrintSettings == kPMNoPrintSettings) - { - err = PMCreatePrintSettings((PMPrintSettings *) &m_macPrintSettings); - - // Note that PMPrintSettings is not session-specific, but calling - // PMSessionDefaultPrintSettings assigns values specific to the printer - // associated with the current printing session. - if ((err == noErr) && - ( m_macPrintSettings != kPMNoPrintSettings)) - { - err = PMSessionDefaultPrintSettings((PMPrintSession) m_macPrintSession, - (PMPrintSettings) m_macPrintSettings); - } - } - else - { - err = PMSessionValidatePrintSettings((PMPrintSession) m_macPrintSession, - (PMPrintSettings) m_macPrintSettings, - kPMDontWantBoolean); - } -} - -void wxMacCarbonPrintData::TransferFrom( wxPrintData* data ) -{ - ValidateOrCreate() ; - PMSetCopies( (PMPrintSettings) m_macPrintSettings , data->GetNoCopies() , false ) ; - PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data->GetOrientation() == wxLANDSCAPE ) ? - kPMLandscape : kPMPortrait , false ) ; - // collate cannot be set -#if 0 // not yet tested - if ( m_printerName.Length() > 0 ) - PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ; -#endif - PMColorMode color ; - PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ; - if ( data->GetColour() ) - { - if ( color == kPMBlackAndWhite ) - PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMColor ) ; - } - else - PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMBlackAndWhite ) ; - - // PMDuplexMode not yet accessible via API - // PMQualityMode not yet accessible via API - // todo paperSize -} - -void wxMacCarbonPrintData::TransferTo( wxPrintData* data ) -{ - OSStatus err = noErr ; - - UInt32 copies ; - err = PMGetCopies( m_macPrintSettings , &copies ) ; - if ( err == noErr ) - data->SetNoCopies( copies ) ; - - PMOrientation orientation ; - err = PMGetOrientation( m_macPageFormat , &orientation ) ; - if ( err == noErr ) - { - if ( orientation == kPMPortrait || orientation == kPMReversePortrait ) - data->SetOrientation( wxPORTRAIT ); - else - data->SetOrientation( wxLANDSCAPE ); - } - - // collate cannot be set -#if 0 - { - wxMacCFStringHolder name ; - PMPrinter printer ; - PMSessionGetCurrentPrinter( m_macPrintSession , - &printer ) ; - m_printerName = name.AsString() ; - } -#endif - - PMColorMode color ; - err = PMGetColorMode( m_macPrintSettings, &color ) ; - if ( err == noErr ) - data->SetColour( !(color == kPMBlackAndWhite) ) ; - - // PMDuplexMode not yet accessible via API - // PMQualityMode not yet accessible via API - // todo paperSize - PMRect rPaper; - err = PMGetUnadjustedPaperRect( m_macPageFormat, &rPaper); - if ( err == noErr ) - { - data->SetPaperSize( wxSize ( - (int)(( rPaper.right - rPaper.left ) * pt2mm + 0.5 ) , - (int)(( rPaper.bottom - rPaper.top ) * pt2mm + 0.5 ) ) ); - } -} - -void wxMacCarbonPrintData::TransferFrom( wxPageSetupData *data ) -{ - // should we setup the page rect here ? - // since MacOS sometimes has two same paper rects with different - // page rects we could make it roundtrip safe perhaps -#if TARGET_CARBON -#else -#endif -} - -void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data ) -{ - PMRect rPaper; - OSStatus err = PMGetUnadjustedPaperRect(m_macPageFormat, &rPaper); - if ( err == noErr ) - { - PMRect rPage ; - err = PMGetUnadjustedPageRect(m_macPageFormat , &rPage ) ; - if ( err == noErr ) - { - data->SetMinMarginTopLeft( wxPoint ( - (int)(((double) rPage.left - rPaper.left ) * pt2mm) , - (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; - - data->SetMinMarginBottomRight( wxPoint ( - (wxCoord)(((double) rPaper.right - rPage.right ) * pt2mm), - (wxCoord)(((double) rPaper.bottom - rPage.bottom ) * pt2mm)) ) ; - } - } -} - -void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data ) -{ - UInt32 minPage , maxPage ; - PMGetPageRange( m_macPrintSettings , &minPage , &maxPage ) ; - data->SetMinPage( minPage ) ; - data->SetMaxPage( maxPage ) ; - UInt32 copies ; - PMGetCopies( m_macPrintSettings , &copies ) ; - data->SetNoCopies( copies ) ; - UInt32 from , to ; - PMGetFirstPage( m_macPrintSettings , &from ) ; - PMGetLastPage( m_macPrintSettings , &to ) ; - data->SetFromPage( from ) ; - data->SetToPage( to ) ; -} - -void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data ) -{ - PMSetPageRange( m_macPrintSettings , data->GetMinPage() , data->GetMaxPage() ) ; - PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ; - PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ; - - int toPage = data->GetToPage(); - if (toPage < 1) - toPage = data->GetFromPage(); - PMSetLastPage( m_macPrintSettings , toPage , false ) ; -} - -void wxMacCarbonPrintData::CopyFrom( wxNativePrintData* d ) -{ - wxMacCarbonPrintData *data = (wxMacCarbonPrintData*) d ; - if ( data->m_macPrintSession != kPMNoReference ) - PMRetain( data->m_macPrintSession ) ; - if ( m_macPrintSession != kPMNoReference ) - { - PMRelease( m_macPrintSession ) ; - m_macPrintSession = kPMNoReference ; - } - if ( data->m_macPrintSession != kPMNoReference ) - m_macPrintSession = data->m_macPrintSession ; - - if ( data->m_macPrintSettings != kPMNoPrintSettings ) - PMRetain( data->m_macPrintSettings ) ; - if ( m_macPrintSettings != kPMNoPrintSettings ) - { - PMRelease( m_macPrintSettings ) ; - m_macPrintSettings = kPMNoPrintSettings ; - } - if ( data->m_macPrintSettings != kPMNoPrintSettings ) - m_macPrintSettings = data->m_macPrintSettings ; - - if ( data->m_macPageFormat != kPMNoPageFormat ) - PMRetain( data->m_macPageFormat ) ; - if ( m_macPageFormat != kPMNoPageFormat ) - { - PMRelease( m_macPageFormat ) ; - m_macPageFormat = kPMNoPageFormat ; - } - if ( data->m_macPageFormat != kPMNoPageFormat ) - m_macPageFormat = data->m_macPageFormat ; -} - -int wxMacCarbonPrintData::ShowPrintDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - Boolean accepted; - - { - // Display the Print dialog. - if (err == noErr) - { - err = PMSessionPrintDialog( m_macPrintSession, - m_macPrintSettings, - m_macPageFormat, - &accepted); - if ((err == noErr) && !accepted) - { - err = kPMCancel; // user clicked Cancel button - } - } - if ( err == noErr ) - { - result = wxID_OK ; - } - } - if ((err != noErr) && (err != kPMCancel)) - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return result ; -} - -int wxMacCarbonPrintData::ShowPageSetupDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - Boolean accepted; - { - // Display the Page Setup dialog. - if (err == noErr) - { - err = PMSessionPageSetupDialog( m_macPrintSession, - m_macPageFormat, - &accepted); - if ((err == noErr) && !accepted) - { - err = kPMCancel; // user clicked Cancel button - } - } - - // If the user did not cancel, flatten and save the PageFormat object - // with our document. - if (err == noErr) { - result = wxID_OK ; - } - } - if ((err != noErr) && (err != kPMCancel)) - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return result ; -} - -#else - -wxNativePrintData* wxNativePrintData::Create() -{ - return new wxMacClassicPrintData() ; -} - -wxMacClassicPrintData::wxMacClassicPrintData() -{ - m_macPrintSettings = NULL ; - ValidateOrCreate() ; -} - -wxMacClassicPrintData::~wxMacClassicPrintData() -{ - wxASSERT( m_macPrintSettings ); - DisposeHandle( (Handle) m_macPrintSettings ) ; -} - -void wxMacClassicPrintData::ValidateOrCreate() -{ - if ( m_macPrintSettings == NULL ) - { - m_macPrintSettings = (THPrint) NewHandleClear( sizeof( TPrint ) ); - (**m_macPrintSettings).iPrVersion = 0; // something invalid - - (**m_macPrintSettings).prInfo.iHRes = 72; - (**m_macPrintSettings).prInfo.iVRes = 72; - Rect r1 = { 0, 0, 8*72 - 2 * 18, 11*72 - 2 * 36 }; - (**m_macPrintSettings).prInfo.rPage = r1;// must have its top left & (0,0) - - Rect r2 = { -18, -36, 8*72 - 18, 11*72 - 36 }; - (**m_macPrintSettings).rPaper = r2; - (**m_macPrintSettings).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch - (**m_macPrintSettings).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch - } - else - { - } -} - -void wxMacClassicPrintData::TransferFrom( wxPrintData* data ) -{ - ValidateOrCreate() ; - (**m_macPrintSettings).prJob.iCopies = data->GetNoCopies() ; - // on mac the paper rect has a negative top left corner, because the page rect (printable area) is at 0,0 - // if all printing data is consolidated in on structure we will be able to set additional infos about pages -} - -void wxMacClassicPrintData::TransferTo( wxPrintData* data ) -{ - data->SetNoCopies( (**m_macPrintSettings).prJob.iCopies ); - data->SetPaperSize( wxSize( - ((double) (**m_macPrintSettings).rPaper.right - (**m_macPrintSettings).rPaper.left ) * pt2mm , - ((double) (**m_macPrintSettings).rPaper.bottom - (**m_macPrintSettings).rPaper.top ) * pt2mm ) ) ; -} - -void wxMacClassicPrintData::TransferFrom( wxPageSetupData *data ) -{ -} - -void wxMacClassicPrintData::TransferTo( wxPageSetupData* data ) -{ - data->SetMinMarginTopLeft( wxPoint( - ((double) (**m_macPrintSettings).prInfo.rPage.left -(**m_macPrintSettings).rPaper.left ) * pt2mm , - ((double) (**m_macPrintSettings).prInfo.rPage.top -(**m_macPrintSettings).rPaper.top ) * pt2mm ) ) ; - data->SetMinMarginBottomRight( wxPoint( - ((double) (**m_macPrintSettings).rPaper.right - (**m_macPrintSettings).prInfo.rPage.right ) * pt2mm , - ((double)(**m_macPrintSettings).rPaper.bottom - (**m_macPrintSettings).prInfo.rPage.bottom ) * pt2mm ) ) ; -} - -void wxMacClassicPrintData::TransferFrom( wxPrintDialogData* data ) -{ - int toPage = data->GetToPage(); - if (toPage < 1) - toPage = data->GetFromPage(); - (**m_macPrintSettings).prJob.iFstPage = data->GetFromPage() ; - (**m_macPrintSettings).prJob.iLstPage = toPage; -} - -void wxMacClassicPrintData::TransferTo( wxPrintDialogData* data ) -{ - data->SetFromPage( (**m_macPrintSettings).prJob.iFstPage ) ; - data->SetToPage( (**m_macPrintSettings).prJob.iLstPage ) ; -} - -void wxMacClassicPrintData::CopyFrom( wxNativePrintData* data ) -{ - DisposeHandle( (Handle) m_macPrintSettings ) ; - m_macPrintSettings = ((wxMacClassicPrintData*)data)->m_macPrintSettings; - HandToHand( (Handle*) &m_macPrintSettings ); -} - -int wxMacClassicPrintData::ShowPrintDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - err = ::UMAPrOpen() ; - if ( err == noErr ) - { - if ( ::PrJobDialog( m_macPrintSettings ) ) - { - result = wxID_OK ; - } - - } - else - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxT(""), wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - ::UMAPrClose() ; - - return result ; -} - -int wxMacClassicPrintData::ShowPageSetupDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - err = ::UMAPrOpen() ; - if ( err == noErr ) - { - if ( ::PrStlDialog( m_macPrintSettings ) ) - { - result = wxID_OK ; - } - - } - else - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - ::UMAPrClose() ; - return result ; -} - -#endif - -/* -* Printer -*/ - -wxMacPrinter::wxMacPrinter(wxPrintDialogData *data): -wxPrinterBase(data) -{ -} - -wxMacPrinter::~wxMacPrinter(void) -{ -} - -bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) -{ - sm_abortIt = FALSE; - sm_abortWindow = NULL; - - if (!printout) - return FALSE; - - printout->SetIsPreview(FALSE); - if (m_printDialogData.GetMinPage() < 1) - m_printDialogData.SetMinPage(1); - if (m_printDialogData.GetMaxPage() < 1) - m_printDialogData.SetMaxPage(9999); - - // Create a suitable device context - wxDC *dc = NULL; - if (prompt) - { - wxPrintDialog dialog(parent, & m_printDialogData); - if (dialog.ShowModal() == wxID_OK) - { - dc = dialog.GetPrintDC(); - m_printDialogData = dialog.GetPrintDialogData(); - } - } - else - { - dc = new wxPrinterDC( m_printDialogData.GetPrintData() ) ; - } - - - // May have pressed cancel. - if (!dc || !dc->Ok()) - { - if (dc) delete dc; - return FALSE; - } - - // on the mac we have always pixels as addressing mode with 72 dpi - - printout->SetPPIScreen(72, 72); - printout->SetPPIPrinter(72, 72); - - // Set printout parameters - printout->SetDC(dc); - - int w, h; - wxCoord ww, hh; - dc->GetSize(&w, &h); - printout->SetPageSizePixels((int)w, (int)h); - dc->GetSizeMM(&ww, &hh); - printout->SetPageSizeMM((int)ww, (int)hh); - - // Create an abort window - wxBeginBusyCursor(); - - printout->OnPreparePrinting(); - - // Get some parameters from the printout, if defined - int fromPage, toPage; - int minPage, maxPage; - printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); - - if (maxPage == 0) - { - wxEndBusyCursor(); - return FALSE; - } - - // Only set min and max, because from and to have been - // set by the user - m_printDialogData.SetMinPage(minPage); - m_printDialogData.SetMaxPage(maxPage); - - wxWindow *win = CreateAbortWindow(parent, printout); - wxSafeYield(win,true); - - if (!win) - { - wxEndBusyCursor(); - wxMessageBox(wxT("Sorry, could not create an abort dialog."), wxT("Print Error"), wxOK, parent); - delete dc; - return FALSE; - } - sm_abortWindow = win; - sm_abortWindow->Show(TRUE); - wxSafeYield(win,true); - - printout->OnBeginPrinting(); - - bool keepGoing = TRUE; - - int copyCount; - for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++) - { - if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage())) - { - wxEndBusyCursor(); - wxMessageBox(wxT("Could not start printing."), wxT("Print Error"), wxOK, parent); - break; - } - if (sm_abortIt) - break; - - int pn; - for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn); - pn++) - { - if (sm_abortIt) - { - keepGoing = FALSE; - break; - } - else - { -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) -#endif - { - GrafPtr thePort ; - GetPort( &thePort ) ; - wxSafeYield(win,true); - SetPort( thePort ) ; - } - dc->StartPage(); - keepGoing = printout->OnPrintPage(pn); - dc->EndPage(); - } - } - printout->OnEndDocument(); - } - - printout->OnEndPrinting(); - - if (sm_abortWindow) - { - sm_abortWindow->Show(FALSE); - delete sm_abortWindow; - sm_abortWindow = NULL; - } - - wxEndBusyCursor(); - - delete dc; - - return TRUE; -} - -wxDC* wxMacPrinter::PrintDialog(wxWindow *parent) -{ - wxDC* dc = (wxDC*) NULL; - - wxPrintDialog dialog(parent, & m_printDialogData); - int ret = dialog.ShowModal(); - - if (ret == wxID_OK) - { - dc = dialog.GetPrintDC(); - m_printDialogData = dialog.GetPrintDialogData(); - } - - return dc; -} - -bool wxMacPrinter::Setup(wxWindow *parent) -{ - wxPrintDialog dialog(parent, & m_printDialogData); - dialog.GetPrintDialogData().SetSetupDialog(TRUE); - - int ret = dialog.ShowModal(); - - if (ret == wxID_OK) - { - m_printDialogData = dialog.GetPrintDialogData(); - } - - return (ret == wxID_OK); -} - -/* -* Print preview -*/ - -wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintDialogData *data) - : wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - DetermineScaling(); -} - -wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): -wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - DetermineScaling(); -} - -wxMacPrintPreview::~wxMacPrintPreview(void) -{ -} - -bool wxMacPrintPreview::Print(bool interactive) -{ - if (!m_printPrintout) - return FALSE; - wxMacPrinter printer(&m_printDialogData); - return printer.Print(m_previewFrame, m_printPrintout, interactive); -} - -void wxMacPrintPreview::DetermineScaling(void) -{ - int screenWidth , screenHeight ; - wxDisplaySize( &screenWidth , &screenHeight ) ; - - m_previewPrintout->SetPPIScreen( 72 , 72 ) ; - m_previewPrintout->SetPPIPrinter( 72 , 72 ) ; - m_previewPrintout->SetPageSizeMM( (int) (8.0 * 25.6), (int) (11.0 * 25.6) ); - m_previewPrintout->SetPageSizePixels( 8 * 72 , 11 * 72 ) ; - m_pageWidth = 8 * 72 ; - m_pageHeight = 11 * 72 ; - m_previewScale = 1 ; - - // Get a device context for the currently selected printer - wxPrinterDC printerDC(m_printDialogData.GetPrintData()); - if (printerDC.Ok()) - { - int x , y ; - wxCoord ww, hh; - printerDC.GetSizeMM(&ww, &hh); - printerDC.GetSize( &x , &y ) ; - m_previewPrintout->SetPageSizeMM((int)ww, (int)hh); - m_previewPrintout->SetPageSizePixels( x , y) ; - m_pageWidth = x ; - m_pageHeight = y ; - m_isOk = true ; - } - else - { - m_isOk = false ; - } - // At 100%, the page should look about page-size on the screen. - // m_previewScale = (float)((float)screenWidth/(float)printerWidth); - // m_previewScale = m_previewScale * (float)((float)screenXRes/(float)printerXRes); - - m_previewScale = 1 ; -} diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp deleted file mode 100644 index 103d68ca44..0000000000 --- a/src/mac/carbon/radiobox.cpp +++ /dev/null @@ -1,580 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp -// Purpose: wxRadioBox -// Author: Stefan Csomor -// Modified by: JS Lair (99/11/15) first implementation -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radioboxbase.h" -#pragma implementation "radiobox.h" -#endif - -//------------------------------------------------------------------------------------- -// headers -//------------------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/arrstr.h" - -#include "wx/radiobox.h" -#include "wx/radiobut.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif - -//------------------------------------------------------------------------------------- -// ¥ wxRadioBox() -//------------------------------------------------------------------------------------- -// Default constructor -BEGIN_EVENT_TABLE(wxRadioBox, wxControl) -EVT_RADIOBUTTON( -1 , wxRadioBox::OnRadioButton ) -END_EVENT_TABLE() - -void wxRadioBox::OnRadioButton( wxCommandEvent &outer ) -{ - if ( outer.IsChecked() ) - { - wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId); - int i = GetSelection() ; - event.SetInt( i ); - event.SetString( GetString( i ) ); - event.SetEventObject( this ); - ProcessCommand(event); - } -} - -wxRadioBox::wxRadioBox() -{ - m_noItems = 0; - m_noRowsOrCols = 0; - m_majorDim = 0 ; - m_radioButtonCycle = NULL; -} - -//------------------------------------------------------------------------------------- -// ¥ wxRadioBox(wxWindow*, wxWindowID, const wxString&, const wxPoint&, -// const wxSize&, int, const wxString[], int, long, -// const wxValidator&, const wxString&) -//------------------------------------------------------------------------------------- -// Contructor, creating and showing a radiobox -// -// inline defined -// - -//------------------------------------------------------------------------------------- -// ¥ ~wxRadioBox -//------------------------------------------------------------------------------------- -// Destructor, destroying the radiobox item - -wxRadioBox::~wxRadioBox() -{ - m_isBeingDeleted = TRUE; - - wxRadioButton *next,*current; - - current=m_radioButtonCycle->NextInCycle(); - next=current->NextInCycle(); - while (current!=m_radioButtonCycle) { - delete current; - current=next; - next=current->NextInCycle(); - } - delete current; -} - -//------------------------------------------------------------------------------------- -// ¥ Create -//------------------------------------------------------------------------------------- -// Create the radiobox for two-step construction - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, label, pos, size, chs.GetCount(), - chs.GetStrings(), majorDim, style, val, name); -} - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, const wxSize& size, - int n, const wxString choices[], - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, val, name) ) - return false; - - int i; - - m_noItems = n; - m_noRowsOrCols = majorDim; - m_radioButtonCycle = NULL; - - if (majorDim==0) - m_majorDim = n ; - else - m_majorDim = majorDim ; - - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlGroupBoxTextTitleProc , (long) this ) ; - - for (i = 0; i < n; i++) - { - wxRadioButton *radBtn = new wxRadioButton - ( - this, - wxID_ANY, - wxStripMenuCodes(choices[i]), - wxPoint(5,20*i+10), - wxDefaultSize, - i == 0 ? wxRB_GROUP : 0 - ); - if ( i == 0 ) - m_radioButtonCycle = radBtn ; - // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); - } - - SetSelection(0); - MacPostControlCreate() ; - - return TRUE; -} - - -//------------------------------------------------------------------------------------- -// ¥ Enable(bool) -//------------------------------------------------------------------------------------- -// Enables or disables the entire radiobox - -bool wxRadioBox::Enable(bool enable) -{ - int i; - wxRadioButton *current; - - if (!wxControl::Enable(enable)) - return false; - - current = m_radioButtonCycle; - for (i = 0; i < m_noItems; i++) { - current->Enable(enable); - current = current->NextInCycle(); - } - return true; -} - -//------------------------------------------------------------------------------------- -// ¥ Enable(int, bool) -//------------------------------------------------------------------------------------- -// Enables or disables an given button - -void wxRadioBox::Enable(int item, bool enable) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - - i = 0; - current = m_radioButtonCycle; - while (i != item) { - i++; - current = current->NextInCycle(); - } - current->Enable(enable); -} - -//------------------------------------------------------------------------------------- -// ¥ GetLabel() -//------------------------------------------------------------------------------------- -// Returns the radiobox label - -wxString wxRadioBox::GetLabel() const -{ - return wxControl::GetLabel(); -} - -//------------------------------------------------------------------------------------- -// ¥ GetLabel(int) -//------------------------------------------------------------------------------------- -// Returns the label for the given button - -wxString wxRadioBox::GetString(int item) const -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return wxEmptyString; - - i = 0; - current = m_radioButtonCycle; - while (i != item) { - i++; - current = current->NextInCycle(); - } - return current->GetLabel(); -} - -//------------------------------------------------------------------------------------- -// ¥ GetSelection -//------------------------------------------------------------------------------------- -// Returns the zero-based position of the selected button - -int wxRadioBox::GetSelection() const -{ - int i; - wxRadioButton *current; - - i=0; - current=m_radioButtonCycle; - while (!current->GetValue()) { - i++; - current=current->NextInCycle(); - } - - return i; -} - -//------------------------------------------------------------------------------------- -// ¥ Number -//------------------------------------------------------------------------------------- -// Returns the number of buttons in the radiobox -// -// inline defined -// - -//------------------------------------------------------------------------------------- -// ¥ SetLabel(const wxString&) -//------------------------------------------------------------------------------------- -// Sets the radiobox label - -void wxRadioBox::SetLabel(const wxString& label) -{ - return wxControl::SetLabel(label); -} - -//------------------------------------------------------------------------------------- -// ¥ SetLabel(int, const wxString&) -//------------------------------------------------------------------------------------- -// Sets the label of a given button - -void wxRadioBox::SetString(int item,const wxString& label) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - return current->SetLabel(label); -} - -//------------------------------------------------------------------------------------- -// ¥ SetSelection -//------------------------------------------------------------------------------------- -// Sets a button by passing the desired position. This does not cause -// wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted - -void wxRadioBox::SetSelection(int item) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - current->SetValue(true); - -} - -//------------------------------------------------------------------------------------- -// ¥ Show(bool) -//------------------------------------------------------------------------------------- -// Shows or hides the entire radiobox - -bool wxRadioBox::Show(bool show) -{ - int i; - wxRadioButton *current; - - wxControl::Show(show); - - current=m_radioButtonCycle; - for (i=0;iShow(show); - current=current->NextInCycle(); - } - return true; -} - -//------------------------------------------------------------------------------------- -// ¥ Show(int, bool) -//------------------------------------------------------------------------------------- -// Shows or hides the given button - -void wxRadioBox::Show(int item, bool show) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - current->Show(show); -} - -//------------------------------------------------------------------------------------- -// ¥ Command -//------------------------------------------------------------------------------------- -// Simulates the effect of the user issuing a command to the item - -void wxRadioBox::Command (wxCommandEvent & event) -{ - SetSelection (event.GetInt()); - ProcessCommand (event); -} - -//------------------------------------------------------------------------------------- -// ¥ SetFocus -//------------------------------------------------------------------------------------- -// Sets the selected button to receive keyboard input - -void wxRadioBox::SetFocus() -{ - int i; - wxRadioButton *current; - - i=0; - current=m_radioButtonCycle; - while (!current->GetValue()) { - i++; - current=current->NextInCycle(); - } - current->SetFocus(); -} - - -//------------------------------------------------------------------------------------- -// ¥ DoSetSize -//------------------------------------------------------------------------------------- -// Simulates the effect of the user issuing a command to the item - -#define RADIO_SIZE 20 - -void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - int i; - wxRadioButton *current; - - // define the position - - int x_current, y_current; - int x_offset,y_offset; - int widthOld, heightOld; - GetSize(&widthOld, &heightOld); - - x_offset = x; - y_offset = y; - GetPosition(&x_current, &y_current); - if ((x == -1) && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - x_offset = x_current; - if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - y_offset = y_current; - - // define size - - int charWidth,charHeight; - int maxWidth,maxHeight; - int eachWidth[128],eachHeight[128]; - int totWidth,totHeight; - - SetFont(GetParent()->GetFont()); - GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight); - charWidth/=52; - - maxWidth=-1; - maxHeight=-1; - for (i = 0 ; i < m_noItems; i++) - { - GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i]); - eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE); - eachHeight[i] = (int)((3*eachHeight[i])/2); - if (maxWidth= 0x1030 ) - { - //need to add a few more pixels for the top border on panther - y_start = y_start + 5; //how many exactly should this be to meet the HIG? - } - x_offset = x_start; - y_offset = y_start; - - current=m_radioButtonCycle; - for ( i = 0 ; i < m_noItems; i++) - { - if (i&&((i%m_majorDim)==0)) // not to do for the zero button! - { - if (m_windowStyle & wxRA_VERTICAL) - { - x_offset += maxWidth + charWidth; - y_offset = y_start; - } - else - { - x_offset = x_start; - y_offset += maxHeight ; /*+ charHeight/2;*/ - } - } - - current->SetSize(x_offset,y_offset,eachWidth[i],eachHeight[i]); - current=current->NextInCycle(); - - if (m_windowStyle & wxRA_SPECIFY_ROWS) - y_offset += maxHeight ; /*+ charHeight/2;*/ - else - x_offset += maxWidth + charWidth; - } -} - -wxSize wxRadioBox::DoGetBestSize() const -{ - int charWidth, charHeight; - int maxWidth, maxHeight; - int eachWidth, eachHeight; - int totWidth, totHeight; - - wxFont font = GetParent()->GetFont(); - GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), - &charWidth, &charHeight, NULL, NULL, &font); - charWidth /= 52; - - maxWidth = -1; - maxHeight = -1; - - for (int i = 0 ; i < m_noItems; i++) - { - GetTextExtent(GetString(i), &eachWidth, &eachHeight); - eachWidth = (int)(eachWidth + RADIO_SIZE) ; - eachHeight = (int)((3 * eachHeight) / 2); - if (maxWidth < eachWidth) maxWidth = eachWidth; - if (maxHeight < eachHeight) maxHeight = eachHeight; - } - - totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight ; - totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth; - - if ( UMAGetSystemVersion() >= 0x1030 ) - { - //need to add a few more pixels for the static boxborder on panther - totHeight = totHeight + 10; //how many exactly should this be to meet the HIG? - } - // handle radio box title as well - GetTextExtent(GetTitle(), &eachWidth, NULL); - eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ; - if (totWidth < eachWidth) - totWidth = eachWidth; - - return wxSize(totWidth, totHeight); -} -//------------------------------------------------------------------------------------- -// ¥ GetNumVer -//------------------------------------------------------------------------------------- -// return the number of buttons in the vertical direction - -int wxRadioBox::GetRowCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return m_majorDim; - } - else - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } -} - -//------------------------------------------------------------------------------------- -// ¥ GetNumHor -//------------------------------------------------------------------------------------- -// return the number of buttons in the horizontal direction - -int wxRadioBox::GetColumnCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } - else - { - return m_majorDim; - } -} - - - - - diff --git a/src/mac/carbon/radiobut.cpp b/src/mac/carbon/radiobut.cpp deleted file mode 100644 index 991c8be68f..0000000000 --- a/src/mac/carbon/radiobut.cpp +++ /dev/null @@ -1,150 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp -// Purpose: wxRadioButton -// Author: AUTHOR -// Modified by: JS Lair (99/11/15) adding the cyclic groupe notion for radiobox -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobut.h" -#endif - -#include "wx/defs.h" - -#include "wx/radiobut.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) -#endif - -#include "wx/mac/uma.h" - -bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlRadioButtonProc , (long) this ) ; - - MacPostControlCreate() ; - - m_cycle = this ; - - if (HasFlag(wxRB_GROUP)) - { - AddInCycle( NULL ) ; - } - else - { - /* search backward for last group start */ - wxRadioButton *chief = (wxRadioButton*) NULL; - wxWindowList::Node *node = parent->GetChildren().GetLast(); - while (node) - { - wxWindow *child = node->GetData(); - if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) ) - { - chief = (wxRadioButton*) child; - if (child->HasFlag(wxRB_GROUP)) break; - } - node = node->GetPrevious(); - } - AddInCycle( chief ) ; - } - return TRUE; -} - -void wxRadioButton::SetValue(bool val) -{ - wxRadioButton *cycle; - if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val ) - return ; - - ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ; - if (val) - { - cycle=this->NextInCycle(); - if (cycle!=NULL) { - while (cycle!=this) { - cycle->SetValue(false); - cycle=cycle->NextInCycle(); - } - } - } - MacRedrawControl() ; -} - -bool wxRadioButton::GetValue() const -{ - return ::GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxRadioButton::Command (wxCommandEvent & event) -{ - SetValue ( (event.GetInt() != 0) ); - ProcessCommand (event); -} - -void wxRadioButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - if ( GetValue() ) - return ; - - wxRadioButton *cycle, *old = NULL ; - cycle=this->NextInCycle(); - if (cycle!=NULL) { - while (cycle!=this) { - if ( cycle->GetValue() ) { - old = cycle ; - cycle->SetValue(false); - } - cycle=cycle->NextInCycle(); - } - } - - SetValue(true) ; - - if ( old ) { - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, old->m_windowId ); - event.SetEventObject(old); - event.SetInt( false ); - old->ProcessCommand(event); - } - wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId ); - event2.SetEventObject(this); - event2.SetInt( true ); - ProcessCommand(event2); -} - -wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle) -{ - wxRadioButton *next,*current; - - if (cycle==NULL) { - m_cycle=this; - return(this); - } - else { - current=cycle; - while ((next=current->m_cycle)!=cycle) - current=current->m_cycle; - m_cycle=cycle; - current->m_cycle=this; - return(cycle); - } -} diff --git a/src/mac/carbon/region.cpp b/src/mac/carbon/region.cpp deleted file mode 100644 index a3cf8cef7b..0000000000 --- a/src/mac/carbon/region.cpp +++ /dev/null @@ -1,437 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// File: region.cpp -// Purpose: Region class -// Author: Stefan Csomor -// Created: Fri Oct 24 10:46:34 MET 1997 -// RCS-ID: $Id$ -// Copyright: (c) 1997 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "region.h" -#endif - -#include "wx/region.h" -#include "wx/gdicmn.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) -#endif - -//----------------------------------------------------------------------------- -// wxRegionRefData implementation -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxRegionRefData : public wxGDIRefData { -public: - wxRegionRefData() - { - m_macRgn = NewRgn() ; - } - - wxRegionRefData(const wxRegionRefData& data) - : wxGDIRefData() - { - m_macRgn = NewRgn() ; - CopyRgn( data.m_macRgn , m_macRgn ) ; - } - - ~wxRegionRefData() - { - DisposeRgn( m_macRgn ) ; - } - RgnHandle m_macRgn ; -}; - -#define M_REGION (((wxRegionRefData*)m_refData)->m_macRgn) -#define OTHER_M_REGION(a) (((wxRegionRefData*)(a.m_refData))->m_macRgn) - -//----------------------------------------------------------------------------- -// wxRegion -//----------------------------------------------------------------------------- - -/*! - * Create an empty region. - */ -wxRegion::wxRegion() -{ - m_refData = new wxRegionRefData; -} - -wxRegion::wxRegion(WXHRGN hRegion ) -{ - m_refData = new wxRegionRefData; - CopyRgn( (RgnHandle) hRegion , (RgnHandle) M_REGION ) ; -} - -wxRegion::wxRegion(long x, long y, long w, long h) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , x , y , x+w , y+h ) ; -} - -wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , topLeft.x , topLeft.y , bottomRight.x , bottomRight.y ) ; -} - -wxRegion::wxRegion(const wxRect& rect) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , rect.x , rect.y , rect.x+rect.width , rect.y+rect.height ) ; -} - -/*! - * Destroy the region. - */ -wxRegion::~wxRegion() -{ - // m_refData unrefed in ~wxObject -} - -//----------------------------------------------------------------------------- -//# Modify region -//----------------------------------------------------------------------------- - -//! Clear current region -void wxRegion::Clear() -{ - UnRef(); -} - -//! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) - { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - RgnHandle rgn = NewRgn() ; - SetRectRgn( rgn , x , y, x+width,y + height ) ; - - switch (op) - { - case wxRGN_AND: - SectRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_OR: - UnionRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_XOR: - XorRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_DIFF: - DiffRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_COPY: - default: - CopyRgn( rgn ,M_REGION ) ; - break ; - } - - DisposeRgn( rgn ) ; - - return TRUE; -} - -//! Union /e region with this. -bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) -{ - if (region.Empty()) - return FALSE; - - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) - { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - - switch (op) - { - case wxRGN_AND: - SectRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_OR: - UnionRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_XOR: - XorRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_DIFF: - DiffRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_COPY: - default: - CopyRgn( OTHER_M_REGION(region) ,M_REGION ) ; - break ; - } - - return TRUE; -} - -bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) -{ - return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op); -} - -//----------------------------------------------------------------------------- -//# Information on region -//----------------------------------------------------------------------------- - -// Outer bounds of region -void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const -{ - if (m_refData) - { - Rect box ; - GetRegionBounds( M_REGION , &box ) ; - x = box.left ; - y = box.top ; - w = box.right - box.left ; - h = box.bottom - box.top ; - } - else - { - x = y = w = h = 0; - } -} - -wxRect wxRegion::GetBox() const -{ - wxCoord x, y, w, h; - GetBox(x, y, w, h); - return wxRect(x, y, w, h); -} - -// Is region empty? -bool wxRegion::Empty() const -{ - return EmptyRgn( M_REGION ) ; -} - -const WXHRGN wxRegion::GetWXHRGN() const -{ - return M_REGION ; -} - -//----------------------------------------------------------------------------- -//# Tests -//----------------------------------------------------------------------------- - -// Does the region contain the point (x,y)? -wxRegionContain wxRegion::Contains(long x, long y) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - return wxOutRegion; -} - -// Does the region contain the point pt? -wxRegionContain wxRegion::Contains(const wxPoint& pt) const -{ - if (!m_refData) - return wxOutRegion; - - Point p = { pt.y , pt.x } ; - if (PtInRgn( p , M_REGION ) ) - return wxInRegion; - - return wxOutRegion; -} - -// Does the region contain the rectangle (x, y, w, h)? -wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const -{ - if (!m_refData) - return wxOutRegion; - - Rect rect = { y , x , y + h , x + w } ; - if (RectInRgn( &rect , M_REGION ) ) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle rect -wxRegionContain wxRegion::Contains(const wxRect& rect) const -{ - if (!m_refData) - return wxOutRegion; - - long x, y, w, h; - x = rect.x; - y = rect.y; - w = rect.GetWidth(); - h = rect.GetHeight(); - return Contains(x, y, w, h); -} - -/////////////////////////////////////////////////////////////////////////////// -// // -// wxRegionIterator // -// // -/////////////////////////////////////////////////////////////////////////////// - -/*! - * Initialize empty iterator - */ -wxRegionIterator::wxRegionIterator() - : m_current(0), m_numRects(0), m_rects(NULL) -{ -} - -wxRegionIterator::~wxRegionIterator() -{ - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } -} - -wxRegionIterator::wxRegionIterator(const wxRegionIterator& iterator) - : wxObject() - , m_current(iterator.m_current) - , m_numRects(0) - , m_rects(NULL) -{ - SetRects(iterator.m_numRects, iterator.m_rects); -} - -wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& iterator) -{ - m_current = iterator.m_current; - SetRects(iterator.m_numRects, iterator.m_rects); - return *this; -} - -/*! - * Set iterator rects for region - */ -void wxRegionIterator::SetRects(long numRects, wxRect *rects) -{ - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } - if (rects) - { - int i; - m_rects = new wxRect[numRects]; - for (i = 0; i < numRects; i++) - m_rects[i] = rects[i]; - } - m_numRects = numRects; -} - -/*! - * Initialize iterator for region - */ -wxRegionIterator::wxRegionIterator(const wxRegion& region) -{ - m_rects = NULL; - - Reset(region); -} - -/*! - * Reset iterator for a new /e region. - */ -void wxRegionIterator::Reset(const wxRegion& region) -{ - m_current = 0; - m_region = region; - - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } - - if (m_region.Empty()) - m_numRects = 0; - else - { - // we cannot dissolve it into rects on mac - m_rects = new wxRect[1]; - Rect rect ; - GetRegionBounds( OTHER_M_REGION( region ) , &rect ) ; - m_rects[0].x = rect.left; - m_rects[0].y = rect.top; - m_rects[0].width = rect.right - rect.left; - m_rects[0].height = rect.bottom - rect.top; - m_numRects = 1; - } -} - -/*! - * Increment iterator. The rectangle returned is the one after the - * incrementation. - */ -wxRegionIterator& wxRegionIterator::operator ++ () -{ - if (m_current < m_numRects) - ++m_current; - return *this; -} - -/*! - * Increment iterator. The rectangle returned is the one before the - * incrementation. - */ -wxRegionIterator wxRegionIterator::operator ++ (int) -{ - wxRegionIterator previous(*this); - - if (m_current < m_numRects) - ++m_current; - - return previous; -} - -long wxRegionIterator::GetX() const -{ - if (m_current < m_numRects) - return m_rects[m_current].x; - return 0; -} - -long wxRegionIterator::GetY() const -{ - if (m_current < m_numRects) - return m_rects[m_current].y; - return 0; -} - -long wxRegionIterator::GetW() const -{ - if (m_current < m_numRects) - return m_rects[m_current].width ; - return 0; -} - -long wxRegionIterator::GetH() const -{ - if (m_current < m_numRects) - return m_rects[m_current].height; - return 0; -} - diff --git a/src/mac/carbon/renderer.cpp b/src/mac/carbon/renderer.cpp deleted file mode 100644 index 8555ef47e3..0000000000 --- a/src/mac/carbon/renderer.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/renderer.cpp -// Purpose: implementation of wxRendererNative for Mac -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.07.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/dc.h" - #include "wx/bitmap.h" - #include "wx/settings.h" -#endif //WX_PRECOMP - -#include "wx/renderer.h" - -// ---------------------------------------------------------------------------- -// wxRendererMac: our wxRendererNative implementation -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRendererMac : public wxDelegateRendererNative -{ -public: - // draw the header control button (used by wxListCtrl) - virtual void DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - // draw the expanded/collapsed icon for a tree control item - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - // draw a (vertical) sash - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0); - -private: - // the tree buttons - wxBitmap m_bmpTreeExpanded, - m_bmpTreeCollapsed; -}; - -// ---------------------------------------------------------------------------- -// Aqua arrows -// ---------------------------------------------------------------------------- - -/* XPM */ -static const char *aqua_arrow_right_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 11 4 1", -" c None", -"b c #C0C0C0", -"c c #707070", -"d c #A0A0A0", -/* pixels */ -" b ", -" ddb ", -" cccdb ", -" cccccd ", -" ccccccdb ", -" ccccccccd", -" ccccccdb ", -" cccccb ", -" cccdb ", -" ddb ", -" b " -}; - -/* XPM */ -static const char *aqua_arrow_down_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 11 4 1", -" c None", -"b c #C0C0C0", -"c c #707070", -"d c #A0A0A0", -/* pixels */ -" ", -" ", -" bdcccccccdb ", -" dcccccccd ", -" bcccccccb ", -" dcccccd ", -" bcccccb ", -" bcccd ", -" dcd ", -" bcb ", -" d " -}; - -// ============================================================================ -// implementation -// ============================================================================ - -/* static */ -wxRendererNative& wxRendererNative::GetDefault() -{ - static wxRendererMac s_rendererMac; - - return s_rendererMac; -} - -void -wxRendererMac::DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int WXUNUSED(flags)) -{ - const int CORNER = 1; - - const wxCoord x = rect.x-1, - y = rect.y-1, - w = rect.width, - h = rect.height; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - - if (major >= 10) - { - dc.SetPen( wxPen( wxColour( 0xC5 , 0xC5 , 0xC5 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x, y+CORNER, 1, h-CORNER ); // left - // The right border is overdrawn by the left border of the right neighbouring - // header (to maintain a proper single pixel border). Except for the - // rightmost header of the listctrl. - dc.DrawRectangle( x+w+(CORNER*2), y+CORNER, 1, h-CORNER ); // right - dc.SetPen( wxPen( wxColour( 0xB1 , 0xB1 , 0xB1 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x, y+h, w+(CORNER*3), 1 ); // bottom - dc.DrawRectangle( x, y, w+(CORNER*3), 1 ); // top - - // Do a fill of the interior for background: - dc.SetPen( wxPen( wxColour( 0xF6 , 0xF6 , 0xF6 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x+CORNER, y+CORNER, w+CORNER, h-CORNER ); - - // Do the gradient fill: - static int grayValues[] = - { - 0xF6, 0xF2, 0xEF, 0xED, 0xED, 0xEB, 0xEA, 0xEA, 0xE8, - 0xE8, 0xE2, 0xE5, 0xE8, 0xEB, 0xEF, 0xF2, 0xFD - }; - int i; - for (i=0; i < h && i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( x+CORNER, y+CORNER+i, w+CORNER, 1 ); - } - } - else - { - dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNSHADOW ) , 1 , wxSOLID ) ); - dc.DrawLine( x+w-CORNER+1, y, x+w, y+h ); // right (outer) - dc.DrawRectangle( x, y+h, w+1, 1 ); // bottom (outer) - - wxPen pen( wxColour( 0x88 , 0x88 , 0x88 ), 1, wxSOLID ); - - dc.SetPen( pen ); - dc.DrawLine( x+w-CORNER, y, x+w-1, y+h ); // right (inner) - dc.DrawRectangle( x+1, y+h-1, w-2, 1 ); // bottom (inner) - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawRectangle( x, y, w-CORNER+1, 1 ); // top (outer) - dc.DrawRectangle( x, y, 1, h ); // left (outer) - dc.DrawLine( x, y+h-1, x+1, y+h-1 ); - dc.DrawLine( x+w-1, y, x+w-1, y+1 ); - } -} - -void -wxRendererMac::DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags) -{ - // init the buttons on demand - if ( !m_bmpTreeExpanded.Ok() ) - { - m_bmpTreeExpanded = wxBitmap(aqua_arrow_down_xpm); - m_bmpTreeCollapsed = wxBitmap(aqua_arrow_right_xpm); - } - - // draw them - - // VZ: this is the old code from treectlg.cpp which apparently doesn't work - // but I kept it here just in case it is needed -- if not, please - // remove it -#if 0 // def __WXMAC__ - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - - int loc_x = x - 5 ; - int loc_y = y_mid - 6 ; - MacWindowToRootWindow( & loc_x , & loc_y ) ; - Rect bounds = { loc_y , loc_x , loc_y + 18 , loc_x + 12 } ; - ThemeButtonDrawInfo info = { kThemeStateActive , item->IsExpanded() ? kThemeDisclosureDown : kThemeDisclosureRight , - kThemeAdornmentNone }; - DrawThemeButton( &bounds, kThemeDisclosureButton , - &info , NULL , NULL , NULL , NULL ) ; -#else // 1 - dc.DrawBitmap(flags & wxCONTROL_EXPANDED ? m_bmpTreeExpanded - : m_bmpTreeCollapsed, - rect.x, rect.y, true /* use mask */); -#endif // 0/1 -} - -void -wxRendererMac::DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int WXUNUSED(flags)) -{ - // VZ: we have to somehow determine if we're drawing a normal sash or - // a brushed metal one as they look quite differently... this is - // completely bogus anyhow, of course (TODO) - -#if 0 - dc.SetPen(*wxLIGHT_GREY_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - if ( orient == wxVERTICAL ) - dc.DrawRectangle(position, 0, 7, size.y); - else - dc.DrawRectangle(0, position, size.x, 7); -#else - // Do the gradient fill: - static int grayValues[] = - { - 0xA0, 0xF6, 0xED, 0xE4, 0xE2, 0xD0, 0xA0 - }; - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - if ( orient == wxVERTICAL ) - { - int i; - for (i=0; i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( position+i, 0, 1, size.y ); - } - } - else - { - int i; - for (i=0; i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( 0, position+i, size.x, 1 ); - } - } -#endif -} - diff --git a/src/mac/carbon/scrolbar.cpp b/src/mac/carbon/scrolbar.cpp deleted file mode 100644 index 3b08c25ecc..0000000000 --- a/src/mac/carbon/scrolbar.cpp +++ /dev/null @@ -1,184 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp -// Purpose: wxScrollBar -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "scrolbar.h" -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif // WX_PRECOMP - -#include "wx/scrolbar.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - -BEGIN_EVENT_TABLE(wxScrollBar, wxControl) -END_EVENT_TABLE() - -#endif - -extern ControlActionUPP wxMacLiveScrollbarActionUPP ; - -// Scrollbar -bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return FALSE; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) , - &bounds , title , false , 0 , 0 , 100, - kControlScrollBarLiveProc , (long) this) ; - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxScrollBar::~wxScrollBar() -{ -} - -void wxScrollBar::SetThumbPosition(int viewStart) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ; -} - -int wxScrollBar::GetThumbPosition() const -{ - return ::GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh) -{ - m_pageSize = pageSize; - m_viewSize = thumbSize; - m_objectSize = range; - - int range1 = wxMax((m_objectSize - m_viewSize), 0) ; - - SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ; - SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ; - SetControl32BitValue( (ControlHandle) m_macControl , position ) ; - - if ( UMAGetAppearanceVersion() >= 0x0110 ) - { - if ( SetControlViewSize != (void*) kUnresolvedCFragSymbolAddress ) - { - SetControlViewSize( (ControlHandle) m_macControl , m_viewSize ) ; - } - } - if ( refresh ) - MacRedrawControl() ; -} - - -void wxScrollBar::Command(wxCommandEvent& event) -{ - SetThumbPosition(event.m_commandInt); - ProcessCommand(event); -} - -void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - - int position = GetControl32BitValue( (ControlHandle) m_macControl) ; - int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ; - int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ; - - wxEventType scrollEvent = wxEVT_NULL; - int nScrollInc = 0; - - // all events have already been reported during mouse down, except for THUMBRELEASE - if ( !mouseStillDown && controlpart !=kControlIndicatorPart ) - return ; - - switch( controlpart ) - { - case kControlUpButtonPart : - nScrollInc = -1; - scrollEvent = wxEVT_SCROLL_LINEUP; - break ; - case kControlDownButtonPart : - nScrollInc = 1; - scrollEvent = wxEVT_SCROLL_LINEDOWN; - break ; - case kControlPageUpPart : - nScrollInc = -m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEUP; - break ; - case kControlPageDownPart : - nScrollInc = m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEDOWN; - break ; - case kControlIndicatorPart : - nScrollInc = 0 ; - if ( mouseStillDown ) - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - else - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - break ; - default : - wxFAIL_MSG(wxT("illegal scrollbar selector")); - break ; - } - - int new_pos = position + nScrollInc; - - if (new_pos < minPos) - new_pos = minPos; - if (new_pos > maxPos) - new_pos = maxPos; - if ( nScrollInc ) - SetThumbPosition(new_pos); - - wxScrollEvent event(scrollEvent, m_windowId); - if ( m_windowStyle & wxHORIZONTAL ) - { - event.SetOrientation( wxHORIZONTAL ) ; - } - else - { - event.SetOrientation( wxVERTICAL ) ; - } - event.SetPosition(new_pos); - event.SetEventObject( this ); - wxWindow* window = GetParent() ; - if (window && window->MacIsWindowScrollbar(this) ) - { - // this is hardcoded - window->MacOnScroll(event); - } - else - GetEventHandler()->ProcessEvent(event); -} - diff --git a/src/mac/carbon/settings.cpp b/src/mac/carbon/settings.cpp deleted file mode 100644 index 4ddb2a4582..0000000000 --- a/src/mac/carbon/settings.cpp +++ /dev/null @@ -1,279 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp -// Purpose: wxSettings -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "settings.h" -#endif - -#include "wx/settings.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" - -#include "wx/mac/uma.h" - -// ---------------------------------------------------------------------------- -// wxSystemSettingsNative -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// colours -// ---------------------------------------------------------------------------- - -wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) -{ - int major,minor; - wxGetOsVersion( &major, &minor ); - - switch( index ) - { - case wxSYS_COLOUR_SCROLLBAR : - case wxSYS_COLOUR_BACKGROUND: - case wxSYS_COLOUR_ACTIVECAPTION: - case wxSYS_COLOUR_INACTIVECAPTION: - case wxSYS_COLOUR_MENU: - case wxSYS_COLOUR_WINDOW: - case wxSYS_COLOUR_WINDOWFRAME: - case wxSYS_COLOUR_ACTIVEBORDER: - case wxSYS_COLOUR_INACTIVEBORDER: - case wxSYS_COLOUR_BTNFACE: - case wxSYS_COLOUR_MENUBAR: - return wxColor( 0xDD , 0xDD , 0xDD ) ; - break ; - - case wxSYS_COLOUR_LISTBOX : - { - if (major >= 10) - return *wxWHITE ; - else - return wxColor( 0xEE , 0xEE , 0xEE ) ; - break ; - } - case wxSYS_COLOUR_BTNSHADOW: - if (major >= 10) - return wxColor( 0xBE , 0xBE , 0xBE ) ; - else - return wxColor( 0x44 , 0x44 , 0x44 ) ; - break ; - - case wxSYS_COLOUR_BTNTEXT: - case wxSYS_COLOUR_MENUTEXT: - case wxSYS_COLOUR_WINDOWTEXT: - case wxSYS_COLOUR_CAPTIONTEXT: - case wxSYS_COLOUR_INFOTEXT: - case wxSYS_COLOUR_INACTIVECAPTIONTEXT: - return *wxBLACK; - break ; - case wxSYS_COLOUR_HIGHLIGHT: - { - RGBColor hilite ; - LMGetHiliteRGB(&hilite) ; - return wxColor( hilite.red >> 8 , hilite.green >> 8 , hilite.blue >> 8 ) ; - } - break ; - case wxSYS_COLOUR_BTNHIGHLIGHT: - case wxSYS_COLOUR_GRAYTEXT: - return wxColor( 0xCC , 0xCC , 0xCC ) ; - break ; - - case wxSYS_COLOUR_3DDKSHADOW: - return wxColor( 0x44 , 0x44 , 0x44 ) ; - break ; - case wxSYS_COLOUR_3DLIGHT: - return wxColor( 0xCC , 0xCC , 0xCC ) ; - break ; - case wxSYS_COLOUR_HIGHLIGHTTEXT : - { - RGBColor hilite ; - LMGetHiliteRGB(&hilite) ; - if ( ( hilite.red + hilite.green + hilite.blue ) == 0 ) - return *wxWHITE ; - else - return *wxBLACK ; - } - break ; - case wxSYS_COLOUR_INFOBK : - case wxSYS_COLOUR_APPWORKSPACE: - return *wxWHITE ; - break ; - - case wxSYS_COLOUR_HOTLIGHT: - case wxSYS_COLOUR_GRADIENTACTIVECAPTION: - case wxSYS_COLOUR_GRADIENTINACTIVECAPTION: - case wxSYS_COLOUR_MENUHILIGHT: - // TODO - return *wxBLACK; - - case wxSYS_COLOUR_MAX: - wxFAIL_MSG( _T("unknown system colour index") ); - break ; - } - return *wxWHITE; -} - -// ---------------------------------------------------------------------------- -// fonts -// ---------------------------------------------------------------------------- - -wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) -{ - switch (index) - { - case wxSYS_ANSI_VAR_FONT : - case wxSYS_SYSTEM_FONT : - case wxSYS_DEVICE_DEFAULT_FONT : - case wxSYS_DEFAULT_GUI_FONT : - { - return *wxSMALL_FONT ; - } ; - break ; - case wxSYS_OEM_FIXED_FONT : - case wxSYS_ANSI_FIXED_FONT : - case wxSYS_SYSTEM_FIXED_FONT : - default : - { - return *wxNORMAL_FONT ; - } ; - break ; - - } - return *wxNORMAL_FONT; -} - -// ---------------------------------------------------------------------------- -// system metrics/features -// ---------------------------------------------------------------------------- - -// Get a system metric, e.g. scrollbar size -int wxSystemSettingsNative::GetMetric(wxSystemMetric index) -{ - int value; - - switch ( index) - { - case wxSYS_MOUSE_BUTTONS: - // we emulate a two button mouse (ctrl + click = right button ) - return 2; - case wxSYS_BORDER_X: - // TODO - return 0; - case wxSYS_BORDER_Y: - // TODO - return 0; - case wxSYS_CURSOR_X: - // TODO - return 0; - case wxSYS_CURSOR_Y: - // TODO - return 0; - case wxSYS_DCLICK_X: - // TODO - return 0; - case wxSYS_DCLICK_Y: - // TODO - return 0; - case wxSYS_DRAG_X: - // TODO - return 0; - case wxSYS_DRAG_Y: - // TODO - return 0; - case wxSYS_EDGE_X: - // TODO - return 0; - case wxSYS_EDGE_Y: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_X: - return 16; - case wxSYS_HSCROLL_ARROW_Y: - return 16; - case wxSYS_HTHUMB_X: - return 16; - case wxSYS_ICON_X: - // TODO - return 0; - case wxSYS_ICON_Y: - // TODO - return 0; - case wxSYS_ICONSPACING_X: - // TODO - return 0; - case wxSYS_ICONSPACING_Y: - // TODO - return 0; - case wxSYS_WINDOWMIN_X: - // TODO - return 0; - case wxSYS_WINDOWMIN_Y: - // TODO - return 0; - case wxSYS_SCREEN_X: - wxDisplaySize(&value, NULL); - return value; - case wxSYS_SCREEN_Y: - wxDisplaySize(NULL, &value); - return value; - case wxSYS_FRAMESIZE_X: - // TODO - return 0; - case wxSYS_FRAMESIZE_Y: - // TODO - return 0; - case wxSYS_SMALLICON_X: - // TODO - return 0; - case wxSYS_SMALLICON_Y: - // TODO - return 0; - case wxSYS_HSCROLL_Y: - return 16; - case wxSYS_VSCROLL_X: - return 16; - case wxSYS_VSCROLL_ARROW_X: - return 16; - case wxSYS_VSCROLL_ARROW_Y: - return 16; - case wxSYS_VTHUMB_Y: - return 16; - case wxSYS_CAPTION_Y: - // TODO - return 0; - case wxSYS_MENU_Y: - // TODO - return 0; - case wxSYS_NETWORK_PRESENT: - // TODO - return 0; - case wxSYS_PENWINDOWS_PRESENT: - return 0; - case wxSYS_SHOW_SOUNDS: - // TODO - return 0; - case wxSYS_SWAP_BUTTONS: - return 0; - default: - return 0; - } - return 0; -} - -bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) -{ - switch (index) - { - case wxSYS_CAN_ICONIZE_FRAME: - case wxSYS_CAN_DRAW_FRAME_DECORATIONS: - return TRUE; - - default: - return FALSE; - } -} diff --git a/src/mac/carbon/slider.cpp b/src/mac/carbon/slider.cpp deleted file mode 100644 index 4bd4bab532..0000000000 --- a/src/mac/carbon/slider.cpp +++ /dev/null @@ -1,433 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp -// Purpose: wxSlider -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "slider.h" -#endif - -#include "wx/slider.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - -BEGIN_EVENT_TABLE(wxSlider, wxControl) -END_EVENT_TABLE() -#endif - - // The dimensions of the different styles of sliders (From Aqua document) -#define wxSLIDER_DIMENSIONACROSS 15 -#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 -#define wxSLIDER_DIMENSIONACROSS_ARROW 18 - -// Distance between slider and text -#define wxSLIDER_BORDERTEXT 5 - -/* NB! The default orientation for a slider is horizontal however if the user specifies - * some slider styles but dosen't specify the orientation we have to assume he wants a - * horizontal one. Therefore in this file when testing for the sliders orientation - * vertical is tested for if this is not set then we use the horizontal one - * eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }> - */ - - // Slider - wxSlider::wxSlider() -{ - m_pageSize = 1; - m_lineSize = 1; - m_rangeMax = 0; - m_rangeMin = 0; - m_tickFreq = 0; -} - -extern ControlActionUPP wxMacLiveScrollbarActionUPP ; - -bool wxSlider::Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - SInt16 procID; - - m_macMinimumStatic = NULL ; - m_macMaximumStatic = NULL ; - m_macValueStatic = NULL ; - - - m_lineSize = 1; - m_tickFreq = 0; - - m_rangeMax = maxValue; - m_rangeMin = minValue; - - m_pageSize = (int)((maxValue-minValue)/10); - - MacPreControlCreate( parent, id, wxEmptyString, pos, size, style, - validator, name, &bounds, title ); - - procID = kControlSliderProc + kControlSliderLiveFeedback; - if(style & wxSL_AUTOTICKS) { - procID += kControlSliderHasTickMarks; - } - - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false, - value, minValue, maxValue, procID, (long) this); - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; - - if(style & wxSL_LABELS) - { - m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString ); - m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString ); - m_macValueStatic = new wxStaticText( this, -1, wxEmptyString ); - SetRange(minValue, maxValue); - SetValue(value); - } - - else { - m_macMinimumStatic = NULL ; - m_macMaximumStatic = NULL ; - m_macValueStatic = NULL ; - } - - if(style & wxSL_VERTICAL) { - SetSizeHints(10, -1, 10, -1); // Forces SetSize to use the proper width - } - else { - SetSizeHints(-1, 10, -1, 10); // Forces SetSize to use the proper height - } - // NB! SetSizeHints is overloaded by wxSlider and will substitute 10 with the - // proper dimensions, it also means other people cannot bugger the slider with - // other values - - MacPostControlCreate() ; - - return true; -} - -wxSlider::~wxSlider() -{ -} - -int wxSlider::GetValue() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl) ; -} - -void wxSlider::SetValue(int value) -{ - wxString valuestring ; - valuestring.Printf( wxT("%d") , value ) ; - if ( m_macValueStatic ) - m_macValueStatic->SetLabel( valuestring ) ; - SetControl32BitValue( (ControlHandle) m_macControl , value ) ; -} - -void wxSlider::SetRange(int minValue, int maxValue) -{ - wxString value; - - m_rangeMin = minValue; - m_rangeMax = maxValue; - - SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin); - SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax); - - if(m_macMinimumStatic) { - value.Printf(wxT("%d"), m_rangeMin); - m_macMinimumStatic->SetLabel(value); - } - if(m_macMaximumStatic) { - value.Printf(wxT("%d"), m_rangeMax); - m_macMaximumStatic->SetLabel(value); - } - SetValue(m_rangeMin); -} - -// For trackbars only -void wxSlider::SetTickFreq(int n, int pos) -{ - // TODO - m_tickFreq = n; -} - -void wxSlider::SetPageSize(int pageSize) -{ - // TODO - m_pageSize = pageSize; -} - -int wxSlider::GetPageSize() const -{ - return m_pageSize; -} - -void wxSlider::ClearSel() -{ - // TODO -} - -void wxSlider::ClearTicks() -{ - // TODO -} - -void wxSlider::SetLineSize(int lineSize) -{ - m_lineSize = lineSize; - // TODO -} - -int wxSlider::GetLineSize() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelEnd() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelStart() const -{ - // TODO - return 0; -} - -void wxSlider::SetSelection(int minPos, int maxPos) -{ - // TODO -} - -void wxSlider::SetThumbLength(int len) -{ - // TODO -} - -int wxSlider::GetThumbLength() const -{ - // TODO - return 0; -} - -void wxSlider::SetTick(int tickPos) -{ - // TODO -} - -void wxSlider::Command (wxCommandEvent & event) -{ - SetValue (event.GetInt()); - ProcessCommand (event); -} - -void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bool mouseStillDown ) -{ - SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ; - - SetValue( value ) ; - - wxEventType scrollEvent = wxEVT_NULL ; - - if ( mouseStillDown ) - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - else - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - - wxScrollEvent event(scrollEvent, m_windowId); - event.SetPosition(value); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - - wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); - cevent.SetInt( value ); - cevent.SetEventObject( this ); - - GetEventHandler()->ProcessEvent( cevent ); -} - -/* This is overloaded in wxSlider so that the proper width/height will always be used -* for the slider different values would cause redrawing and mouse detection problems */ -void wxSlider::SetSizeHints( int minW, int minH, - int maxW , int maxH , - int incW , int incH ) -{ - wxSize size = GetBestSize(); - - if(GetWindowStyle() & wxSL_VERTICAL) { - wxWindow::SetSizeHints(size.x, minH, size.x, maxH, incW, incH); - } - else { - wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH); - } -} - -wxSize wxSlider::DoGetBestSize() const -{ - wxSize size; - int textwidth, textheight; - - if(GetWindowStyle() & wxSL_LABELS) - { - wxString text; - int ht, wd; - - // Get maximum text label width and height - text.Printf(wxT("%d"), m_rangeMin); - GetTextExtent(text, &textwidth, &textheight); - text.Printf(wxT("%d"), m_rangeMax); - GetTextExtent(text, &wd, &ht); - if(ht > textheight) { - textheight = ht; - } - if (wd > textwidth) { - textwidth = wd; - } - } - - if(GetWindowStyle() & wxSL_VERTICAL) - { - if(GetWindowStyle() & wxSL_AUTOTICKS) { - size.x = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - size.x = wxSLIDER_DIMENSIONACROSS_ARROW; - } - if(GetWindowStyle() & wxSL_LABELS) { - size.x += textwidth + wxSLIDER_BORDERTEXT; - } - size.y = 150; - } - else - { - if(GetWindowStyle() & wxSL_AUTOTICKS) { - size.y = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - size.y = wxSLIDER_DIMENSIONACROSS_ARROW; - } - if(GetWindowStyle() & wxSL_LABELS) { - size.y += textheight + wxSLIDER_BORDERTEXT; - } - size.x = 150; - } - return size; -} - -void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ; -} - -void wxSlider::MacUpdateDimensions() -{ - // actually in the current systems this should never be possible, but later reparenting - // may become a reality - - if ( (ControlHandle) m_macControl == NULL ) - return ; - - if ( GetParent() == NULL ) - return ; - - WindowRef rootwindow = (WindowRef) MacGetRootWindow() ; - if ( rootwindow == NULL ) - return ; - - int xborder, yborder; - int minValWidth, maxValWidth, textwidth, textheight; - int sliderBreadth; - - xborder = yborder = 0; - - if (GetWindowStyle() & wxSL_LABELS) - { - wxString text; - int ht; - - // Get maximum text label width and height - text.Printf(wxT("%d"), m_rangeMin); - GetTextExtent(text, &minValWidth, &textheight); - text.Printf(wxT("%d"), m_rangeMax); - GetTextExtent(text, &maxValWidth, &ht); - if(ht > textheight) { - textheight = ht; - } - textwidth = (minValWidth > maxValWidth ? minValWidth : maxValWidth); - - xborder = textwidth + wxSLIDER_BORDERTEXT; - yborder = textheight + wxSLIDER_BORDERTEXT; - - // Get slider breadth - if(GetWindowStyle() & wxSL_AUTOTICKS) { - sliderBreadth = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - sliderBreadth = wxSLIDER_DIMENSIONACROSS_ARROW; - } - - if(GetWindowStyle() & wxSL_VERTICAL) - { - m_macMinimumStatic->Move(sliderBreadth + wxSLIDER_BORDERTEXT, - m_height - yborder - textheight); - m_macMaximumStatic->Move(sliderBreadth + wxSLIDER_BORDERTEXT, 0); - m_macValueStatic->Move(0, m_height - textheight); - } - else - { - m_macMinimumStatic->Move(0, sliderBreadth + wxSLIDER_BORDERTEXT); - m_macMaximumStatic->Move(m_width - xborder - maxValWidth / 2, - sliderBreadth + wxSLIDER_BORDERTEXT); - m_macValueStatic->Move(m_width - textwidth, 0); - } - } - - Rect oldBounds ; - GetControlBounds( (ControlHandle) m_macControl , &oldBounds ) ; - - int new_x = m_x + MacGetLeftBorderSize() + m_macHorizontalBorder ; - int new_y = m_y + MacGetTopBorderSize() + m_macVerticalBorder ; - int new_width = m_width - MacGetLeftBorderSize() - MacGetRightBorderSize() - 2 * m_macHorizontalBorder - xborder ; - int new_height = m_height - MacGetTopBorderSize() - MacGetBottomBorderSize() - 2 * m_macVerticalBorder - yborder ; - - GetParent()->MacWindowToRootWindow( & new_x , & new_y ) ; - bool doMove = new_x != oldBounds.left || new_y != oldBounds.top ; - bool doResize = ( oldBounds.right - oldBounds.left ) != new_width || (oldBounds.bottom - oldBounds.top ) != new_height ; - if ( doMove || doResize ) - { - InvalWindowRect( rootwindow, &oldBounds ) ; - if ( doMove ) - { - UMAMoveControl( (ControlHandle) m_macControl , new_x , new_y ) ; - } - if ( doResize ) - { - UMASizeControl( (ControlHandle) m_macControl , new_width , new_height ) ; - } - } -} - -void wxSlider::DoMoveWindow(int x, int y, int width, int height) -{ - wxControl::DoMoveWindow(x,y,width,height) ; -} diff --git a/src/mac/carbon/sound.cpp b/src/mac/carbon/sound.cpp deleted file mode 100644 index d6d13bb595..0000000000 --- a/src/mac/carbon/sound.cpp +++ /dev/null @@ -1,243 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sound.cpp -// Purpose: wxSound class implementation: optional -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "sound.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/sound.h" - -#if wxUSE_SOUND - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#ifndef __DARWIN__ -#include -#endif -#endif - -wxSound::wxSound() - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) -{ -} - -wxSound::wxSound(const wxString& sFileName, bool isResource) - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) -{ - Create(sFileName, isResource); -} - - -wxSound::~wxSound() -{ - FreeData(); -} - -wxSound::wxSound(int size, const wxByte* data) - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false) -{ - //TODO convert data -} - -bool wxSound::Create(const wxString& fileName, bool isResource) -{ - bool ret = false; - m_sndname = fileName; - m_isResource = isResource; - - if (m_isResource) - ret = true; - else - { /* - if (sndChan) - { // we're playing - FSClose(SndRefNum); - SndRefNum = 0; - SndDisposeChannel(sndChan, TRUE); - free(sndChan); - sndChan = 0; - KillTimer(0,timerID); - } - - if (!lpSnd) - return true; - - if (_access(lpSnd,0)) // no file, no service - return false; - - // Allocate SndChannel - sndChan = (SndChannelPtr) malloc (sizeof(SndChannel)); - - if (!sndChan) - return false; - - sndChan->qLength = 128; - - if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0)) - { - free(sndChan); - sndChan = 0; - return false; - } - - if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd))) - { - SndDisposeChannel(sndChan, TRUE); - free(sndChan); - sndChan = 0; - - return false; - } - - bool async = false; - - if (fdwSound & SND_ASYNC) - async = true; - - if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr) - { - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - return false; - } - - if (async) - { // haven't finish yet - timerID = SetTimer(0, 0, 250, TimerCallBack); - } - else - { - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - }*/ - } - - return ret; -} - - -//don't know what to do with looped, wth -bool wxSound::DoPlay(unsigned flags) const -{ - bool ret = false; - - if (m_isResource) - { - Str255 snd ; - wxMacStringToPascal( m_sndname , snd ) ; - SndListHandle hSnd; - - hSnd = (SndListHandle) GetNamedResource('snd ', snd); - - if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, (flags & wxSOUND_ASYNC)) == noErr)) - ret = true; - } - - return ret; -} - - -bool wxSound::FreeData() -{ - bool ret = false; - - if (m_isResource) - { - m_sndname.Empty(); - ret = true; - } - else - { - //TODO, - } - - return ret; -} - - -//code below is from an old implementation used for telinfo with MSVC crossplatform support -//technology proceeds, so it would be the wisest to drop this code, but it's left here just -//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3 - -/*static short MacOpenSndFile (char * path) -{ - VolumeParam vp; - FSSpec fspec; - Str255 name; - char *c; - - // first, get the volume reference number for the file. Start by - // making a Pstring with just the volume name - strcpy ((char *) name, path); - if (c = strchr ((char *) name, ':')) - { - c++; - *c = '\0'; - } - - c2pstr ((char *) name); - vp.ioCompletion = 0; - vp.ioVolIndex = -1; - vp.ioNamePtr = name; - vp.ioVRefNum = 0; - - if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr) - return 0; - - // next, buld an FSSpec for the file - strcpy ((char *) name, path); - c2pstr ((char *) name); - if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr) - return 0; - - short frefnum; - // now open the file, and return it's reference number - if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr) - return 0; - - return frefnum; -} - - -void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime) -{ - if(!sndChan) - { - KillTimer(0,timerID); - return; - } - - SCStatus scstat; - - if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) { - if (scstat.scChannelPaused || scstat.scChannelBusy) - return; // not done yet - } - - // either error or done. - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - KillTimer(0,timerID); -}*/ - - -#endif diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp deleted file mode 100644 index f8dcca8bd9..0000000000 --- a/src/mac/carbon/spinbutt.cpp +++ /dev/null @@ -1,182 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp -// Purpose: wxSpinButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "spinbutt.h" -#pragma implementation "spinbuttbase.h" -#endif - -#include "wx/spinbutt.h" -#include "wx/mac/uma.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) -#endif - -wxSpinButton::wxSpinButton() - : wxSpinButtonBase() -{ -} - -bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if ( !wxSpinButtonBase::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - m_min = 0; - m_max = 100; - - if (!parent) - return FALSE; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100, - kControlLittleArrowsProc , (long) this ) ; - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxSpinButton::~wxSpinButton() -{ -} - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -int wxSpinButton::GetMin() const -{ - return m_min; -} - -int wxSpinButton::GetMax() const -{ - return m_max; -} - -int wxSpinButton::GetValue() const -{ - return m_value; -} - -void wxSpinButton::SetValue(int val) -{ - m_value = val ; -} - -void wxSpinButton::SetRange(int minVal, int maxVal) -{ - m_min = minVal; - m_max = maxVal; - SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ; - SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ; -} - -void wxSpinButton::MacHandleValueChanged( int inc ) -{ - - wxEventType scrollEvent = wxEVT_NULL; - int oldValue = m_value ; - - m_value = oldValue + inc; - - if (m_value < m_min) - { - if ( m_windowStyle & wxSP_WRAP ) - m_value = m_max; - else - m_value = m_min; - } - - if (m_value > m_max) - { - if ( m_windowStyle & wxSP_WRAP ) - m_value = m_min; - else - m_value = m_max; - } - - if ( m_value - oldValue == -1 ) - scrollEvent = wxEVT_SCROLL_LINEDOWN ; - else if ( m_value - oldValue == 1 ) - scrollEvent = wxEVT_SCROLL_LINEUP ; - else - scrollEvent = wxEVT_SCROLL_THUMBTRACK ; - - wxSpinEvent event(scrollEvent, m_windowId); - - event.SetPosition(m_value); - event.SetEventObject( this ); - if ((GetEventHandler()->ProcessEvent( event )) && - !event.IsAllowed() ) - { - m_value = oldValue ; - } - SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ; - - /* always send a thumbtrack event */ - if (scrollEvent != wxEVT_SCROLL_THUMBTRACK) - { - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - wxSpinEvent event2( scrollEvent, GetId()); - event2.SetPosition( m_value ); - event2.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event2 ); - } -} - -void wxSpinButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - - int nScrollInc = 0; - - switch( controlpart ) - { - case kControlUpButtonPart : - nScrollInc = 1; - break ; - case kControlDownButtonPart : - nScrollInc = -1; - break ; - } - MacHandleValueChanged( nScrollInc ) ; - -} - -// ---------------------------------------------------------------------------- -// size calculation -// ---------------------------------------------------------------------------- - -wxSize wxSpinButton::DoGetBestSize() const -{ - return wxSize(16,24); -} - diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp deleted file mode 100644 index 22553d47f1..0000000000 --- a/src/mac/carbon/spinctrl.cpp +++ /dev/null @@ -1,333 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp -// Purpose: wxSpinCtrl -// Author: Robert -// Modified by: Mark Newsam (Based on GTK file) -// RCS-ID: $Id$ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "spinctlg.h" -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif //WX_PRECOMP - -#if wxUSE_SPINCTRL - -#include "wx/spinbutt.h" -#include "wx/spinctrl.h" - - -#include "wx/spinctrl.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the text control and the spin -static const wxCoord MARGIN = 2; - -// ---------------------------------------------------------------------------- -// wxSpinCtrlText: text control used by spin control -// ---------------------------------------------------------------------------- - -class wxSpinCtrlText : public wxTextCtrl -{ -public: - wxSpinCtrlText(wxSpinCtrl *spin, const wxString& value) - : wxTextCtrl(spin , -1, value) - { - m_spin = spin; - } - -protected: - void OnTextChange(wxCommandEvent& event) - { - int val; - if ( m_spin->GetTextValue(&val) ) - { - m_spin->GetSpinButton()->SetValue(val); - } - - event.Skip(); - } - - bool ProcessEvent(wxEvent &event) - { - // Hand button down events to wxSpinCtrl. Doesn't work. - if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event )) - return TRUE; - - return wxTextCtrl::ProcessEvent( event ); - } - -private: - wxSpinCtrl *m_spin; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSpinCtrlText, wxTextCtrl) - EVT_TEXT(-1, wxSpinCtrlText::OnTextChange) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxSpinCtrlButton: spin button used by spin control -// ---------------------------------------------------------------------------- - -class wxSpinCtrlButton : public wxSpinButton -{ -public: - wxSpinCtrlButton(wxSpinCtrl *spin, int style) - : wxSpinButton(spin ) - { - m_spin = spin; - - SetWindowStyle(style | wxSP_VERTICAL); - } - -protected: - void OnSpinButton(wxSpinEvent& eventSpin) - { -#if defined(__WXMAC__) || defined(__WXMOTIF__) - m_spin->SetTextValue(eventSpin.GetPosition()); - - wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); - event.SetEventObject(m_spin); - event.SetInt(eventSpin.GetPosition()); - - m_spin->GetEventHandler()->ProcessEvent(event); -#else - m_spin->SetTextValue(eventSpin.GetPosition()); - eventSpin.Skip(); -#endif - } - -private: - wxSpinCtrl *m_spin; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) - EVT_SPIN(-1, wxSpinCtrlButton::OnSpinButton) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxSpinCtrl creation -// ---------------------------------------------------------------------------- - -void wxSpinCtrl::Init() -{ - m_text = NULL; - m_btn = NULL; -} - -bool wxSpinCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - int min, - int max, - int initial, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style, - wxDefaultValidator, name) ) - { - return FALSE; - } - - // the string value overrides the numeric one (for backwards compatibility - // reasons and also because it is simpler to satisfy the string value which - // comes much sooner in the list of arguments and leave the initial - // parameter unspecified) - if ( !value.empty() ) - { - long l; - if ( value.ToLong(&l) ) - initial = l; - } - - wxSize csize = size ; - m_text = new wxSpinCtrlText(this, value); - m_btn = new wxSpinCtrlButton(this, style); - - m_btn->SetRange(min, max); - m_btn->SetValue(initial); - - if ( size.y == -1 ) { - csize.y = m_text->GetSize().y ; - } - DoSetSize(pos.x , pos.y , csize.x, csize.y); - - return TRUE; -} - -wxSpinCtrl::~wxSpinCtrl() -{ - // delete the controls now, don't leave them alive even though they would - // still be eventually deleted by our parent - but it will be too late, the - // user code expects them to be gone now - delete m_text; - m_text = NULL ; - delete m_btn; - m_btn = NULL ; -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxSpinCtrl::DoGetBestSize() const -{ - wxSize sizeBtn = m_btn->GetBestSize(), - sizeText = m_text->GetBestSize(); - - return wxSize(sizeBtn.x + sizeText.x + MARGIN, sizeText.y); -} - -void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) -{ - wxControl::DoMoveWindow(x, y, width, height); - - // position the subcontrols inside the client area - wxSize sizeBtn = m_btn->GetSize(); - - wxCoord wText = width - sizeBtn.x; - m_text->SetSize(0, 0, wText, height); - m_btn->SetSize(0 + wText + MARGIN, 0, -1, -1); -} - -// ---------------------------------------------------------------------------- -// operations forwarded to the subcontrols -// ---------------------------------------------------------------------------- - -bool wxSpinCtrl::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return FALSE; - return TRUE; -} - -bool wxSpinCtrl::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return FALSE; - return TRUE; -} - -// ---------------------------------------------------------------------------- -// value and range access -// ---------------------------------------------------------------------------- - -bool wxSpinCtrl::GetTextValue(int *val) const -{ - long l; - if ( !m_text->GetValue().ToLong(&l) ) - { - // not a number at all - return FALSE; - } - - if ( l < GetMin() || l > GetMax() ) - { - // out of range - return FALSE; - } - - *val = l; - - return TRUE; -} - -int wxSpinCtrl::GetValue() const -{ - return m_btn ? m_btn->GetValue() : 0; -} - -int wxSpinCtrl::GetMin() const -{ - return m_btn ? m_btn->GetMin() : 0; -} - -int wxSpinCtrl::GetMax() const -{ - return m_btn ? m_btn->GetMax() : 0; -} - -// ---------------------------------------------------------------------------- -// changing value and range -// ---------------------------------------------------------------------------- - -void wxSpinCtrl::SetTextValue(int val) -{ - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetTextValue") ); - - m_text->SetValue(wxString::Format(_T("%d"), val)); - - // select all text - m_text->SetSelection(0, -1); - - // and give focus to the control! - // m_text->SetFocus(); Why???? TODO. -} - -void wxSpinCtrl::SetValue(int val) -{ - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetValue") ); - - SetTextValue(val); - - m_btn->SetValue(val); -} - -void wxSpinCtrl::SetValue(const wxString& text) -{ - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetValue") ); - - long val; - if ( text.ToLong(&val) && ((val > INT_MIN) && (val < INT_MAX)) ) - { - SetValue((int)val); - } - else // not a number at all or out of range - { - m_text->SetValue(text); - m_text->SetSelection(0, -1); - } -} - -void wxSpinCtrl::SetRange(int min, int max) -{ - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetRange") ); - - m_btn->SetRange(min, max); -} - -void wxSpinCtrl::SetSelection(long from, long to) -{ - // if from and to are both -1, it means (in wxWindows) that all text should - // be selected - if ( (from == -1) && (to == -1) ) - { - from = 0; - } - m_text->SetSelection(from, to); -} - -#endif // wxUSE_SPINCTRL diff --git a/src/mac/carbon/statbmp.cpp b/src/mac/carbon/statbmp.cpp deleted file mode 100644 index 68bc4efa6a..0000000000 --- a/src/mac/carbon/statbmp.cpp +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.cpp -// Purpose: wxStaticBitmap -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "statbmp.h" -#endif - -#include "wx/defs.h" - -#include "wx/statbmp.h" -#include "wx/dcclient.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) -#endif - -/* - * wxStaticBitmap - */ - -BEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase) - EVT_PAINT(wxStaticBitmap::OnPaint) -END_EVENT_TABLE() - -bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, - const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& s, - long style, - const wxString& name) -{ - SetName(name); - wxSize size = s ; - if ( bitmap.Ok() ) - { - if ( size.x == -1 ) - size.x = bitmap.GetWidth() ; - if ( size.y == -1 ) - size.y = bitmap.GetHeight() ; - } - - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - - m_bitmap = bitmap; - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetBestSize( size ) ; - - return ret; -} - -void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); - Refresh() ; -} - -void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - PrepareDC(dc); - - dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ; -} - -wxSize wxStaticBitmap::DoGetBestSize() const -{ - return wxWindow::DoGetBestSize() ; -} - diff --git a/src/mac/carbon/statbox.cpp b/src/mac/carbon/statbox.cpp deleted file mode 100644 index 13c7daf669..0000000000 --- a/src/mac/carbon/statbox.cpp +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp -// Purpose: wxStaticBox -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbox.h" -#endif - -#include "wx/defs.h" - -#include "wx/statbox.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) - -BEGIN_EVENT_TABLE(wxStaticBox, wxControl) - EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) -END_EVENT_TABLE() - -#endif - -/* - * Static box - */ - -bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlGroupBoxTextTitleProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp deleted file mode 100644 index b2dba2135d..0000000000 --- a/src/mac/carbon/statbrma.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: statbar.cpp -// Purpose: native implementation of wxStatusBar (optional) -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbrma.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/statusbr.h" -#include "wx/dc.h" -#include "wx/dcclient.h" - -BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric) - EVT_PAINT(wxStatusBarMac::OnPaint) -END_EVENT_TABLE() - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStatusBarMac class -// ---------------------------------------------------------------------------- - -wxStatusBarMac::wxStatusBarMac() -{ - SetParent(NULL); -} - -wxStatusBarMac::~wxStatusBarMac() -{ -} - -bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, - long style , - const wxString& name) -{ - return wxStatusBarGeneric::Create( parent , id , style , name ) ; -} - -void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) -{ - int leftMargin = 2; - - wxRect rect; - GetFieldRect(i, rect); - - if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) ) - { - dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; - } - - wxString text(GetStatusText(i)); - - long x, y; - - dc.GetTextExtent(text, &x, &y); - - int xpos = rect.x + leftMargin + 1 ; - int ypos = 1 ; - - dc.SetClippingRegion(rect.x, 0, rect.width, m_height); - - dc.DrawText(text, xpos, ypos); - - dc.DestroyClippingRegion(); -} - -void wxStatusBarMac::DrawField(wxDC& dc, int i) -{ - DrawFieldText(dc, i); -} - -void wxStatusBarMac::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( (number >= 0) && (number < m_nFields), - _T("invalid status bar field index") ); - - m_statusStrings[number] = text; - wxRect rect; - GetFieldRect(number, rect); - rect.y=0; - rect.height = m_height ; - Refresh( TRUE , &rect ) ; - Update(); -} - -void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - dc.Clear() ; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - if ( IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) ) - { - wxPen white( wxWHITE , 1 , wxSOLID ) ; - if (major >= 10) - { - //Finder statusbar border color: (Project builder similar is 9B9B9B) - dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); - } - else - { - wxPen black( wxBLACK , 1 , wxSOLID ) ; - dc.SetPen(black); - } - dc.DrawLine(0, 0 , - m_width , 0); - dc.SetPen(white); - dc.DrawLine(0, 1 , - m_width , 1); - } - else - { - if (major >= 10) - //Finder statusbar border color: (Project builder similar is 9B9B9B) - dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); - else - dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID)); - - dc.DrawLine(0, 0 , - m_width , 0); - } - - int i; - if ( GetFont().Ok() ) - dc.SetFont(GetFont()); - dc.SetBackgroundMode(wxTRANSPARENT); - - for ( i = 0; i < m_nFields; i ++ ) - DrawField(dc, i); -} - -void wxStatusBarMac::MacSuperEnabled( bool enabled ) -{ - Refresh(FALSE) ; - wxWindow::MacSuperEnabled( enabled ) ; -} diff --git a/src/mac/carbon/statline.cpp b/src/mac/carbon/statline.cpp deleted file mode 100644 index 52f3d40733..0000000000 --- a/src/mac/carbon/statline.cpp +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.cpp -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "statline.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/statline.h" -#include "wx/statbox.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -bool wxStaticLine::Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; - - // ok, this is ugly but it's better than nothing: use a thin static box to - // emulate static line - - wxSize sizeReal = AdjustSize(size); - -// m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name); - - return TRUE; -} diff --git a/src/mac/carbon/statlmac.cpp b/src/mac/carbon/statlmac.cpp deleted file mode 100644 index a7a116ba57..0000000000 --- a/src/mac/carbon/statlmac.cpp +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.cpp -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "statline.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/statline.h" -#include "wx/statbox.h" - -#include "wx/mac/uma.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -bool wxStaticLine::Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - if ( !wxStaticLineBase::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlSeparatorLineProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp deleted file mode 100644 index 1c0facdbf7..0000000000 --- a/src/mac/carbon/stattext.cpp +++ /dev/null @@ -1,262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp -// Purpose: wxStaticText -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "stattext.h" -#endif - -#include "wx/app.h" -#include "wx/stattext.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/settings.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) -#endif - -#include "wx/mac/uma.h" - -BEGIN_EVENT_TABLE(wxStaticText, wxStaticTextBase) - EVT_PAINT(wxStaticText::OnPaint) -END_EVENT_TABLE() - -bool wxStaticText::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_label = wxStripMenuCodes(label) ; - - if ( !wxControl::Create( parent, id, pos, size, style, - wxDefaultValidator , name ) ) - { - return false; - } - - SetBestSize( size ) ; - - return true; -} - -const wxString punct = wxT(" ,.-;:!?"); - -void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y) -{ - long width, height ; - - if (paragraph.Length() == 0) - { - // empty line - dc.GetTextExtent( wxT("H"), &width, &height ); - y += height; - - return; - } - - int x = 0 ; - - bool linedrawn = true; - while( paragraph.Length() > 0 ) - { - dc.GetTextExtent( paragraph , &width , &height ) ; - - if ( width > m_width ) - { - for ( size_t p = paragraph.Length() - 1 ; p > 0 ; --p ) - { - if ((punct.Find(paragraph[p]) != wxNOT_FOUND) || !linedrawn) - { - int blank = (paragraph[p] == ' ') ? 0 : 1; - - dc.GetTextExtent( paragraph.Left(p + blank) , &width , &height ) ; - - if ( width <= m_width ) - { - int pos = x ; - if ( HasFlag( wxALIGN_CENTER ) ) - { - pos += ( m_width - width ) / 2 ; - } - else if ( HasFlag( wxALIGN_RIGHT ) ) - { - pos += ( m_width - width ) ; - } - - dc.DrawText( paragraph.Left(p + blank), pos , y) ; - y += height ; - paragraph = paragraph.Mid(p+1) ; - linedrawn = true; - break ; - } - } - } - - linedrawn = false; - } - else - { - int pos = x ; - if ( HasFlag( wxALIGN_CENTER ) ) - { - pos += ( m_width - width ) / 2 ; - } - else if ( HasFlag( wxALIGN_RIGHT ) ) - { - pos += ( m_width - width ) ; - } - - dc.DrawText( paragraph, pos , y) ; - paragraph=wxEmptyString; - y += height ; - } - } -} - -void wxStaticText::OnDraw( wxDC &dc ) -{ - if (m_width <= 0 || m_height <= 0) - return; - /* - dc.Clear() ; - wxRect rect(0,0,m_width,m_height) ; - dc.SetFont(*wxSMALL_FONT) ; - - dc.DrawRectangle(rect) ; - */ - if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) && - ( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) - || GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) ) - { - dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; - } - else - { - dc.SetTextForeground( GetForegroundColour() ) ; - } - - wxString paragraph; - size_t i = 0 ; - wxString text = m_label; - int y = 0 ; - while (i < text.Length()) - { - - if (text[i] == 13 || text[i] == 10) - { - DrawParagraph(dc, paragraph,y); - paragraph = wxEmptyString ; - } - else - { - paragraph += text[i]; - } - ++i; - } - if (paragraph.Length() > 0) - DrawParagraph(dc, paragraph,y); -} - -void wxStaticText::OnPaint( wxPaintEvent & WXUNUSED(event) ) -{ - wxPaintDC dc(this); - OnDraw( dc ) ; -} - -wxSize wxStaticText::DoGetBestSize() const -{ - int widthTextMax = 0, widthLine, - heightTextTotal = 0, heightLineDefault = 0, heightLine = 0; - - wxString curLine; - for ( const wxChar *pc = m_label; ; pc++ ) - { - if ( *pc == wxT('\n') || *pc == wxT('\r') || *pc == wxT('\0') ) - { - if ( !curLine ) - { - // we can't use GetTextExtent - it will return 0 for both width - // and height and an empty line should count in height - // calculation - if ( !heightLineDefault ) - heightLineDefault = heightLine; - if ( !heightLineDefault ) - GetTextExtent(_T("W"), NULL, &heightLineDefault); - - heightTextTotal += heightLineDefault; - - heightTextTotal++; // FIXME: why is this necessary? - } - else - { - GetTextExtent(curLine, &widthLine, &heightLine); - if ( widthLine > widthTextMax ) - widthTextMax = widthLine; - heightTextTotal += heightLine; - - heightTextTotal++; // FIXME: why is this necessary? - } - - if ( *pc == wxT('\n') || *pc == wxT('\r')) { - curLine.Empty(); - } - else { - // the end of string - break; - } - } - else { - curLine += *pc; - } - } - - return wxSize(widthTextMax, heightTextTotal); -} - -void wxStaticText::SetLabel(const wxString& st ) -{ - SetTitle( st ) ; - m_label = st ; - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - { - // temporary fix until layout measurement and drawing are in synch again - Refresh() ; - SetSize( GetBestSize() ) ; - } - Refresh() ; - Update() ; -} - -bool wxStaticText::SetFont(const wxFont& font) -{ - bool ret = wxControl::SetFont(font); - - if ( ret ) - { - // adjust the size of the window to fit to the label unless autoresizing is - // disabled - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - { - // temporary fix until layout measurement and drawing are in synch again - Refresh() ; - SetSize( GetBestSize() ); - } - } - - return ret; -} diff --git a/src/mac/carbon/tabctrl.cpp b/src/mac/carbon/tabctrl.cpp deleted file mode 100644 index f879b78447..0000000000 --- a/src/mac/carbon/tabctrl.cpp +++ /dev/null @@ -1,206 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.cpp -// Purpose: wxTabCtrl -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "tabctrl.h" -#endif - -#include "wx/defs.h" - -#include "wx/control.h" -#include "wx/tabctrl.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) -END_EVENT_TABLE() -#endif - -wxTabCtrl::wxTabCtrl() -{ - m_imageList = NULL; -} - -bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - m_imageList = NULL; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlTabSmallProc , (long) this ) ; - - MacPostControlCreate() ; - return TRUE ; -} - -wxTabCtrl::~wxTabCtrl() -{ -} - -void wxTabCtrl::Command(wxCommandEvent& event) -{ -} - -// Delete all items -bool wxTabCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -// Delete an item -bool wxTabCtrl::DeleteItem(int item) -{ - // TODO - return FALSE; -} - -// Get the selection -int wxTabCtrl::GetSelection() const -{ - // TODO - return 0; -} - -// Get the tab with the current keyboard focus -int wxTabCtrl::GetCurFocus() const -{ - // TODO - return 0; -} - -// Get the associated image list -wxImageList* wxTabCtrl::GetImageList() const -{ - return m_imageList; -} - -// Get the number of items -int wxTabCtrl::GetItemCount() const -{ - // TODO - return 0; -} - -// Get the rect corresponding to the tab -bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const -{ - // TODO - return FALSE; -} - -// Get the number of rows -int wxTabCtrl::GetRowCount() const -{ - // TODO - return 0; -} - -// Get the item text -wxString wxTabCtrl::GetItemText(int item) const -{ - // TODO - return wxEmptyString; -} - -// Get the item image -int wxTabCtrl::GetItemImage(int item) const -{ - // TODO - return 0; -} - -// Get the item data -void* wxTabCtrl::GetItemData(int item) const -{ - // TODO - return NULL; -} - -// Hit test -int wxTabCtrl::HitTest(const wxPoint& pt, long& flags) -{ - // TODO - return 0; -} - -// Insert an item -bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data) -{ - // TODO - return FALSE; -} - -// Set the selection -int wxTabCtrl::SetSelection(int item) -{ - // TODO - return 0; -} - -// Set the image list -void wxTabCtrl::SetImageList(wxImageList* imageList) -{ - // TODO -} - -// Set the text for an item -bool wxTabCtrl::SetItemText(int item, const wxString& text) -{ - // TODO - return FALSE; -} - -// Set the image for an item -bool wxTabCtrl::SetItemImage(int item, int image) -{ - // TODO - return FALSE; -} - -// Set the data for an item -bool wxTabCtrl::SetItemData(int item, void* data) -{ - // TODO - return FALSE; -} - -// Set the size for a fixed-width tab control -void wxTabCtrl::SetItemSize(const wxSize& size) -{ - // TODO -} - -// Set the padding between tabs -void wxTabCtrl::SetPadding(const wxSize& padding) -{ - // TODO -} - -// Tab event -IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) - -wxTabEvent::wxTabEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ -} - diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp deleted file mode 100644 index 2b03417c0f..0000000000 --- a/src/mac/carbon/textctrl.cpp +++ /dev/null @@ -1,1810 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp -// Purpose: wxTextCtrl -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "textctrl.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_TEXTCTRL - -#ifdef __DARWIN__ - #include - #include -#else - #include -#endif - -#include "wx/msgdlg.h" - -#if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif -#endif - -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/button.h" -#include "wx/toplevel.h" -#include "wx/textctrl.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/settings.h" -#include "wx/filefn.h" -#include "wx/utils.h" - -#if defined(__BORLANDC__) && !defined(__WIN32__) - #include -#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__DARWIN__) - #include -#endif - -#ifndef __DARWIN__ -#include -#endif -#include -#include -#include -#include -#include "wx/mac/uma.h" - -#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL - -extern wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ; - -// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon -// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the -// moment is to avoid setting the true focus on the control, the proper solution at the end would be to have -// an alternate path for carbon key events that routes automatically into the same wx flow of events - -/* part codes */ - -/* kmUPTextPart is the part code we return to indicate the user has clicked - in the text area of our control */ -#define kmUPTextPart 1 - -/* kmUPScrollPart is the part code we return to indicate the user has clicked - in the scroll bar part of the control. */ -#define kmUPScrollPart 2 - - -/* routines for using existing user pane controls. - These routines are useful for cases where you would like to use an - existing user pane control in, say, a dialog window as a scrolling - text edit field.*/ - -/* mUPOpenControl initializes a user pane control so it will be drawn - and will behave as a scrolling text edit field inside of a window. - This routine performs all of the initialization steps necessary, - except it does not create the user pane control itself. theControl - should refer to a user pane control that you have either created - yourself or extracted from a dialog's control heirarchy using - the GetDialogItemAsControl routine. */ -OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle); - -/* Utility Routines */ - -enum { - kShiftKeyCode = 56 -}; - -/* kUserClickedToFocusPart is a part code we pass to the SetKeyboardFocus - routine. In our focus switching routine this part code is understood - as meaning 'the user has clicked in the control and we need to switch - the current focus to ourselves before we can continue'. */ -#define kUserClickedToFocusPart 100 - - -/* kmUPClickScrollDelayTicks is a time measurement in ticks used to - slow the speed of 'auto scrolling' inside of our clickloop routine. - This value prevents the text from wizzzzzing by while the mouse - is being held down inside of the text area. */ -#define kmUPClickScrollDelayTicks 3 - - -/* STPTextPaneVars is a structure used for storing the the mUP Control's - internal variables and state information. A handle to this record is - stored in the pane control's reference value field using the - SetControlReference routine. */ - -typedef struct { - /* OS records referenced */ - TXNObject fTXNRec; /* the txn record */ - TXNFrameID fTXNFrame; /* the txn frame ID */ - ControlHandle fUserPaneRec; /* handle to the user pane control */ - WindowPtr fOwner; /* window containing control */ - GrafPtr fDrawingEnvironment; /* grafport where control is drawn */ - /* flags */ - Boolean fInFocus; /* true while the focus rect is drawn around the control */ - Boolean fIsActive; /* true while the control is drawn in the active state */ - Boolean fTEActive; /* reflects the activation state of the text edit record */ - Boolean fInDialogWindow; /* true if displayed in a dialog window */ - /* calculated locations */ - Rect fRTextArea; /* area where the text is drawn */ - Rect fRFocusOutline; /* rectangle used to draw the focus box */ - Rect fRTextOutline; /* rectangle used to draw the border */ - RgnHandle fTextBackgroundRgn; /* background region for the text, erased before calling TEUpdate */ - /* our focus advance override routine */ - EventHandlerUPP handlerUPP; - EventHandlerRef handlerRef; - bool fMultiline ; -} STPTextPaneVars; - - - - -/* Univerals Procedure Pointer variables used by the - mUP Control. These variables are set up - the first time that mUPOpenControl is called. */ -ControlUserPaneDrawUPP gTPDrawProc = NULL; -ControlUserPaneHitTestUPP gTPHitProc = NULL; -ControlUserPaneTrackingUPP gTPTrackProc = NULL; -ControlUserPaneIdleUPP gTPIdleProc = NULL; -ControlUserPaneKeyDownUPP gTPKeyProc = NULL; -ControlUserPaneActivateUPP gTPActivateProc = NULL; -ControlUserPaneFocusUPP gTPFocusProc = NULL; - -/* TPActivatePaneText activates or deactivates the text edit record - according to the value of setActive. The primary purpose of this - routine is to ensure each call is only made once. */ -static void TPActivatePaneText(STPTextPaneVars **tpvars, Boolean setActive) { - STPTextPaneVars *varsp; - varsp = *tpvars; - if (varsp->fTEActive != setActive) { - - varsp->fTEActive = setActive; - - TXNActivate(varsp->fTXNRec, varsp->fTXNFrame, varsp->fTEActive); - - if (varsp->fInFocus) - TXNFocus( varsp->fTXNRec, varsp->fTEActive); - } -} - - -/* TPFocusPaneText set the focus state for the text record. */ -static void TPFocusPaneText(STPTextPaneVars **tpvars, Boolean setFocus) { - STPTextPaneVars *varsp; - varsp = *tpvars; - if (varsp->fInFocus != setFocus) { - varsp->fInFocus = setFocus; - TXNFocus( varsp->fTXNRec, varsp->fInFocus); - } -} - - -/* TPPaneDrawProc is called to redraw the control and for update events - referring to the control. This routine erases the text area's background, - and redraws the text. This routine assumes the scroll bar has been - redrawn by a call to DrawControls. */ -static pascal void TPPaneDrawProc(ControlRef theControl, ControlPartCode thePart) { - STPTextPaneVars **tpvars, *varsp; - char state; - Rect bounds; - /* set up our globals */ - - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - - /* save the drawing state */ - SetPort((**tpvars).fDrawingEnvironment); - /* verify our boundary */ - GetControlBounds(theControl, &bounds); - - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - if ( ! EqualRect(&bounds, &varsp->fRFocusOutline) ) { - // scrollbar is on the border, we add one - Rect oldbounds = varsp->fRFocusOutline ; - InsetRect( &oldbounds , -1 , -1 ) ; - - if ( IsControlVisible( theControl ) ) - InvalWindowRect( GetControlOwner( theControl ) , &oldbounds ) ; - SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , - bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); - RectRgn(varsp->fTextBackgroundRgn, &varsp->fRTextOutline); - if ( IsControlVisible( theControl ) ) - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left, - varsp->fRTextArea.bottom, varsp->fRTextArea.right, varsp->fTXNFrame); - else - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 30000 , varsp->fRTextArea.left + 30000 , - varsp->fRTextArea.bottom + 30000 , varsp->fRTextArea.right + 30000 , varsp->fTXNFrame); - - } - - if ( IsControlVisible( theControl ) ) - { - /* update the text region */ - RGBColor white = { 65535 , 65535 , 65535 } ; - RGBBackColor( &white ) ; - EraseRgn(varsp->fTextBackgroundRgn); - TXNDraw(varsp->fTXNRec, NULL); - /* restore the drawing environment */ - /* draw the text frame and focus frame (if necessary) */ - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - if ((**tpvars).fIsActive && varsp->fInFocus) - DrawThemeFocusRect(&varsp->fRFocusOutline, true); - /* release our globals */ - HSetState((Handle) tpvars, state); - } - } -} - - -/* TPPaneHitTestProc is called when the control manager would - like to determine what part of the control the mouse resides over. - We also call this routine from our tracking proc to determine how - to handle mouse clicks. */ -static pascal ControlPartCode TPPaneHitTestProc(ControlHandle theControl, Point where) { - STPTextPaneVars **tpvars; - ControlPartCode result; - char state; - /* set up our locals and lock down our globals*/ - result = 0; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl) ) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - /* find the region where we clicked */ - if (PtInRect(where, &(**tpvars).fRTextArea)) { - result = kmUPTextPart; - } else result = 0; - /* release oure globals */ - HSetState((Handle) tpvars, state); - } - return result; -} - - - - - -/* TPPaneTrackingProc is called when the mouse is being held down - over our control. This routine handles clicks in the text area - and in the scroll bar. */ -static pascal ControlPartCode TPPaneTrackingProc(ControlHandle theControl, Point startPt, ControlActionUPP actionProc) { - STPTextPaneVars **tpvars, *varsp; - char state; - ControlPartCode partCodeResult; - /* make sure we have some variables... */ - partCodeResult = 0; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl ) ) { - /* lock 'em down */ - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* we don't do any of these functions unless we're in focus */ - if ( ! varsp->fInFocus) { - WindowPtr owner; - owner = GetControlOwner(theControl); - ClearKeyboardFocus(owner); - SetKeyboardFocus(owner, theControl, kUserClickedToFocusPart); - } - /* find the location for the click */ - switch (TPPaneHitTestProc(theControl, startPt)) { - - /* handle clicks in the text part */ - case kmUPTextPart: - { SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; -#if !TARGET_CARBON - TXNClick( varsp->fTXNRec, (const EventRecord*) wxTheApp->MacGetCurrentEvent()); -#else - EventRecord rec ; - ConvertEventRefToEventRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ; - TXNClick( varsp->fTXNRec, &rec ); -#endif - } - break; - - } - - HSetState((Handle) tpvars, state); - } - return partCodeResult; -} - - -/* TPPaneIdleProc is our user pane idle routine. When our text field - is active and in focus, we use this routine to set the cursor. */ -static pascal void TPPaneIdleProc(ControlHandle theControl) { - STPTextPaneVars **tpvars, *varsp; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl ) ) { - /* if we're not active, then we have nothing to say about the cursor */ - if ((**tpvars).fIsActive) { - char state; - Rect bounds; - Point mousep; - /* lock down the globals */ - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* get the current mouse coordinates (in our window) */ - SetPortWindowPort(GetControlOwner(theControl)); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - GetMouse(&mousep); - /* there's a 'focus thing' and an 'unfocused thing' */ - if (varsp->fInFocus) { - /* flash the cursor */ - SetPort((**tpvars).fDrawingEnvironment); - TXNIdle(varsp->fTXNRec); - /* set the cursor */ - if (PtInRect(mousep, &varsp->fRTextArea)) { - RgnHandle theRgn; - RectRgn((theRgn = NewRgn()), &varsp->fRTextArea); - TXNAdjustCursor(varsp->fTXNRec, theRgn); - DisposeRgn(theRgn); - } - else - { - // SetThemeCursor(kThemeArrowCursor); - } - } else { - /* if it's in our bounds, set the cursor */ - GetControlBounds(theControl, &bounds); - if (PtInRect(mousep, &bounds)) - { - // SetThemeCursor(kThemeArrowCursor); - } - } - - HSetState((Handle) tpvars, state); - } - } -} - - -/* TPPaneKeyDownProc is called whenever a keydown event is directed - at our control. Here, we direct the keydown event to the text - edit record and redraw the scroll bar and text field as appropriate. */ -static pascal ControlPartCode TPPaneKeyDownProc(ControlHandle theControl, - SInt16 keyCode, SInt16 charCode, SInt16 modifiers) { - STPTextPaneVars **tpvars; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - if ((**tpvars).fInFocus) { - /* turn autoscrolling on and send the key event to text edit */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - EventRecord ev ; - memset( &ev , 0 , sizeof( ev ) ) ; - ev.what = keyDown ; - ev.modifiers = modifiers ; - ev.message = (( keyCode << 8 ) & keyCodeMask ) + ( charCode & charCodeMask ) ; - TXNKeyDown( (**tpvars).fTXNRec, &ev); - } - } - return kControlEntireControl; -} - - -/* TPPaneActivateProc is called when the window containing - the user pane control receives activate events. Here, we redraw - the control and it's text as necessary for the activation state. */ -static pascal void TPPaneActivateProc(ControlHandle theControl, Boolean activating) { - Rect bounds; - STPTextPaneVars **tpvars, *varsp; - char state; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* de/activate the text edit record */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - GetControlBounds(theControl, &bounds); - varsp->fIsActive = activating; - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* redraw the frame */ - if ( IsControlVisible( theControl ) ) - { - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - if (varsp->fInFocus) - DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fIsActive); - } - HSetState((Handle) tpvars, state); - } -} - - -/* TPPaneFocusProc is called when every the focus changes to or - from our control. Herein, switch the focus appropriately - according to the parameters and redraw the control as - necessary. */ -static pascal ControlPartCode TPPaneFocusProc(ControlHandle theControl, ControlFocusPart action) { - ControlPartCode focusResult; - STPTextPaneVars **tpvars, *varsp; - char state; - /* set up locals */ - focusResult = kControlFocusNoPart; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL ) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* if kControlFocusPrevPart and kControlFocusNextPart are received when the user is - tabbing forwards (or shift tabbing backwards) through the items in the dialog, - and kControlFocusNextPart will be received. When the user clicks in our field - and it is not the current focus, then the constant kUserClickedToFocusPart will - be received. The constant kControlFocusNoPart will be received when our control - is the current focus and the user clicks in another control. In your focus routine, - you should respond to these codes as follows: - - kControlFocusNoPart - turn off focus and return kControlFocusNoPart. redraw - the control and the focus rectangle as necessary. - - kControlFocusPrevPart or kControlFocusNextPart - toggle focus on or off - depending on its current state. redraw the control and the focus rectangle - as appropriate for the new focus state. If the focus state is 'off', return the constant - kControlFocusNoPart, otherwise return a non-zero part code. - kUserClickedToFocusPart - is a constant defined for this example. You should - define your own value for handling click-to-focus type events. */ - /* calculate the next highlight state */ - switch (action) { - default: - case kControlFocusNoPart: - TPFocusPaneText(tpvars, false); - focusResult = kControlFocusNoPart; - break; - case kUserClickedToFocusPart: - TPFocusPaneText(tpvars, true); - focusResult = 1; - break; - case kControlFocusPrevPart: - case kControlFocusNextPart: - TPFocusPaneText(tpvars, ( ! varsp->fInFocus)); - focusResult = varsp->fInFocus ? 1 : kControlFocusNoPart; - break; - } - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* redraw the text fram and focus rectangle to indicate the - new focus state */ - if ( IsControlVisible( theControl ) ) - { - /* save the drawing state */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fIsActive && varsp->fInFocus); - } - /* done */ - HSetState((Handle) tpvars, state); - } - return focusResult; -} - - -/* mUPOpenControl initializes a user pane control so it will be drawn - and will behave as a scrolling text edit field inside of a window. - This routine performs all of the initialization steps necessary, - except it does not create the user pane control itself. theControl - should refer to a user pane control that you have either created - yourself or extracted from a dialog's control heirarchy using - the GetDialogItemAsControl routine. */ -OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) -{ - Rect bounds; - WindowRef theWindow; - STPTextPaneVars **tpvars, *varsp; - OSStatus err = noErr ; - RGBColor rgbWhite = {0xFFFF, 0xFFFF, 0xFFFF}; - TXNBackground tback; - - /* set up our globals */ - if (gTPDrawProc == NULL) gTPDrawProc = NewControlUserPaneDrawUPP(TPPaneDrawProc); - if (gTPHitProc == NULL) gTPHitProc = NewControlUserPaneHitTestUPP(TPPaneHitTestProc); - if (gTPTrackProc == NULL) gTPTrackProc = NewControlUserPaneTrackingUPP(TPPaneTrackingProc); - if (gTPIdleProc == NULL) gTPIdleProc = NewControlUserPaneIdleUPP(TPPaneIdleProc); - if (gTPKeyProc == NULL) gTPKeyProc = NewControlUserPaneKeyDownUPP(TPPaneKeyDownProc); - if (gTPActivateProc == NULL) gTPActivateProc = NewControlUserPaneActivateUPP(TPPaneActivateProc); - if (gTPFocusProc == NULL) gTPFocusProc = NewControlUserPaneFocusUPP(TPPaneFocusProc); - - /* allocate our private storage */ - tpvars = (STPTextPaneVars **) NewHandleClear(sizeof(STPTextPaneVars)); - SetControlReference(theControl, (long) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* set the initial settings for our private data */ - varsp->fMultiline = wxStyle & wxTE_MULTILINE ; - varsp->fInFocus = false; - varsp->fIsActive = true; - varsp->fTEActive = true; // in order to get a deactivate - varsp->fUserPaneRec = theControl; - theWindow = varsp->fOwner = GetControlOwner(theControl); - - varsp->fDrawingEnvironment = (GrafPtr) GetWindowPort(theWindow); - - varsp->fInDialogWindow = ( GetWindowKind(varsp->fOwner) == kDialogWindowKind ); - /* set up the user pane procedures */ - SetControlData(theControl, kControlEntireControl, kControlUserPaneDrawProcTag, sizeof(gTPDrawProc), &gTPDrawProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneHitTestProcTag, sizeof(gTPHitProc), &gTPHitProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneTrackingProcTag, sizeof(gTPTrackProc), &gTPTrackProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneIdleProcTag, sizeof(gTPIdleProc), &gTPIdleProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneKeyDownProcTag, sizeof(gTPKeyProc), &gTPKeyProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneActivateProcTag, sizeof(gTPActivateProc), &gTPActivateProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneFocusProcTag, sizeof(gTPFocusProc), &gTPFocusProc); - /* calculate the rectangles used by the control */ - GetControlBounds(theControl, &bounds); - SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , - bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); - /* calculate the background region for the text. In this case, it's kindof - and irregular region because we're setting the scroll bar a little ways inside - of the text area. */ - RectRgn((varsp->fTextBackgroundRgn = NewRgn()), &varsp->fRTextOutline); - - /* set up the drawing environment */ - SetPort(varsp->fDrawingEnvironment); - - /* create the new edit field */ - - TXNFrameOptions frameOptions = - kTXNDontDrawCaretWhenInactiveMask ; - if ( ! ( wxStyle & wxTE_NOHIDESEL ) ) - frameOptions |= kTXNDontDrawSelectionWhenInactiveMask ; - - if ( wxStyle & wxTE_MULTILINE ) - { - if ( ! ( wxStyle & wxTE_DONTWRAP ) ) - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; - else - { - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; - frameOptions |= kTXNWantHScrollBarMask ; - } - - if ( !(wxStyle & wxTE_NO_VSCROLL ) ) - frameOptions |= kTXNWantVScrollBarMask ; - } - else - frameOptions |= kTXNSingleLineOnlyMask ; - - if ( wxStyle & wxTE_READONLY ) - frameOptions |= kTXNReadOnlyMask ; - - TXNNewObject(NULL, varsp->fOwner, &varsp->fRTextArea, - frameOptions , - kTXNTextEditStyleFrameType, - kTXNTextensionFile, - kTXNSystemDefaultEncoding, - &varsp->fTXNRec, &varsp->fTXNFrame, (TXNObjectRefcon) tpvars); - - if ( !IsControlVisible( theControl ) ) - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 30000 , varsp->fRTextArea.left + 30000 , - varsp->fRTextArea.bottom + 30000 , varsp->fRTextArea.right + 30000 , varsp->fTXNFrame); - - - if ( (wxStyle & wxTE_MULTILINE) && (wxStyle & wxTE_DONTWRAP) ) - { - TXNControlTag tag = kTXNWordWrapStateTag ; - TXNControlData dat ; - dat.uValue = kTXNNoAutoWrap ; - TXNSetTXNObjectControls( varsp->fTXNRec , false , 1 , &tag , &dat ) ; - } - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - - TXNTypeAttributes typeAttr[] = - { - { kTXNQDFontNameAttribute , kTXNQDFontNameAttributeSize , { (void*) fontName } } , - { kTXNQDFontSizeAttribute , kTXNFontSizeAttributeSize , { (void*) (fontSize << 16) } } , - { kTXNQDFontStyleAttribute , kTXNQDFontStyleAttributeSize , { (void*) normal } } , - } ; - - err = TXNSetTypeAttributes (varsp->fTXNRec, sizeof( typeAttr ) / sizeof(TXNTypeAttributes) , typeAttr, - kTXNStartOffset, - kTXNEndOffset); - /* set the field's background */ - - tback.bgType = kTXNBackgroundTypeRGB; - tback.bg.color = rgbWhite; - TXNSetBackground( varsp->fTXNRec, &tback); - - /* unlock our storage */ - HUnlock((Handle) tpvars); - /* perform final activations and setup for our text field. Here, - we assume that the window is going to be the 'active' window. */ - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* all done */ - return err; -} - - - - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) - EVT_DROP_FILES(wxTextCtrl::OnDropFiles) - EVT_CHAR(wxTextCtrl::OnChar) - EVT_MENU(wxID_CUT, wxTextCtrl::OnCut) - EVT_MENU(wxID_COPY, wxTextCtrl::OnCopy) - EVT_MENU(wxID_PASTE, wxTextCtrl::OnPaste) - EVT_MENU(wxID_UNDO, wxTextCtrl::OnUndo) - EVT_MENU(wxID_REDO, wxTextCtrl::OnRedo) - - EVT_UPDATE_UI(wxID_CUT, wxTextCtrl::OnUpdateCut) - EVT_UPDATE_UI(wxID_COPY, wxTextCtrl::OnUpdateCopy) - EVT_UPDATE_UI(wxID_PASTE, wxTextCtrl::OnUpdatePaste) - EVT_UPDATE_UI(wxID_UNDO, wxTextCtrl::OnUpdateUndo) - EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo) -END_EVENT_TABLE() -#endif - -static void SetTXNData( TXNObject txn , const wxString& st , TXNOffset start , TXNOffset end ) -{ -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - size_t len = st.Len() ; - TXNSetData( txn , kTXNUnicodeTextData, (void*)st.wc_str(), len * 2, - start, end); -#else - wxMBConvUTF16BE converter ; - ByteCount byteBufferLen = converter.WC2MB( NULL , st.wc_str() , 0 ) ; - UniChar *unibuf = (UniChar*) malloc(byteBufferLen) ; - converter.WC2MB( (char*) unibuf , st.wc_str() , byteBufferLen ) ; - TXNSetData( txn , kTXNUnicodeTextData, (void*)unibuf, byteBufferLen , - start, end); - free( unibuf ) ; -#endif -#else - wxCharBuffer text = st.mb_str(wxConvLocal) ; - TXNSetData( txn , kTXNTextData, (void*)text.data(), strlen( text ) , - start, end); -#endif -} - -// Text item -void wxTextCtrl::Init() -{ - m_macTE = NULL ; - m_macTXN = NULL ; - m_macTXNvars = NULL ; - m_macUsesTXN = false ; - - m_editable = true ; - m_dirty = false; - - m_maxLength = TE_UNLIMITED_LENGTH ; -} - -wxTextCtrl::~wxTextCtrl() -{ - if ( m_macUsesTXN ) - { - SetControlReference((ControlHandle)m_macControl, 0) ; - TXNDeleteObject((TXNObject)m_macTXN); - /* delete our private storage */ - DisposeHandle((Handle) m_macTXNvars); - /* zero the control reference */ - } -} - -const short kVerticalMargin = 2 ; -const short kHorizontalMargin = 2 ; - -bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& str, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_macTE = NULL ; - m_macTXN = NULL ; - m_macTXNvars = NULL ; - m_macUsesTXN = false ; - m_editable = true ; - - m_macUsesTXN = ! (style & wxTE_PASSWORD ) ; - - m_macUsesTXN &= (TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress) ; - - // base initialization - if ( !wxTextCtrlBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) - return FALSE; - - wxSize mySize = size ; - if ( m_macUsesTXN ) - { - m_macHorizontalBorder = 5 ; // additional pixels around the real control - m_macVerticalBorder = 3 ; - } - else - { - m_macHorizontalBorder = 5 ; // additional pixels around the real control - m_macVerticalBorder = 5 ; - } - - - Rect bounds ; - Str255 title ; - /* - if ( mySize.y == -1 ) - { - mySize.y = 13 ; - if ( m_windowStyle & wxTE_MULTILINE ) - mySize.y *= 5 ; - - mySize.y += 2 * m_macVerticalBorder ; - } - */ - MacPreControlCreate( parent , id , wxEmptyString , pos , mySize ,style, validator , name , &bounds , title ) ; - - if ( m_windowStyle & wxTE_MULTILINE ) - { - wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER), - wxT("wxTE_PROCESS_ENTER style is ignored for multiline text controls (they always process it)") ); - - m_windowStyle |= wxTE_PROCESS_ENTER; - } - - if ( m_windowStyle & wxTE_READONLY) - { - m_editable = FALSE ; - } - - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , false , 0 , 0 , 1, - (style & wxTE_PASSWORD) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ; - long size ; - ::GetControlData((ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*)((TEHandle *)&m_macTE) , &size ) ; - - } - else - { - short featurSet; - - featurSet = kControlSupportsEmbedding | kControlSupportsFocus | kControlWantsIdle - | kControlWantsActivate | kControlHandlesTracking | kControlHasSpecialBackground - | kControlGetsFocusOnClick | kControlSupportsLiveFeedback; - /* create the control */ - m_macControl = NewControl(MAC_WXHWND(parent->MacGetRootWindow()), &bounds, "\p", false , featurSet, 0, featurSet, kControlUserPaneProc, 0); - /* set up the mUP specific features and data */ - mUPOpenControl((ControlHandle) m_macControl, m_windowStyle ); - } - MacPostControlCreate() ; - - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ; - } - else - { - STPTextPaneVars **tpvars; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl); - /* set the text in the record */ - m_macTXN = (**tpvars).fTXNRec ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNStartOffset, kTXNEndOffset ) ; - m_macTXNvars = tpvars ; - m_macUsesTXN = true ; - TXNSetSelection( (TXNObject) m_macTXN, 0, 0); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - } - - return TRUE; -} - -wxString wxTextCtrl::GetValue() const -{ - Size actualSize = 0; - wxString result ; - OSStatus err ; - if ( !m_macUsesTXN ) - { - err = ::GetControlDataSize((ControlHandle) m_macControl, 0, - ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, &actualSize ) ; - - if ( err ) - return wxEmptyString ; - - if ( actualSize > 0 ) - { - wxCharBuffer buf(actualSize) ; - ::GetControlData( (ControlHandle) m_macControl, 0, - ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, - actualSize , buf.data() , &actualSize ) ; - result = wxString( buf , wxConvLocal) ; - } - } - else - { -#if wxUSE_UNICODE - Handle theText ; - err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNUnicodeTextData ); - // all done - if ( err ) - { - actualSize = 0 ; - } - else - { - actualSize = GetHandleSize( theText ) / sizeof( UniChar) ; - if ( actualSize > 0 ) - { - wxChar *ptr = result.GetWriteBuf(actualSize*sizeof(wxChar)) ; -#if SIZEOF_WCHAR_T == 2 - wxStrncpy( ptr , (wxChar*) *theText , actualSize ) ; -#else - wxMBConvUTF16BE converter ; - HLock( theText ) ; - converter.MB2WC( ptr , (const char*)*theText , actualSize ) ; - HUnlock( theText ) ; -#endif - ptr[actualSize] = 0 ; - result.UngetWriteBuf( actualSize *sizeof(wxChar) ) ; - } - DisposeHandle( theText ) ; - } -#else - Handle theText ; - err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData ); - // all done - if ( err ) - { - actualSize = 0 ; - } - else - { - actualSize = GetHandleSize( theText ) ; - if ( actualSize > 0 ) - { - HLock( theText ) ; - result = wxString( *theText , wxConvLocal , actualSize ) ; - HUnlock( theText ) ; - } - DisposeHandle( theText ) ; - } -#endif - } - wxMacConvertNewlines10To13( &result ) ; - return result ; -} - -void wxTextCtrl::GetSelection(long* from, long* to) const -{ - if ( !m_macUsesTXN ) - { - *from = (**((TEHandle) m_macTE)).selStart; - *to = (**((TEHandle) m_macTE)).selEnd; - } - else - { - TXNGetSelection( (TXNObject) m_macTXN , (TXNOffset*) from , (TXNOffset*) to ) ; - } -} - -void wxTextCtrl::SetValue(const wxString& str) -{ - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNStartOffset, kTXNEndOffset ) ; - TXNSetSelection( (TXNObject) m_macTXN, 0, 0); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - if ( !formerEditable ) - SetEditable(formerEditable) ; - } - MacRedrawControl() ; -} - -void wxTextCtrl::SetMaxLength(unsigned long len) -{ - m_maxLength = len ; -} - -bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) -{ - if ( m_macUsesTXN ) - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNTypeAttributes typeAttr[4] ; - Str255 fontName = "\pMonaco" ; - SInt16 fontSize = 12 ; - Style fontStyle = normal ; - RGBColor color ; - int attrCounter = 0 ; - if ( style.HasFont() ) - { - const wxFont &font = style.GetFont() ; - wxMacStringToPascal( font.GetFaceName() , fontName ) ; - fontSize = font.GetPointSize() ; - if ( font.GetUnderlined() ) - fontStyle |= underline ; - if ( font.GetWeight() == wxBOLD ) - fontStyle |= bold ; - if ( font.GetStyle() == wxITALIC ) - fontStyle |= italic ; - - typeAttr[attrCounter].tag = kTXNQDFontNameAttribute ; - typeAttr[attrCounter].size = kTXNQDFontNameAttributeSize ; - typeAttr[attrCounter].data.dataPtr = (void*) fontName ; - typeAttr[attrCounter+1].tag = kTXNQDFontSizeAttribute ; - typeAttr[attrCounter+1].size = kTXNFontSizeAttributeSize ; - typeAttr[attrCounter+1].data.dataValue = (fontSize << 16) ; - typeAttr[attrCounter+2].tag = kTXNQDFontStyleAttribute ; - typeAttr[attrCounter+2].size = kTXNQDFontStyleAttributeSize ; - typeAttr[attrCounter+2].data.dataValue = fontStyle ; - attrCounter += 3 ; - - } - if ( style.HasTextColour() ) - { - typeAttr[attrCounter].tag = kTXNQDFontColorAttribute ; - typeAttr[attrCounter].size = kTXNQDFontColorAttributeSize ; - typeAttr[attrCounter].data.dataPtr = (void*) &color ; - color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ; - attrCounter += 1 ; - } - - if ( attrCounter > 0 ) - { -#ifdef __WXDEBUG__ - OSStatus status = -#endif // __WXDEBUG__ - TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr, start,end); - wxASSERT_MSG( status == noErr , wxT("Couldn't set text attributes") ) ; - } - if ( !formerEditable ) - SetEditable(formerEditable) ; - } - return TRUE ; -} - -bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) -{ - wxTextCtrlBase::SetDefaultStyle( style ) ; - SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ; - return TRUE ; -} - -// Clipboard operations -void wxTextCtrl::Copy() -{ - if (CanCopy()) - { - if ( !m_macUsesTXN ) - { - TECopy( ((TEHandle) m_macTE) ) ; - ClearCurrentScrap(); - TEToScrap() ; - MacRedrawControl() ; - } - else - { - ClearCurrentScrap(); - TXNCopy((TXNObject)m_macTXN); - TXNConvertToPublicScrap(); - } - } -} - -void wxTextCtrl::Cut() -{ - if (CanCut()) - { - if ( !m_macUsesTXN ) - { - TECut( ((TEHandle) m_macTE) ) ; - ClearCurrentScrap(); - TEToScrap() ; - MacRedrawControl() ; - } - else - { - ClearCurrentScrap(); - TXNCut((TXNObject)m_macTXN); - TXNConvertToPublicScrap(); - } - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString( GetValue() ) ; - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxTextCtrl::Paste() -{ - if (CanPaste()) - { - if ( !m_macUsesTXN ) - { - TEFromScrap() ; - TEPaste( (TEHandle) m_macTE ) ; - MacRedrawControl() ; - } - else - { - TXNConvertFromPublicScrap(); - TXNPaste((TXNObject)m_macTXN); - SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ; - } - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString( GetValue() ) ; - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } -} - -bool wxTextCtrl::CanCopy() const -{ - // Can copy if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to); -} - -bool wxTextCtrl::CanCut() const -{ - if ( !IsEditable() ) - { - return false ; - } - // Can cut if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to); -} - -bool wxTextCtrl::CanPaste() const -{ - if (!IsEditable()) - return FALSE; - -#if TARGET_CARBON - OSStatus err = noErr; - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - Size byteCount; - - if (( err = GetScrapFlavorFlags( scrapRef, 'TEXT', &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, 'TEXT', &byteCount )) == noErr) - { - return TRUE ; - } - } - } - return FALSE; - -#else - long offset ; - if ( GetScrap( NULL , 'TEXT' , &offset ) > 0 ) - { - return TRUE ; - } -#endif - return FALSE ; -} - -void wxTextCtrl::SetEditable(bool editable) -{ - if ( editable != m_editable ) - { - m_editable = editable ; - if ( !m_macUsesTXN ) - { - if ( editable ) - UMAActivateControl( (ControlHandle) m_macControl ) ; - else - UMADeactivateControl((ControlHandle) m_macControl ) ; - } - else - { - TXNControlTag tag[] = { kTXNIOPrivilegesTag } ; - TXNControlData data[] = { { editable ? kTXNReadWrite : kTXNReadOnly } } ; - TXNSetTXNObjectControls( (TXNObject) m_macTXN , false , sizeof(tag) / sizeof (TXNControlTag) , tag , data ) ; - } - } -} - -void wxTextCtrl::SetInsertionPoint(long pos) -{ - SetSelection( pos , pos ) ; -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - long pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxTextCtrl::GetInsertionPoint() const -{ - long begin,end ; - GetSelection( &begin , &end ) ; - return begin ; -} - -long wxTextCtrl::GetLastPosition() const -{ - if ( !m_macUsesTXN ) - { - return (**((TEHandle) m_macTE)).teLength ; - } - else - { - Handle theText ; - long actualsize ; - OSErr err = TXNGetDataEncoded( (TXNObject) m_macTXN, kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData ); - /* all done */ - if ( err ) - { - actualsize = 0 ; - } - else - { - actualsize = GetHandleSize( theText ) ; - DisposeHandle( theText ) ; - } - return actualsize ; - } -} - -void wxTextCtrl::Replace(long from, long to, const wxString& str) -{ - wxString value = str ; - wxMacConvertNewlines13To10( &value ) ; - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - - selection.selStart = from ; - selection.selEnd = to ; - ::SetControlData((ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - TESetSelect( from , to , ((TEHandle) m_macTE) ) ; - TEDelete( ((TEHandle) m_macTE) ) ; - TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ; - TXNClear( ((TXNObject) m_macTXN) ) ; - SetTXNData( (TXNObject) m_macTXN , str , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - Refresh() ; -} - -void wxTextCtrl::Remove(long from, long to) -{ - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - - selection.selStart = from ; - selection.selEnd = to ; - ::SetControlData( (ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - TEDelete( ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ; - TXNClear( ((TXNObject) m_macTXN) ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - Refresh() ; -} - -void wxTextCtrl::SetSelection(long from, long to) -{ - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - if ((from == -1) && (to == -1)) - { - selection.selStart = 0 ; - selection.selEnd = 32767 ; - } - else - { - selection.selStart = from ; - selection.selEnd = to ; - } - - TESetSelect( selection.selStart , selection.selEnd , ((TEHandle) m_macTE) ) ; - ::SetControlData((ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - } - else - { - STPTextPaneVars **tpvars; - /* set up our locals */ - tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl); - /* and our drawing environment as the operation - may force a redraw in the text area. */ - SetPort((**tpvars).fDrawingEnvironment); - /* change the selection */ - if ((from == -1) && (to == -1)) - TXNSelectAll((TXNObject) m_macTXN); - else - TXNSetSelection( (**tpvars).fTXNRec, from, to); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - } -} - -bool wxTextCtrl::LoadFile(const wxString& file) -{ - if ( wxTextCtrlBase::LoadFile(file) ) - { - return TRUE; - } - - return FALSE; -} - -void wxTextCtrl::WriteText(const wxString& str) -{ - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - TEInsert( text , strlen(text) , ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - long start , end , dummy ; - GetSelection( &start , &dummy ) ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ; - GetSelection( &dummy , &end ) ; - SetStyle( start , end , GetDefaultStyle() ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - MacRedrawControl() ; -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - SetInsertionPointEnd(); - WriteText(text); -} - -void wxTextCtrl::Clear() -{ - if ( !m_macUsesTXN ) - { - ::SetControlData((ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , 0 , (char*) ((const char*)NULL) ) ; - } - else - { - TXNSetSelection( (TXNObject)m_macTXN , kTXNStartOffset , kTXNEndOffset ) ; - TXNClear((TXNObject)m_macTXN); - } - Refresh() ; -} - -bool wxTextCtrl::IsModified() const -{ - return m_dirty; -} - -bool wxTextCtrl::IsEditable() const -{ - return IsEnabled() && m_editable ; -} - -bool wxTextCtrl::AcceptsFocus() const -{ - // we don't want focus if we can't be edited - return /*IsEditable() && */ wxControl::AcceptsFocus(); -} - -wxSize wxTextCtrl::DoGetBestSize() const -{ - int wText = 100 ; - - int hText; - if ( m_macUsesTXN ) - { - hText = 17 ; - } - else - { - hText = 13 ; - } -/* - int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); - - int wText = DEFAULT_ITEM_WIDTH; - - int hText = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); - - return wxSize(wText, hText); -*/ - if ( m_windowStyle & wxTE_MULTILINE ) - { - hText *= 5 ; - } - hText += 2 * m_macVerticalBorder ; - wText += 2 * m_macHorizontalBorder ; - //else: for single line control everything is ok - return wxSize(wText, hText); -} - -// ---------------------------------------------------------------------------- -// Undo/redo -// ---------------------------------------------------------------------------- - -void wxTextCtrl::Undo() -{ - if (CanUndo()) - { - if ( m_macUsesTXN ) - { - TXNUndo((TXNObject)m_macTXN); - } - } -} - -void wxTextCtrl::Redo() -{ - if (CanRedo()) - { - if ( m_macUsesTXN ) - { - TXNRedo((TXNObject)m_macTXN); - } - } -} - -bool wxTextCtrl::CanUndo() const -{ - if ( !IsEditable() ) - { - return false ; - } - if ( m_macUsesTXN ) - { - return TXNCanUndo((TXNObject)m_macTXN,NULL); - } - return FALSE ; -} - -bool wxTextCtrl::CanRedo() const -{ - if ( !IsEditable() ) - { - return false ; - } - if ( m_macUsesTXN ) - { - return TXNCanRedo((TXNObject)m_macTXN,NULL); - } - return FALSE ; -} - -// Makes modifie or unmodified -void wxTextCtrl::MarkDirty() -{ - m_dirty = true; -} - -void wxTextCtrl::DiscardEdits() -{ - m_dirty = false; -} - -int wxTextCtrl::GetNumberOfLines() const -{ - if ( m_macUsesTXN ) - { - ItemCount lines ; - TXNGetLineCount((TXNObject)m_macTXN, &lines ) ; - return lines ; - } - else - { - wxString content = GetValue() ; - - int count = 1; - for (size_t i = 0; i < content.Length() ; i++) - { - if (content[i] == '\r') count++; - } - return count; - } -} - -long wxTextCtrl::XYToPosition(long x, long y) const -{ - // TODO - return 0; -} - -bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const -{ - return FALSE ; -} - -void wxTextCtrl::ShowPosition(long pos) -{ -#if TARGET_RT_MAC_MACHO && defined(AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER) - if ( m_macUsesTXN ) - { - Point current ; - Point desired ; - TXNOffset selstart , selend ; - TXNGetSelection( (TXNObject) m_macTXN , &selstart , &selend) ; - TXNOffsetToPoint( (TXNObject) m_macTXN, selstart , ¤t); - TXNOffsetToPoint( (TXNObject) m_macTXN, pos , &desired); - //TODO use HIPoints for 10.3 and above - if ( (UInt32) TXNScroll != (UInt32) kUnresolvedCFragSymbolAddress ) - { - OSErr theErr = noErr; - SInt32 dv = desired.v - current.v ; - SInt32 dh = desired.h - current.h ; - TXNShowSelection( (TXNObject) m_macTXN , true ) ; - theErr = TXNScroll( (TXNObject) m_macTXN, kTXNScrollUnitsInPixels , kTXNScrollUnitsInPixels , &dv , &dh ); - wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") ); - } - } -#endif -} - -int wxTextCtrl::GetLineLength(long lineNo) const -{ - // TODO change this if possible to reflect real lines - wxString content = GetValue() ; - - // Find line first - int count = 0; - for (size_t i = 0; i < content.Length() ; i++) - { - if (count == lineNo) - { - // Count chars in line then - count = 0; - for (size_t j = i; j < content.Length(); j++) - { - count++; - if (content[j] == '\n') return count; - } - - return count; - } - if (content[i] == '\n') count++; - } - return 0; -} - -wxString wxTextCtrl::GetLineText(long lineNo) const -{ - // TODO change this if possible to reflect real lines - wxString content = GetValue() ; - - // Find line first - int count = 0; - for (size_t i = 0; i < content.Length() ; i++) - { - if (count == lineNo) - { - // Add chars in line then - wxString tmp; - - for (size_t j = i; j < content.Length(); j++) - { - if (content[j] == '\n') - return tmp; - - tmp += content[j]; - } - - return tmp; - } - if (content[i] == '\n') count++; - } - return wxEmptyString ; -} - -/* - * Text item - */ - -void wxTextCtrl::Command(wxCommandEvent & event) -{ - SetValue (event.GetString()); - ProcessCommand (event); -} - -void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) -{ - // By default, load the first file into the text window. - if (event.GetNumberOfFiles() > 0) - { - LoadFile(event.GetFiles()[0]); - } -} - -void wxTextCtrl::OnChar(wxKeyEvent& event) -{ - int key = event.GetKeyCode() ; - bool eat_key = false ; - - if ( key == 'c' && event.MetaDown() ) - { - if ( CanCopy() ) - Copy() ; - return ; - } - - if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB && - !( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) -/* && key != WXK_PRIOR && key != WXK_NEXT && key != WXK_HOME && key != WXK_END */ - ) - { - // eat it - return ; - } - - // assume that any key not processed yet is going to modify the control - m_dirty = true; - - if ( key == 'v' && event.MetaDown() ) - { - if ( CanPaste() ) - Paste() ; - return ; - } - if ( key == 'x' && event.MetaDown() ) - { - if ( CanCut() ) - Cut() ; - return ; - } - switch ( key ) - { - case WXK_RETURN: - if (m_windowStyle & wxPROCESS_ENTER) - { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); - event.SetEventObject( this ); - event.SetString( GetValue() ); - if ( GetEventHandler()->ProcessEvent(event) ) - return; - } - if ( !(m_windowStyle & wxTE_MULTILINE) ) - { - wxWindow *parent = GetParent(); - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) { - parent = parent->GetParent() ; - } - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - - // this will make wxWindows eat the ENTER key so that - // we actually prevent line wrapping in a single line - // text control - eat_key = TRUE; - } - - break; - - case WXK_TAB: - // always produce navigation event - even if we process TAB - // ourselves the fact that we got here means that the user code - // decided to skip processing of this TAB - probably to let it - // do its default job. - { - wxNavigationKeyEvent eventNav; - eventNav.SetDirection(!event.ShiftDown()); - eventNav.SetWindowChange(event.ControlDown()); - eventNav.SetEventObject(this); - - if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) ) - return; - - event.Skip() ; - return; - } - break; - } - - if (!eat_key) - { - // perform keystroke handling -#if TARGET_CARBON - if ( m_macUsesTXN && wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL ) - CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ; - else - { - EventRecord rec ; - if ( wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ) - { - EventRecord *ev = &rec ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; - } - } -#else - EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; -#endif - } - if ( ( key >= 0x20 && key < WXK_START ) || - key == WXK_RETURN || - key == WXK_DELETE || - key == WXK_BACK) - { - wxCommandEvent event1(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event1.SetString( GetValue() ) ; - event1.SetEventObject( this ); - wxPostEvent(GetEventHandler(),event1); - } -} - -void wxTextCtrl::MacSuperShown( bool show ) -{ - bool former = m_macControlIsShown ; - wxControl::MacSuperShown( show ) ; - if ( (former != m_macControlIsShown) && m_macUsesTXN ) - { - if ( m_macControlIsShown ) - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - else - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - } -} - -bool wxTextCtrl::Show(bool show) -{ - bool former = m_macControlIsShown ; - - bool retval = wxControl::Show( show ) ; - - if ( former != m_macControlIsShown && m_macUsesTXN ) - { - if ( m_macControlIsShown ) - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - else - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - } - - return retval ; -} - -// ---------------------------------------------------------------------------- -// standard handlers for standard edit menu events -// ---------------------------------------------------------------------------- - -void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event)) -{ - Cut(); -} - -void wxTextCtrl::OnCopy(wxCommandEvent& WXUNUSED(event)) -{ - Copy(); -} - -void wxTextCtrl::OnPaste(wxCommandEvent& WXUNUSED(event)) -{ - Paste(); -} - -void wxTextCtrl::OnUndo(wxCommandEvent& WXUNUSED(event)) -{ - Undo(); -} - -void wxTextCtrl::OnRedo(wxCommandEvent& WXUNUSED(event)) -{ - Redo(); -} - -void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent& event) -{ - event.Enable( CanCut() ); -} - -void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent& event) -{ - event.Enable( CanCopy() ); -} - -void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent& event) -{ - event.Enable( CanPaste() ); -} - -void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent& event) -{ - event.Enable( CanUndo() ); -} - -void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) -{ - event.Enable( CanRedo() ); -} - -bool wxTextCtrl::MacSetupCursor( const wxPoint& pt ) -{ - if ( m_macUsesTXN ) - return true ; - else - return wxWindow::MacSetupCursor( pt ) ; -} - -#endif - // wxUSE_TEXTCTRL diff --git a/src/mac/carbon/tglbtn.cpp b/src/mac/carbon/tglbtn.cpp deleted file mode 100644 index aa7ee2bb3e..0000000000 --- a/src/mac/carbon/tglbtn.cpp +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/tglbtn.cpp -// Purpose: Definition of the wxToggleButton class, which implements a -// toggle button under wxMac. -// Author: Stefan Csomor -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id$ -// Copyright: (c) 2000 Johnny C. Norris II -// License: Rocketeer license -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declatations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ -#pragma implementation "button.h" -#endif - -#include "wx/defs.h" -#include "wx/tglbtn.h" - -#if wxUSE_TOGGLEBTN - -#include "wx/mac/uma.h" -// Button - -static const int kMacOSXHorizontalBorder = 2 ; -static const int kMacOSXVerticalBorder = 4 ; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToggleButton -// ---------------------------------------------------------------------------- - -// Single check box item -bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - if ( UMAHasAquaLayout() ) - { - m_macHorizontalBorder = kMacOSXHorizontalBorder; - m_macVerticalBorder = kMacOSXVerticalBorder; - } - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , kControlBehaviorToggles , 1, - kControlBevelButtonNormalBevelProc , (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxSize wxToggleButton::DoGetBestSize() const -{ - int wBtn = 70 ; - int hBtn = 20 ; - - int lBtn = m_label.Length() * 8 + 12 ; - if (lBtn > wBtn) - wBtn = lBtn; - - if ( UMAHasAquaLayout() ) - { - wBtn += 2 * kMacOSXHorizontalBorder ; - hBtn += 2 * kMacOSXVerticalBorder ; - } - return wxSize ( wBtn , hBtn ) ; -} - -void wxToggleButton::SetValue(bool val) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ; -} - -bool wxToggleButton::GetValue() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxToggleButton::Command(wxCommandEvent & event) -{ - SetValue((event.GetInt() != 0)); - ProcessCommand(event); -} - -void wxToggleButton::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 controlpart , bool WXUNUSED(mouseStillDown) ) -{ - if ( controlpart != kControlNoPart ) - { - wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId); - event.SetInt(GetValue()); - event.SetEventObject(this); - ProcessCommand(event); - } -} - -#endif // wxUSE_TOGGLEBTN - diff --git a/src/mac/carbon/thread.cpp b/src/mac/carbon/thread.cpp deleted file mode 100644 index 5e322a719d..0000000000 --- a/src/mac/carbon/thread.cpp +++ /dev/null @@ -1,921 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: thread.cpp -// Purpose: wxThread Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), -// Vadim Zeitlin (1999) , Stefan Csomor (2000) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "thread.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#if wxUSE_THREADS - -#include "wx/module.h" -#include "wx/thread.h" - -#ifdef __WXMAC__ -#include -#include "wx/mac/uma.h" -#include "wx/mac/macnotfy.h" -#include -#endif - -#define INFINITE 0xFFFFFFFF - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the possible states of the thread ("=>" shows all possible transitions from -// this state) -enum wxThreadState -{ - STATE_NEW, // didn't start execution yet (=> RUNNING) - STATE_RUNNING, // thread is running (=> PAUSED, CANCELED) - STATE_PAUSED, // thread is temporarily suspended (=> RUNNING) - STATE_CANCELED, // thread should terminate a.s.a.p. (=> EXITED) - STATE_EXITED // thread is terminating -}; - -// ---------------------------------------------------------------------------- -// this module globals -// ---------------------------------------------------------------------------- - -static ThreadID gs_idMainThread = kNoThreadID ; -static bool gs_waitingForThread = FALSE ; -size_t g_numberOfThreads = 0; - -// ============================================================================ -// MacOS implementation of thread classes -// ============================================================================ - -class wxMacStCritical -{ -public : - wxMacStCritical() - { - if ( UMASystemIsInitialized() ) - ThreadBeginCritical() ; - } - ~wxMacStCritical() - { - if ( UMASystemIsInitialized() ) - ThreadEndCritical() ; - } -}; - -// ---------------------------------------------------------------------------- -// wxMutex implementation -// ---------------------------------------------------------------------------- - -class wxMutexInternal -{ -public: - wxMutexInternal(wxMutexType WXUNUSED(mutexType)) - { - m_owner = kNoThreadID ; - m_locked = 0; - } - - ~wxMutexInternal() - { - if ( m_locked > 0 ) - { - wxLogDebug(_T("Warning: freeing a locked mutex (%ld locks)."), m_locked); - } - } - - bool IsOk() const { return true; } - - wxMutexError Lock() ; - wxMutexError TryLock() ; - wxMutexError Unlock(); -public: - ThreadID m_owner ; - wxArrayLong m_waiters ; - long m_locked ; -}; - -wxMutexError wxMutexInternal::Lock() -{ - wxMacStCritical critical ; - if ( UMASystemIsInitialized() ) - { - OSErr err ; - ThreadID current = kNoThreadID; - err = ::MacGetCurrentThread(¤t); - // if we are not the owner, add this thread to the list of waiting threads, stop this thread - // and invoke the scheduler to continue executing the owner's thread - while ( m_owner != kNoThreadID && m_owner != current) - { - m_waiters.Add(current); - err = ::SetThreadStateEndCritical(kCurrentThreadID, kStoppedThreadState, m_owner); - err = ::ThreadBeginCritical(); - } - m_owner = current; - } - m_locked++; - - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutexInternal::TryLock() -{ - wxMacStCritical critical ; - if ( UMASystemIsInitialized() ) - { - ThreadID current = kNoThreadID; - ::MacGetCurrentThread(¤t); - // if we are not the owner, give an error back - if ( m_owner != kNoThreadID && m_owner != current ) - return wxMUTEX_BUSY; - - m_owner = current; - } - m_locked++; - - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutexInternal::Unlock() -{ - if ( UMASystemIsInitialized() ) - { - OSErr err; - err = ::ThreadBeginCritical(); - - if (m_locked > 0) - m_locked--; - - // this mutex is not owned by anybody anmore - m_owner = kNoThreadID; - - // now pass on to the first waiting thread - ThreadID firstWaiting = kNoThreadID; - bool found = false; - while (!m_waiters.IsEmpty() && !found) - { - firstWaiting = m_waiters[0]; - err = ::SetThreadState(firstWaiting, kReadyThreadState, kNoThreadID); - // in case this was not successful (dead thread), we just loop on and reset the id - found = (err != threadNotFoundErr); - if ( !found ) - firstWaiting = kNoThreadID ; - m_waiters.RemoveAt(0) ; - } - // now we have a valid firstWaiting thread, which has been scheduled to run next, just end the - // critical section and invoke the scheduler - err = ::SetThreadStateEndCritical(kCurrentThreadID, kReadyThreadState, firstWaiting); - } - else - { - if (m_locked > 0) - m_locked--; - } - return wxMUTEX_NO_ERROR; -} - -// -------------------------------------------------------------------------- -// wxSemaphore -// -------------------------------------------------------------------------- - -// TODO not yet implemented - -class wxSemaphoreInternal -{ -public: - wxSemaphoreInternal(int initialcount, int maxcount); - ~wxSemaphoreInternal(); - - bool IsOk() const { return true ; } - - wxSemaError Wait() { return WaitTimeout(INFINITE); } - wxSemaError TryWait() { return WaitTimeout(0); } - wxSemaError WaitTimeout(unsigned long milliseconds); - - wxSemaError Post(); - -private: -}; - -wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) -{ - if ( maxcount == 0 ) - { - // make it practically infinite - maxcount = INT_MAX; - } -} - -wxSemaphoreInternal::~wxSemaphoreInternal() -{ -} - -wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) -{ - return wxSEMA_MISC_ERROR; -} - -wxSemaError wxSemaphoreInternal::Post() -{ - return wxSEMA_MISC_ERROR; -} - -// ---------------------------------------------------------------------------- -// wxCondition implementation -// ---------------------------------------------------------------------------- - -// TODO this is not yet completed - -class wxConditionInternal -{ -public: - wxConditionInternal(wxMutex& mutex) : m_mutex(mutex) - { - m_excessSignals = 0 ; - } - ~wxConditionInternal() - { - } - - bool IsOk() const { return m_mutex.IsOk() ; } - - wxCondError Wait() - { - return WaitTimeout(0xFFFFFFFF ); - } - - wxCondError WaitTimeout(unsigned long msectimeout) - { - wxMacStCritical critical ; - if ( m_excessSignals > 0 ) - { - --m_excessSignals ; - return wxCOND_NO_ERROR ; - } - else if ( msectimeout == 0 ) - { - return wxCOND_MISC_ERROR ; - } - else - { - } - /* - waiters++; - - // FIXME this should be MsgWaitForMultipleObjects() as well probably - DWORD rc = ::WaitForSingleObject(event, timeout); - - waiters--; - - return rc != WAIT_TIMEOUT; - */ - return wxCOND_NO_ERROR ; - } - wxCondError Signal() - { - wxMacStCritical critical ; - return wxCOND_NO_ERROR; - } - - wxCondError Broadcast() - { - wxMacStCritical critical ; - return wxCOND_NO_ERROR; - } - - wxArrayLong m_waiters ; - wxInt32 m_excessSignals ; - wxMutex& m_mutex; -}; - -// ---------------------------------------------------------------------------- -// wxCriticalSection implementation -// ---------------------------------------------------------------------------- - -// it's implemented as a mutex on mac os, so it is defined in the headers - -// ---------------------------------------------------------------------------- -// wxThread implementation -// ---------------------------------------------------------------------------- - -// wxThreadInternal class -// ---------------------- - -class wxThreadInternal -{ -public: - wxThreadInternal() - { - m_tid = kNoThreadID ; - m_state = STATE_NEW; - m_priority = WXTHREAD_DEFAULT_PRIORITY; - } - - ~wxThreadInternal() - { - } - - void Free() - { - } - - // create a new (suspended) thread (for the given thread object) - bool Create(wxThread *thread, unsigned int stackSize); - - // suspend/resume/terminate - bool Suspend(); - bool Resume(); - void Cancel() { m_state = STATE_CANCELED; } - - // thread state - void SetState(wxThreadState state) { m_state = state; } - wxThreadState GetState() const { return m_state; } - - // thread priority - void SetPriority(unsigned int priority); - unsigned int GetPriority() const { return m_priority; } - - void SetResult( void *res ) { m_result = res ; } - void *GetResult() { return m_result ; } - - // thread handle and id - ThreadID GetId() const { return m_tid; } - - // thread function - static pascal void* MacThreadStart(wxThread* arg); - -private: - wxThreadState m_state; // state, see wxThreadState enum - unsigned int m_priority; // thread priority in "wx" units - ThreadID m_tid; // thread id - void* m_result; - static ThreadEntryUPP s_threadEntry ; -}; - -static wxArrayPtrVoid s_threads ; - -ThreadEntryUPP wxThreadInternal::s_threadEntry = NULL ; -pascal void* wxThreadInternal::MacThreadStart(wxThread *thread) -{ - // first of all, check whether we hadn't been cancelled already - if ( thread->m_internal->GetState() == STATE_EXITED ) - { - return (void*)-1; - } - - void* rc = thread->Entry(); - - // enter m_critsect before changing the thread state - thread->m_critsect.Enter(); - bool wasCancelled = thread->m_internal->GetState() == STATE_CANCELED; - thread->m_internal->SetState(STATE_EXITED); - thread->m_critsect.Leave(); - - thread->OnExit(); - - // if the thread was cancelled (from Delete()), then it the handle is still - // needed there - if ( thread->IsDetached() && !wasCancelled ) - { - // auto delete - delete thread; - } - //else: the joinable threads handle will be closed when Wait() is done - - return rc; -} -void wxThreadInternal::SetPriority(unsigned int priority) -{ - // Priorities don't exist on Mac -} - -bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) -{ - if ( s_threadEntry == NULL ) - { - s_threadEntry = NewThreadEntryUPP( (ThreadEntryProcPtr) MacThreadStart ) ; - } - OSErr err = NewThread( kCooperativeThread, - s_threadEntry, - (void*) thread, - stackSize, - kNewSuspend, - &m_result, - &m_tid ); - - if ( err != noErr ) - { - wxLogSysError(_("Can't create thread")); - return FALSE; - } - - if ( m_priority != WXTHREAD_DEFAULT_PRIORITY ) - { - SetPriority(m_priority); - } - - m_state = STATE_NEW; - - return TRUE; -} - -bool wxThreadInternal::Suspend() -{ - OSErr err ; - - ::ThreadBeginCritical(); - - if ( m_state != STATE_RUNNING ) - { - ::ThreadEndCritical() ; - wxLogSysError(_("Can not suspend thread %x"), m_tid); - return FALSE; - } - - m_state = STATE_PAUSED; - - err = ::SetThreadStateEndCritical(m_tid, kStoppedThreadState, kNoThreadID); - - return TRUE; -} - -bool wxThreadInternal::Resume() -{ - ThreadID current ; - OSErr err ; - err = MacGetCurrentThread( ¤t ) ; - - wxASSERT( err == noErr ) ; - wxASSERT( current != m_tid ) ; - - ::ThreadBeginCritical(); - if ( m_state != STATE_PAUSED && m_state != STATE_NEW ) - { - ::ThreadEndCritical() ; - wxLogSysError(_("Can not resume thread %x"), m_tid); - return FALSE; - - } - err = ::SetThreadStateEndCritical(m_tid, kReadyThreadState, kNoThreadID); - wxASSERT( err == noErr ) ; - - m_state = STATE_RUNNING; - ::ThreadEndCritical() ; - ::YieldToAnyThread() ; - return TRUE; -} - -// static functions -// ---------------- -wxThread *wxThread::This() -{ - wxMacStCritical critical ; - - ThreadID current ; - OSErr err ; - - err = MacGetCurrentThread( ¤t ) ; - - for ( size_t i = 0 ; i < s_threads.Count() ; ++i ) - { - if ( ( (wxThread*) s_threads[i] )->GetId() == current ) - return (wxThread*) s_threads[i] ; - } - - wxLogSysError(_("Couldn't get the current thread pointer")); - return NULL; -} - -bool wxThread::IsMain() -{ - ThreadID current ; - OSErr err ; - - err = MacGetCurrentThread( ¤t ) ; - return current == gs_idMainThread; -} - -#ifdef Yield -#undef Yield -#endif - -void wxThread::Yield() -{ - ::YieldToAnyThread() ; -} - -void wxThread::Sleep(unsigned long milliseconds) -{ - UnsignedWide start, now; - - Microseconds(&start); - - double mssleep = milliseconds * 1000 ; - double msstart, msnow ; - msstart = (start.hi * 4294967296.0 + start.lo) ; - - do - { - YieldToAnyThread(); - Microseconds(&now); - msnow = (now.hi * 4294967296.0 + now.lo) ; - } while( msnow - msstart < mssleep ); -} - -int wxThread::GetCPUCount() -{ - // we will use whatever MP API will be used for the new MP Macs - return 1; -} - -unsigned long wxThread::GetCurrentId() -{ - ThreadID current ; - MacGetCurrentThread( ¤t ) ; - return (unsigned long)current; -} - -bool wxThread::SetConcurrency(size_t level) -{ - wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); - - // ok only for the default one - if ( level == 0 ) - return 0; - - // how many CPUs have we got? - if ( GetCPUCount() == 1 ) - { - // don't bother with all this complicated stuff - on a single - // processor system it doesn't make much sense anyhow - return level == 1; - } - - return TRUE ; -} - -// ctor and dtor -// ------------- - -wxThread::wxThread(wxThreadKind kind) -{ - g_numberOfThreads++; - m_internal = new wxThreadInternal(); - - m_isDetached = kind == wxTHREAD_DETACHED; - s_threads.Add( (void*) this ) ; -} - -wxThread::~wxThread() -{ - if (g_numberOfThreads>0) - { - g_numberOfThreads--; - } -#ifdef __WXDEBUG__ - else - { - wxFAIL_MSG(wxT("More threads deleted than created.")); - } -#endif - - s_threads.Remove( (void*) this ) ; - if (m_internal != NULL) { - delete m_internal; - m_internal = NULL; - } -} - -// create/start thread -// ------------------- - -wxThreadError wxThread::Create(unsigned int stackSize) -{ - wxCriticalSectionLocker lock(m_critsect); - - if ( !m_internal->Create(this, stackSize) ) - return wxTHREAD_NO_RESOURCE; - - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Run() -{ - wxCriticalSectionLocker lock(m_critsect); - - if ( m_internal->GetState() != STATE_NEW ) - { - // actually, it may be almost any state at all, not only STATE_RUNNING - return wxTHREAD_RUNNING; - } - - // the thread has just been created and is still suspended - let it run - return Resume(); -} - -// suspend/resume thread -// --------------------- - -wxThreadError wxThread::Pause() -{ - wxCriticalSectionLocker lock(m_critsect); - - return m_internal->Suspend() ? wxTHREAD_NO_ERROR : wxTHREAD_MISC_ERROR; -} - -wxThreadError wxThread::Resume() -{ - wxCriticalSectionLocker lock(m_critsect); - - return m_internal->Resume() ? wxTHREAD_NO_ERROR : wxTHREAD_MISC_ERROR; -} - -// stopping thread -// --------------- - -wxThread::ExitCode wxThread::Wait() -{ - // although under MacOS we can wait for any thread, it's an error to - // wait for a detached one in wxWin API - wxCHECK_MSG( !IsDetached(), (ExitCode)-1, - _T("can't wait for detached thread") ); - - ExitCode rc = (ExitCode)-1; - - (void)Delete(&rc); - - m_internal->Free(); - - return rc; -} - -wxThreadError wxThread::Delete(ExitCode *pRc) -{ - ExitCode rc = 0; - - // Delete() is always safe to call, so consider all possible states - - // has the thread started to run? - bool shouldResume = FALSE; - - { - wxCriticalSectionLocker lock(m_critsect); - - if ( m_internal->GetState() == STATE_NEW ) - { - // WinThreadStart() will see it and terminate immediately - m_internal->SetState(STATE_EXITED); - - shouldResume = TRUE; - } - } - - // is the thread paused? - if ( shouldResume || IsPaused() ) - Resume(); - - // does is still run? - if ( IsRunning() ) - { - if ( IsMain() ) - { - // set flag for wxIsWaitingForThread() - gs_waitingForThread = TRUE; - -#if wxUSE_GUI - wxBeginBusyCursor(); -#endif // wxUSE_GUI - } - - // ask the thread to terminate - { - wxCriticalSectionLocker lock(m_critsect); - - m_internal->Cancel(); - } - -#if wxUSE_GUI - // simply wait for the thread to terminate - while( TestDestroy() ) - { - ::YieldToAnyThread() ; - } -#else // !wxUSE_GUI - // simply wait for the thread to terminate - while( TestDestroy() ) - { - ::YieldToAnyThread() ; - } -#endif // wxUSE_GUI/!wxUSE_GUI - - if ( IsMain() ) - { - gs_waitingForThread = FALSE; - -#if wxUSE_GUI - wxEndBusyCursor(); -#endif // wxUSE_GUI - } - } - - if ( IsDetached() ) - { - // if the thread exits normally, this is done in WinThreadStart, but in - // this case it would have been too early because - // MsgWaitForMultipleObject() would fail if the therad handle was - // closed while we were waiting on it, so we must do it here - delete this; - } - - if ( pRc ) - *pRc = rc; - - return rc == (ExitCode)-1 ? wxTHREAD_MISC_ERROR : wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Kill() -{ - if ( !IsRunning() ) - return wxTHREAD_NOT_RUNNING; - -// if ( !::TerminateThread(m_internal->GetHandle(), (DWORD)-1) ) - { - wxLogSysError(_("Couldn't terminate thread")); - - return wxTHREAD_MISC_ERROR; - } - - m_internal->Free(); - - if ( IsDetached() ) - { - delete this; - } - - return wxTHREAD_NO_ERROR; -} - -void wxThread::Exit(ExitCode status) -{ - m_internal->Free(); - - if ( IsDetached() ) - { - delete this; - } - - m_internal->SetResult( status ) ; - -/* -#if defined(__VISUALC__) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) - _endthreadex((unsigned)status); -#else // !VC++ - ::ExitThread((DWORD)status); -#endif // VC++/!VC++ -*/ - wxFAIL_MSG(wxT("Couldn't return from ExitThread()!")); -} - -// priority setting -// ---------------- - -// since all these calls are execute cooperatively we don't have to use the critical section - -void wxThread::SetPriority(unsigned int prio) -{ - m_internal->SetPriority(prio); -} - -unsigned int wxThread::GetPriority() const -{ - return m_internal->GetPriority(); -} - -unsigned long wxThread::GetId() const -{ - return (unsigned long)m_internal->GetId(); -} - -bool wxThread::IsRunning() const -{ - return m_internal->GetState() == STATE_RUNNING; -} - -bool wxThread::IsAlive() const -{ - return (m_internal->GetState() == STATE_RUNNING) || - (m_internal->GetState() == STATE_PAUSED); -} - -bool wxThread::IsPaused() const -{ - return m_internal->GetState() == STATE_PAUSED; -} - -bool wxThread::TestDestroy() -{ - return m_internal->GetState() == STATE_CANCELED; -} - -// ---------------------------------------------------------------------------- -// Automatic initialization for thread module -// ---------------------------------------------------------------------------- - -class wxThreadModule : public wxModule -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxThreadModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) - -bool wxThreadModule::OnInit() -{ - long response; - bool hasThreadManager ; - hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1; -#if !TARGET_CARBON -#if GENERATINGCFM - // verify presence of shared library - hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress); -#endif -#endif - if ( !hasThreadManager ) - { - wxLogSysError( wxT("Thread Support is not available on this System") ); - return FALSE ; - } - - // no error return for GetCurrentThreadId() - MacGetCurrentThread( &gs_idMainThread ) ; - - return TRUE; -} - -void wxThreadModule::OnExit() -{ -} - -// ---------------------------------------------------------------------------- -// under MacOS we don't have currently preemptive threads, so any thread may access -// the GUI at any time -// ---------------------------------------------------------------------------- - -void WXDLLEXPORT wxMutexGuiEnter() -{ -} - -void WXDLLEXPORT wxMutexGuiLeave() -{ -} - -void WXDLLEXPORT wxMutexGuiLeaveOrEnter() -{ -} - -bool WXDLLEXPORT wxGuiOwnedByMainThread() -{ - return false ; -} - -// wake up the main thread -void WXDLLEXPORT wxWakeUpMainThread() -{ - wxMacWakeUp() ; -} - -bool WXDLLEXPORT wxIsWaitingForThread() -{ - return false ; -} - -#include "wx/thrimpl.cpp" - -#endif // wxUSE_THREADS diff --git a/src/mac/carbon/timer.cpp b/src/mac/carbon/timer.cpp deleted file mode 100644 index a639e2c464..0000000000 --- a/src/mac/carbon/timer.cpp +++ /dev/null @@ -1,143 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp -// Purpose: wxTimer implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "timer.h" -#endif - -#include "wx/timer.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) -#endif - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#endif -#ifndef __DARWIN__ -#include -#endif - -#include "wx/dynarray.h" - -typedef struct MacTimerInfo -{ - TMTask m_task; - wxMacNotifierTableRef m_table ; - wxTimer* m_timer ; -} ; - -static void wxProcessTimer( unsigned long event , void *data ) ; - -static pascal void MacTimerProc( TMTask * t ) -{ - MacTimerInfo * tm = (MacTimerInfo*) t ; - wxMacAddEvent( tm->m_table , wxProcessTimer, 0 , (void*) tm->m_timer , TRUE ) ; -} - -// we need this array to track timers that are being deleted within the Notify procedure -// adding the timer before the Notify call and checking after whether it still is in there -// as the destructor would have removed it from the array - -wxArrayPtrVoid gTimersInProcess ; - -static void wxProcessTimer( unsigned long event , void *data ) -{ - if ( !data ) - return ; - - wxTimer* timer = (wxTimer*) data ; - - if ( timer->IsOneShot() ) - timer->Stop() ; - - gTimersInProcess.Add( timer ) ; - - timer->Notify(); - - int index = gTimersInProcess.Index( timer ) ; - - if ( index != wxNOT_FOUND ) - { - gTimersInProcess.RemoveAt( index ) ; - - if ( !timer->IsOneShot() && timer->m_info->m_task.tmAddr ) - { - PrimeTime( (QElemPtr) &timer->m_info->m_task , timer->GetInterval() ) ; - } - - } -} - -void wxTimer::Init() -{ - m_info = new MacTimerInfo() ; - m_info->m_task.tmAddr = NULL ; - m_info->m_task.tmWakeUp = 0 ; - m_info->m_task.tmReserved = 0 ; - m_info->m_task.qType = 0 ; - m_info->m_table = wxMacGetNotifierTable() ; - m_info->m_timer = this ; -} - -bool wxTimer::IsRunning() const -{ - // as the qType may already indicate it is elapsed, but it - // was not handled internally yet - return ( m_info->m_task.tmAddr != NULL ) ; -} - -wxTimer::~wxTimer() -{ - Stop(); - if (m_info != NULL) { - delete m_info ; - m_info = NULL ; - } - int index = gTimersInProcess.Index( this ) ; - if ( index != wxNOT_FOUND ) - gTimersInProcess.RemoveAt( index ) ; -} - -bool wxTimer::Start(int milliseconds,bool mode) -{ - (void)wxTimerBase::Start(milliseconds, mode); - - wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeout") ); - wxCHECK_MSG( m_info->m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") ); - -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ; -#else - m_info->m_task.tmAddr = NewTimerProc( MacTimerProc ) ; -#endif - m_info->m_task.tmWakeUp = 0 ; - m_info->m_task.tmReserved = 0 ; - m_info->m_task.qType = 0 ; - m_info->m_timer = this ; - InsXTime((QElemPtr) &m_info->m_task ) ; - PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ; - return TRUE; -} - -void wxTimer::Stop() -{ - if ( m_info->m_task.tmAddr ) - { - RmvTime( (QElemPtr) &m_info->m_task ) ; - DisposeTimerUPP(m_info->m_task.tmAddr) ; - m_info->m_task.tmAddr = NULL ; - } - wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable() , this ) ; -} - - - diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp deleted file mode 100644 index d8bdac1326..0000000000 --- a/src/mac/carbon/toolbar.cpp +++ /dev/null @@ -1,620 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.cpp -// Purpose: wxToolBar -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: The wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "toolbar.h" -#endif - -#include "wx/wx.h" - -#if wxUSE_TOOLBAR - -#include "wx/toolbar.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/bitmap.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) - -BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) - EVT_MOUSE_EVENTS( wxToolBar::OnMouse ) - EVT_PAINT( wxToolBar::OnPaint ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" -#include "wx/geometry.h" -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxToolBarTool : public wxToolBarToolBase -{ -public: - wxToolBarTool(wxToolBar *tbar, - int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) ; - - wxToolBarTool(wxToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) - { - Init() ; - } - - ~wxToolBarTool() - { - if ( m_controlHandle ) - DisposeControl( m_controlHandle ) ; - } - - ControlHandle GetControlHandle() { return m_controlHandle ; } - void SetControlHandle( ControlHandle handle ) { m_controlHandle = handle ; } - - void SetSize(const wxSize& size) ; - void SetPosition( const wxPoint& position ) ; - wxSize GetSize() const - { - if ( IsControl() ) - { - return GetControl()->GetSize() ; - } - else if ( IsButton() ) - { - return GetToolBar()->GetToolSize() ; - } - else - { - wxSize sz = GetToolBar()->GetToolSize() ; - sz.x /= 4 ; - sz.y /= 4 ; - return sz ; - } - } - wxPoint GetPosition() const - { - return wxPoint(m_x, m_y); - } -private : - void Init() - { - m_controlHandle = NULL ; - } - ControlHandle m_controlHandle ; - - wxCoord m_x; - wxCoord m_y; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToolBarTool -// ---------------------------------------------------------------------------- - -void wxToolBarTool::SetSize(const wxSize& size) -{ - if ( IsControl() ) - { - GetControl()->SetSize( size ) ; - } -} - -void wxToolBarTool::SetPosition(const wxPoint& position) -{ - m_x = position.x; - m_y = position.y; - - if ( IsButton() ) - { - int x , y ; - x = y = 0 ; - WindowRef rootwindow = (WindowRef) GetToolBar()->MacGetRootWindow() ; - GetToolBar()->MacWindowToRootWindow( &x , &y ) ; - int mac_x = x + position.x ; - int mac_y = y + position.y ; - - - Rect contrlRect ; - GetControlBounds( m_controlHandle , &contrlRect ) ; - int former_mac_x = contrlRect.left ; - int former_mac_y = contrlRect.top ; - wxSize sz = GetToolBar()->GetToolSize() ; - - if ( mac_x != former_mac_x || mac_y != former_mac_y ) - { - { - Rect inval = { former_mac_y , former_mac_x , former_mac_y + sz.y , former_mac_x + sz.x } ; - InvalWindowRect( rootwindow , &inval ) ; - } - UMAMoveControl( m_controlHandle , mac_x , mac_y ) ; - { - Rect inval = { mac_y , mac_x , mac_y + sz.y , mac_x + sz.x } ; - InvalWindowRect( rootwindow , &inval ) ; - } - } - } - else if ( IsControl() ) - { - GetControl()->Move( position ) ; - } -} - -const short kwxMacToolBarToolDefaultWidth = 24 ; -const short kwxMacToolBarToolDefaultHeight = 22 ; -const short kwxMacToolBarTopMargin = 2 ; -const short kwxMacToolBarLeftMargin = 2 ; - -wxToolBarTool::wxToolBarTool(wxToolBar *tbar, - int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) - : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp) -{ - Init(); - - if (id == wxID_SEPARATOR) return; - - WindowRef window = (WindowRef) tbar->MacGetRootWindow() ; - wxSize toolSize = tbar->GetToolSize() ; - Rect toolrect = { 0, 0 , toolSize.y , toolSize.x } ; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , GetNormalBitmap() ) ; - - SInt16 behaviour = kControlBehaviorOffsetContents ; - if ( CanBeToggled() ) - behaviour += kControlBehaviorToggles ; - - if ( info.contentType != kControlNoContent ) - { - m_controlHandle = ::NewControl( window , &toolrect , "\p" , false , 0 , - behaviour + info.contentType , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ; - - ::SetControlData( m_controlHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } - else - { - m_controlHandle = ::NewControl( window , &toolrect , "\p" , false , 0 , - behaviour , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ; - } - UMAShowControl( m_controlHandle ) ; - if ( !IsEnabled() ) - { - UMADeactivateControl( m_controlHandle ) ; - } - if ( CanBeToggled() && IsToggled() ) - { - ::SetControl32BitValue( m_controlHandle , 1 ) ; - } - else - { - ::SetControl32BitValue( m_controlHandle , 0 ) ; - } - - ControlHandle container = (ControlHandle) tbar->MacGetContainerForEmbedding() ; - wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; - ::EmbedControl( m_controlHandle , container ) ; -} - - -wxToolBarToolBase *wxToolBar::CreateTool(int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) -{ - return new wxToolBarTool(this, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp); -} - -wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control) -{ - return new wxToolBarTool(this, control); -} - -void wxToolBar::Init() -{ - m_maxWidth = -1; - m_maxHeight = -1; - m_defaultWidth = kwxMacToolBarToolDefaultWidth; - m_defaultHeight = kwxMacToolBarToolDefaultHeight; -} - -bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - - if (width <= 0) - width = 100; - if (height <= 0) - height = 30; - if (x < 0) - x = 0; - if (y < 0) - y = 0; - - SetName(name); - - m_windowStyle = style; - parent->AddChild(this); - - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - - if (id == -1) - m_windowId = NewControlId(); - else - m_windowId = id; - - { - m_width = size.x ; - m_height = size.y ; - int x = pos.x ; - int y = pos.y ; - AdjustForParentClientOrigin(x, y, wxSIZE_USE_EXISTING); - m_x = x ; - m_y = y ; - } - - return TRUE; -} - -wxToolBar::~wxToolBar() -{ - // we must refresh the frame size when the toolbar is deleted but the frame - // is not - otherwise toolbar leaves a hole in the place it used to occupy -} - -bool wxToolBar::Realize() -{ - if (m_tools.GetCount() == 0) - return FALSE; - - int x = m_xMargin + kwxMacToolBarLeftMargin ; - int y = m_yMargin + kwxMacToolBarTopMargin ; - - int tw, th; - GetSize(& tw, & th); - - int maxWidth = 0 ; - int maxHeight = 0 ; - - int maxToolWidth = 0; - int maxToolHeight = 0; - - // Find the maximum tool width and height - wxToolBarToolsList::Node *node = m_tools.GetFirst(); - while ( node ) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData(); - wxSize sz = tool->GetSize() ; - - if ( sz.x > maxToolWidth ) - maxToolWidth = sz.x ; - if (sz.y> maxToolHeight) - maxToolHeight = sz.y; - - node = node->GetNext(); - } - - node = m_tools.GetFirst(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData(); - wxSize cursize = tool->GetSize() ; - - // for the moment we just do a single row/column alignement - if ( x + cursize.x > maxWidth ) - maxWidth = x + cursize.x ; - if ( y + cursize.y > maxHeight ) - maxHeight = y + cursize.y ; - - tool->SetPosition( wxPoint( x , y ) ) ; - - if ( GetWindowStyleFlag() & wxTB_VERTICAL ) - { - y += cursize.y ; - } - else - { - x += cursize.x ; - } - - node = node->GetNext(); - } - - if ( GetWindowStyleFlag() & wxTB_HORIZONTAL ) - { - if ( m_maxRows == 0 ) - { - // if not set yet, only one row - SetRows(1); - } - maxWidth = tw ; - maxHeight += m_yMargin + kwxMacToolBarTopMargin; - m_maxHeight = maxHeight ; - } - else - { - if ( GetToolsCount() > 0 && m_maxRows == 0 ) - { - // if not set yet, have one column - SetRows(GetToolsCount()); - } - maxHeight = th ; - maxWidth += m_xMargin + kwxMacToolBarLeftMargin; - m_maxWidth = maxWidth ; - } - - SetSize(maxWidth, maxHeight); - - return TRUE; -} - -void wxToolBar::SetToolBitmapSize(const wxSize& size) -{ - m_defaultWidth = size.x+4; m_defaultHeight = size.y+4; -} - -// The button size is bigger than the bitmap size -wxSize wxToolBar::GetToolSize() const -{ - return wxSize(m_defaultWidth + 4, m_defaultHeight + 4); -} - -void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarTool* tool = (wxToolBarTool*) node->GetData() ; - if ( tool->IsButton() ) - { - if( tool->GetControlHandle() == control ) - { - if ( tool->CanBeToggled() ) - { - tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ; - } - OnLeftClick( tool->GetId() , tool -> IsToggled() ) ; - break ; - } - } - } -} - -void wxToolBar::SetRows(int nRows) -{ - if ( nRows == m_maxRows ) - { - // avoid resizing the frame uselessly - return; - } - - m_maxRows = nRows; -} - -void wxToolBar::MacSuperChangedPosition() -{ - wxWindow::MacSuperChangedPosition() ; - Realize() ; -} - -wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const -{ - wxToolBarToolsList::Node *node = m_tools.GetFirst(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData() ; - wxRect2DInt r( tool->GetPosition() , tool->GetSize() ) ; - if ( r.Contains( wxPoint( x , y ) ) ) - { - return tool; - } - - node = node->GetNext(); - } - - return (wxToolBarToolBase *)NULL; -} - -wxString wxToolBar::MacGetToolTipString( wxPoint &pt ) -{ - wxToolBarToolBase* tool = FindToolForPosition( pt.x , pt.y ) ; - if ( tool ) - { - return tool->GetShortHelp() ; - } - return wxEmptyString ; -} - -void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable) -{ - if (!IsShown()) - return ; - - wxToolBarTool *tool = (wxToolBarTool *)t; - if ( tool->IsControl() ) - { - tool->GetControl()->Enable( enable ) ; - } - else if ( tool->IsButton() ) - { - if ( enable ) - UMAActivateControl( tool->GetControlHandle() ) ; - else - UMADeactivateControl( tool->GetControlHandle() ) ; - } -} - -void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) -{ - if (!IsShown()) - return ; - - wxToolBarTool *tool = (wxToolBarTool *)t; - if ( tool->IsButton() ) - { - ::SetControl32BitValue( tool->GetControlHandle() , toggle ) ; - } -} - -bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), - wxToolBarToolBase *tool) -{ - // nothing special to do here - we relayout in Realize() later - tool->Attach(this); - - return TRUE; -} - -void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) -{ - wxFAIL_MSG( _T("not implemented") ); -} - -bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) -{ - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarToolBase *tool2 = node->GetData(); - if ( tool2 == tool ) - { - // let node point to the next node in the list - node = node->GetNext(); - - break; - } - } - - wxSize sz = ((wxToolBarTool*)tool)->GetSize() ; - - tool->Detach(); - - // and finally reposition all the controls after this one - - for ( /* node -> first after deleted */ ; node; node = node->GetNext() ) - { - wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData(); - wxPoint pt = tool2->GetPosition() ; - - if ( GetWindowStyleFlag() & wxTB_VERTICAL ) - { - pt.y -= sz.y ; - } - else - { - pt.x -= sz.x ; - } - tool2->SetPosition( pt ) ; - } - - return TRUE ; -} - -void wxToolBar::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - Rect toolbarrect = { dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) , - dc.YLOG2DEVMAC(m_height) , dc.XLOG2DEVMAC(m_width) } ; - UMADrawThemePlacard( &toolbarrect , IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; - { - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarTool* tool = (wxToolBarTool*) node->GetData() ; - if ( tool->IsButton() ) - { - UMADrawControl( tool->GetControlHandle() ) ; - } - } - } -} - -void wxToolBar::OnMouse( wxMouseEvent &event ) -{ - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - WindowRef window = (WindowRef) MacGetRootWindow() ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - - controlpart = ::FindControl( localwhere , window , &control ) ; - { - if ( control && ::IsControlActive( control ) ) - { - { - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; - wxTheApp->s_lastMouseDown = 0 ; - if ( control && controlpart != kControlNoPart ) // otherwise we will get the event twice - { - MacHandleControlClick( control , controlpart , false /* not down anymore */ ) ; - } - } - } - } - } -} - -#endif // wxUSE_TOOLBAR - diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp deleted file mode 100644 index f269196711..0000000000 --- a/src/mac/carbon/tooltip.cpp +++ /dev/null @@ -1,408 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tooltip.cpp -// Purpose: wxToolTip implementation -// Author: Robert Roebling -// Id: $Id$ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "tooltip.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_TOOLTIPS - -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/window.h" -#include "wx/tooltip.h" -#include "wx/timer.h" -#include "wx/geometry.h" -#include "wx/mac/uma.h" - -//----------------------------------------------------------------------------- -// global data -//----------------------------------------------------------------------------- - -class wxMacToolTipTimer ; - -class wxMacToolTip -{ - public : - wxMacToolTip( ) ; - ~wxMacToolTip() ; - - void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ; - long GetMark() { return m_mark ; } - void Draw() ; - void Clear() ; - bool IsShown() { return m_shown ; } - private : - - wxString m_label ; - wxPoint m_position ; - Rect m_rect ; - WindowRef m_window ; - PicHandle m_backpict ; - bool m_shown ; - long m_mark ; - wxMacToolTipTimer* m_timer ; -#if TARGET_CARBON - wxMacCFStringHolder m_helpTextRef ; -#endif -} ; - -class wxMacToolTipTimer : public wxTimer -{ -public: - wxMacToolTipTimer() {} ; - wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; - virtual ~wxMacToolTipTimer() {} ; - void Notify() - { - if ( m_mark == m_tip->GetMark() ) - m_tip->Draw() ; - } -protected: - wxMacToolTip* m_tip; - long m_mark ; -}; - -//----------------------------------------------------------------------------- -// wxToolTip -//----------------------------------------------------------------------------- -static long s_ToolTipDelay = 500 ; -static bool s_ShowToolTips = true ; -static wxMacToolTip s_ToolTip ; -static wxWindow* s_LastWindowEntered = NULL ; -static wxRect2DInt s_ToolTipArea ; -static WindowRef s_ToolTipWindowRef = NULL ; - -IMPLEMENT_ABSTRACT_CLASS(wxToolTip, wxObject) - -wxToolTip::wxToolTip( const wxString &tip ) -{ - m_text = tip; - m_window = (wxWindow*) NULL; -} - -wxToolTip::~wxToolTip() -{ -} - -void wxToolTip::SetTip( const wxString &tip ) -{ - m_text = tip; - - if ( m_window ) - { - /* - // update it immediately - wxToolInfo ti(GetHwndOf(m_window)); - ti.lpszText = (wxChar *)m_text.c_str(); - - (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti); - */ - } -} - -void wxToolTip::SetWindow( wxWindow *win ) -{ - m_window = win ; -} - -void wxToolTip::Enable( bool flag ) -{ - if ( s_ShowToolTips != flag ) - { - s_ShowToolTips = flag ; - if ( s_ShowToolTips ) - { - } - else - { - s_ToolTip.Clear() ; - } - } -} - -void wxToolTip::SetDelay( long msecs ) -{ - s_ToolTipDelay = msecs ; -} - -void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) -{ - if ( s_ShowToolTips ) - { - if ( event.GetEventType() == wxEVT_LEAVE_WINDOW ) - { - s_ToolTip.Clear() ; - } - else if (event.GetEventType() == wxEVT_ENTER_WINDOW || event.GetEventType() == wxEVT_MOTION ) - { - wxPoint2DInt where( event.m_x , event.m_y ) ; - if ( s_LastWindowEntered == win && s_ToolTipArea.Contains( where ) ) - { - } - else - { - s_ToolTip.Clear() ; - s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ; - s_LastWindowEntered = win ; - - WindowRef window = MAC_WXHWND( win->MacGetRootWindow() ) ; - int x = event.m_x ; - int y = event.m_y ; - wxPoint local( x , y ) ; - win->MacClientToRootWindow( &x, &y ) ; - wxPoint windowlocal( x , y ) ; - s_ToolTip.Setup( window , win->MacGetToolTipString( local ) , windowlocal ) ; - } - } - } -} - -void wxToolTip::RemoveToolTips() -{ - s_ToolTip.Clear() ; -} -// --- mac specific - -wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec ) -{ - m_tip = tip; - m_mark = tip->GetMark() ; - Start(msec, true); -} - -wxMacToolTip::wxMacToolTip() -{ - m_window = NULL ; - m_backpict = NULL ; - m_mark = 0 ; - m_shown = false ; - m_timer = NULL ; -} - -void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition ) -{ - m_mark++ ; - Clear() ; - m_position = localPosition ; - m_label = text ; - m_window =win; - s_ToolTipWindowRef = m_window ; - m_backpict = NULL ; - if ( m_timer ) - delete m_timer ; - m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ; -} - -wxMacToolTip::~wxMacToolTip() -{ - if ( m_timer ) { - delete m_timer ; - m_timer = NULL; - } - if ( m_backpict ) - Clear() ; -} - -const short kTipBorder = 2 ; -const short kTipOffset = 5 ; - -void wxMacToolTip::Draw() -{ - if ( m_label.Length() == 0 ) - return ; - - if ( m_window == s_ToolTipWindowRef ) - { - m_shown = true ; -#if TARGET_CARBON - HMHelpContentRec tag ; - tag.version = kMacHelpVersion; - SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ; - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort(m_window) ; - LocalToGlobal( (Point *) &tag.absHotRect.top ); - LocalToGlobal( (Point *) &tag.absHotRect.bottom ); - SetPort( port ); - m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ; - tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; - tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; - tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ; - tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ; - tag.tagSide = kHMDefaultSide; - HMDisplayTag( &tag ); -#else - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) ); - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - - TextFont( fontId ) ; - TextSize( fontSize ) ; - TextFace( fontStyle ) ; - FontInfo fontInfo; - ::GetFontInfo(&fontInfo); - short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading; - short height = 0 ; - - int i = 0 ; - int length = m_label.Length() ; - int width = 0 ; - int thiswidth = 0 ; - int laststop = 0 ; - wxCharBuffer text = m_label.mb_str( wxConvLocal) ; - - while( i < length ) - { - if( text[i] == 13 || text[i] == 10) - { - thiswidth = ::TextWidth( text , laststop , i - laststop ) ; - if ( thiswidth > width ) - width = thiswidth ; - - height += lineh ; - laststop = i+1 ; - } - i++ ; - } - if ( i - laststop > 0 ) - { - thiswidth = ::TextWidth( text , laststop , i - laststop ) ; - if ( thiswidth > width ) - width = thiswidth ; - height += lineh ; - } - - m_rect.left = m_position.x + kTipOffset; - m_rect.top = m_position.y + kTipOffset; - m_rect.right = m_rect.left + width + 2 * kTipBorder; - - m_rect.bottom = m_rect.top + height + 2 * kTipBorder; - Rect r ; - GetPortBounds( GetWindowPort( m_window ) , &r ) ; - if ( m_rect.top < 0 ) - { - m_rect.bottom += -m_rect.top ; - m_rect.top = 0 ; - } - if ( m_rect.left < 0 ) - { - m_rect.right += -m_rect.left ; - m_rect.left = 0 ; - } - if ( m_rect.right > r.right ) - { - m_rect.left -= (m_rect.right - r.right ) ; - m_rect.right = r.right ; - } - if ( m_rect.bottom > r.bottom ) - { - m_rect.top -= (m_rect.bottom - r.bottom) ; - m_rect.bottom = r.bottom ; - } - ClipRect( &m_rect ) ; - BackColor( whiteColor ) ; - ForeColor(blackColor ) ; - GWorldPtr port ; - NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ; - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( port , NULL ) ; - - m_backpict = OpenPicture(&m_rect); - - CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)), - GetPortBitMapForCopyBits(port), - &m_rect, - &m_rect, - srcCopy, - NULL); - ClosePicture(); - SetGWorld( origPort , origDevice ) ; - DisposeGWorld( port ) ; - PenNormal() ; - - RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ; - BackColor( whiteColor ) ; - RGBForeColor( &tooltipbackground ) ; - - PaintRect( &m_rect ) ; - ForeColor(blackColor ) ; - FrameRect( &m_rect ) ; - SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ; - ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder); - - i = 0 ; - laststop = 0 ; - height = 0 ; - - while( i < length ) - { - if( text[i] == 13 || text[i] == 10) - { - ::DrawText( text , laststop , i - laststop ) ; - height += lineh ; - ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height ); - laststop = i+1 ; - } - i++ ; - } - ::DrawText( text , laststop , i - laststop ) ; - ::TextMode( srcOr ) ; -#endif - } -} - -void wxToolTip::NotifyWindowDelete( WXHWND win ) -{ - if ( win == s_ToolTipWindowRef ) - { - s_ToolTipWindowRef = NULL ; - } -} - -void wxMacToolTip::Clear() -{ - m_mark++ ; - if ( m_timer ) - { - delete m_timer ; - m_timer = NULL ; - } - if ( !m_shown ) - return ; -#if TARGET_CARBON - HMHideTag() ; - m_helpTextRef.Release() ; -#else - if ( m_window == s_ToolTipWindowRef && m_backpict ) - { - wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ; - - m_shown = false ; - - BackColor( whiteColor ) ; - ForeColor(blackColor ) ; - DrawPicture(m_backpict, &m_rect); - KillPicture(m_backpict); - m_backpict = NULL ; - } -#endif -} - -#endif - diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp deleted file mode 100644 index 878c27f2a9..0000000000 --- a/src/mac/carbon/toplevel.cpp +++ /dev/null @@ -1,1463 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/toplevel.cpp -// Purpose: implements wxTopLevelWindow for Mac -// Author: Stefan Csomor -// Modified by: -// Created: 24.09.01 -// RCS-ID: $Id$ -// Copyright: (c) 2001-2004 Stefan Csomor -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "toplevel.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" - #include "wx/toplevel.h" - #include "wx/frame.h" - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include "wx/mac/uma.h" -#include "wx/mac/aga.h" -#include "wx/app.h" -#include "wx/tooltip.h" -#include "wx/dnd.h" -#if wxUSE_SYSTEM_OPTIONS - #include "wx/sysopt.h" -#endif - -#include - - -#define wxMAC_DEBUG_REDRAW 0 -#ifndef wxMAC_DEBUG_REDRAW -#define wxMAC_DEBUG_REDRAW 0 -#endif - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -// list of all frames and modeless dialogs -wxWindowList wxModelessWindows; - -// double click testing -static Point gs_lastWhere; -static long gs_lastWhen = 0; - - -#if TARGET_CARBON -static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param); -#endif - -// ============================================================================ -// wxTopLevelWindowMac implementation -// ============================================================================ - -// --------------------------------------------------------------------------- -// Carbon Events -// --------------------------------------------------------------------------- - -#if TARGET_CARBON - -extern long wxMacTranslateKey(unsigned char key, unsigned char code) ; - -static const EventTypeSpec eventList[] = -{ - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } , - - { kEventClassKeyboard, kEventRawKeyDown } , - { kEventClassKeyboard, kEventRawKeyRepeat } , - { kEventClassKeyboard, kEventRawKeyUp } , - { kEventClassKeyboard, kEventRawKeyModifiersChanged } , - - { kEventClassWindow , kEventWindowShown } , - { kEventClassWindow , kEventWindowUpdate } , - { kEventClassWindow , kEventWindowActivated } , - { kEventClassWindow , kEventWindowDeactivated } , - { kEventClassWindow , kEventWindowBoundsChanging } , - { kEventClassWindow , kEventWindowBoundsChanged } , - { kEventClassWindow , kEventWindowClose } , - - { kEventClassMouse , kEventMouseDown } , - { kEventClassMouse , kEventMouseUp } , - { kEventClassMouse , kEventMouseWheelMoved } , - { kEventClassMouse , kEventMouseMoved } , - { kEventClassMouse , kEventMouseDragged } , - -} ; - -static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxWindow* focus = wxWindow::FindFocus() ; - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - Point point ; - - EventRef rawEvent ; - - GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ; - - GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( rawEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter( rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - GetEventParameter( rawEvent, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - - switch ( GetEventKind( event ) ) - { - case kEventTextInputUnicodeForKeyEvent : - // this is only called when no default handler has jumped in, eg a wxControl on a floater window does not - // get its own kEventTextInputUnicodeForKeyEvent, so we route back the - wxControl* control = wxDynamicCast( focus , wxControl ) ; - if ( control ) - { - ControlHandle macControl = (ControlHandle) control->GetMacControl() ; - if ( macControl ) - { - ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ; - result = noErr ; - } - } - /* - // this may lead to double events sent to a window in case all handlers have skipped the key down event - UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; - UInt32 message = (keyCode << 8) + charCode; - - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - */ - break ; - } - - return result ; -} - -static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxWindow* focus = wxWindow::FindFocus() ; - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - Point point ; - UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; - - GetEventParameter( event, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - - UInt32 message = (keyCode << 8) + charCode; - switch( GetEventKind( event ) ) - { - case kEventRawKeyRepeat : - case kEventRawKeyDown : - { - WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; - WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; - wxTheApp->MacSetCurrentEvent( event , handler ) ; - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; - } - break ; - case kEventRawKeyUp : - if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - break ; - case kEventRawKeyModifiersChanged : - { - wxKeyEvent event(wxEVT_KEY_DOWN); - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - event.m_x = point.h; - event.m_y = point.v; - event.m_timeStamp = when; - wxWindow* focus = wxWindow::FindFocus() ; - event.SetEventObject(focus); - - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey ) - { - event.m_keyCode = WXK_CONTROL ; - event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey ) - { - event.m_keyCode = WXK_SHIFT ; - event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey ) - { - event.m_keyCode = WXK_ALT ; - event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & cmdKey ) - { - event.m_keyCode = WXK_COMMAND ; - event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - wxTheApp->s_lastModifiers = modifiers ; - } - break ; - } - - return result ; -} - -pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ; - Point point ; - UInt32 modifiers = 0; - EventMouseButton button = 0 ; - UInt32 click = 0 ; - - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &modifiers ); - GetEventParameter( event, kEventParamMouseButton, typeMouseButton, NULL, - sizeof( EventMouseButton ), NULL, &button ); - GetEventParameter( event, kEventParamClickCount, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &click ); - - if ( button == 0 || GetEventKind( event ) == kEventMouseUp ) - modifiers += btnState ; - - // temporary hack to support true two button mouse - if ( button == kEventMouseButtonSecondary ) - { - modifiers |= controlKey ; - } - WindowRef window ; - short windowPart = ::FindWindow(point, &window); - - // either we really are active or we are capturing mouse events - - if ( (IsWindowActive(window) && windowPart == inContent) || - (wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) ) - { - switch ( GetEventKind( event ) ) - { - case kEventMouseDown : - toplevelWindow->MacFireMouseEvent( mouseDown , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseUp : - toplevelWindow->MacFireMouseEvent( mouseUp , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseMoved : - wxTheApp->MacHandleMouseMovedEvent( point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseDragged : - toplevelWindow->MacFireMouseEvent( nullEvent , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseWheelMoved : - { - //bClearTooltip = false; - EventMouseWheelAxis axis = kEventMouseWheelAxisY; - SInt32 delta = 0; - Point mouseLoc = {0, 0}; - if (::GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, - NULL, sizeof(EventMouseWheelAxis), NULL, &axis) == noErr && - ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, - NULL, sizeof(SInt32), NULL, &delta) == noErr && - ::GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, - NULL, sizeof(Point), NULL, &mouseLoc) == noErr) - { - wxMouseEvent wheelEvent(wxEVT_MOUSEWHEEL); - - wheelEvent.m_x = mouseLoc.h; - wheelEvent.m_y = mouseLoc.v; - - wheelEvent.m_wheelRotation = delta; - wheelEvent.m_wheelDelta = 1; - wheelEvent.m_linesPerAction = 1; - - wxWindow* currentMouseWindow = NULL; - wxWindow::MacGetWindowFromPoint(wxPoint(mouseLoc.h, mouseLoc.v), ¤tMouseWindow); - - if (currentMouseWindow) - { - currentMouseWindow->GetEventHandler()->ProcessEvent(wheelEvent); - result = noErr; - } - } - } - break ; - default : - break ; - } - } - - return result ; - - -} -static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - OSStatus err = noErr ; - - UInt32 attributes; - WindowRef windowRef ; - wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ; - - GetEventParameter( event, kEventParamDirectObject, typeWindowRef, NULL, - sizeof( WindowRef ), NULL, &windowRef ); - - switch( GetEventKind( event ) ) - { - case kEventWindowUpdate : - if ( !wxPendingDelete.Member(toplevelWindow) ) - toplevelWindow->MacUpdate( EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventWindowActivated : - toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , true) ; - result = noErr ; - break ; - case kEventWindowDeactivated : - toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ; - result = noErr ; - break ; - case kEventWindowShown : - toplevelWindow->Refresh() ; - result = noErr ; - break ; - case kEventWindowClose : - toplevelWindow->Close() ; - result = noErr ; - break ; - case kEventWindowBoundsChanged : - err = GetEventParameter( event, kEventParamAttributes, typeUInt32, - NULL, sizeof( UInt32 ), NULL, &attributes ); - if ( err == noErr ) - { - Rect newContentRect ; - - GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, - sizeof( newContentRect ), NULL, &newContentRect ); - - toplevelWindow->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - - result = noErr; - } - break ; - case kEventWindowBoundsChanging : - err = GetEventParameter( event, kEventParamAttributes, typeUInt32, - NULL, sizeof( UInt32 ), NULL, &attributes ); - if ( err == noErr ) - { - Rect newContentRect ; - - GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, - sizeof( newContentRect ), NULL, &newContentRect ); - - wxSize formerSize = toplevelWindow->GetSize() ; - - if ( (attributes & kWindowBoundsChangeSizeChanged ) || - ( attributes & kWindowBoundsChangeOriginChanged ) ) - toplevelWindow->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - - int x , y , w , h ; - toplevelWindow->GetPosition( &x , &y ) ; - toplevelWindow->GetSize( &w , &h ) ; - Rect adjustedRect = { y , x , y + h , x + w } ; - - if ( !EqualRect( &newContentRect , &adjustedRect ) ) - { - SetEventParameter( event , kEventParamCurrentBounds , typeQDRectangle, sizeof( adjustedRect ) , &adjustedRect ) ; - } - - if ( toplevelWindow->GetSize() != formerSize ) - toplevelWindow->Update() ; - - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} - -pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - switch ( GetEventClass( event ) ) - { - case kEventClassKeyboard : - result = KeyboardEventHandler( handler, event , data ) ; - break ; - case kEventClassTextInput : - result = TextInputEventHandler( handler, event , data ) ; - break ; - case kEventClassWindow : - result = WindowEventHandler( handler, event , data ) ; - break ; - case kEventClassMouse : - result = MouseEventHandler( handler, event , data ) ; - break ; - default : - break ; - } - return result ; -} - -DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacWindowEventHandler ) - -#endif - -// --------------------------------------------------------------------------- -// wxWindowMac utility functions -// --------------------------------------------------------------------------- - -// Find an item given the Macintosh Window Reference - -wxList *wxWinMacWindowList = NULL; -wxTopLevelWindowMac *wxFindWinFromMacWindow(WXWindow inWindowRef) -{ - if ( wxWinMacWindowList == NULL ) - return NULL ; - wxNode *node = wxWinMacWindowList->Find((long)inWindowRef); - if (!node) - return NULL; - return (wxTopLevelWindowMac *)node->GetData(); -} - -void wxAssociateWinWithMacWindow(WXWindow inWindowRef, wxTopLevelWindowMac *win) -{ - // adding NULL WindowRef is (first) surely a result of an error and - // (secondly) breaks menu command processing - wxCHECK_RET( inWindowRef != (WindowRef) NULL, wxT("attempt to add a NULL WindowRef to window list") ); - - if ( !wxWinMacWindowList->Find((long)inWindowRef) ) - wxWinMacWindowList->Append((long)inWindowRef, win); -} - -void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) -{ - wxWinMacWindowList->DeleteObject(win); -} - - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac creation -// ---------------------------------------------------------------------------- - -WXHWND wxTopLevelWindowMac::s_macWindowInUpdate = NULL; -wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL; -bool wxTopLevelWindowMac::s_macWindowCompositing = FALSE; - -void wxTopLevelWindowMac::Init() -{ - m_iconized = - m_maximizeOnShow = FALSE; - m_macNoEraseUpdateRgn = NewRgn() ; - m_macNeedsErasing = false ; - m_macWindow = NULL ; - m_macUsesCompositing = FALSE ; -#if TARGET_CARBON - m_macEventHandler = NULL ; - #endif -} - -class wxMacDeferredWindowDeleter : public wxObject -{ -public : - wxMacDeferredWindowDeleter( WindowRef windowRef ) - { - m_macWindow = windowRef ; - } - virtual ~wxMacDeferredWindowDeleter() - { - UMADisposeWindow( (WindowRef) m_macWindow ) ; - } - protected : - WindowRef m_macWindow ; -} ; - -bool wxTopLevelWindowMac::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // init our fields - Init(); - - m_windowStyle = style; - - SetName(name); - - m_windowId = id == -1 ? NewControlId() : id; - - wxTopLevelWindows.Append(this); - - if ( parent ) - parent->AddChild(this); - - return TRUE; -} - -wxTopLevelWindowMac::~wxTopLevelWindowMac() -{ - if ( m_macWindow ) - { - wxToolTip::NotifyWindowDelete(m_macWindow) ; - wxPendingDelete.Append( new wxMacDeferredWindowDeleter( (WindowRef) m_macWindow ) ) ; - } - -#if TARGET_CARBON - if ( m_macEventHandler ) - { - ::RemoveEventHandler((EventHandlerRef) m_macEventHandler); - m_macEventHandler = NULL ; - } -#endif - - wxRemoveMacWindowAssociation( this ) ; - - if ( wxModelessWindows.Find(this) ) - wxModelessWindows.DeleteObject(this); - - DisposeRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ; -} - - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac maximize/minimize -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowMac::Maximize(bool maximize) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - wxMacWindowClipper clip (this); - ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ; - - Rect tempRect ; - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort((WindowRef)m_macWindow) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - - GetWindowPortBounds((WindowRef)m_macWindow, &tempRect ) ; - SetSize( pt.h , pt.v , tempRect.right-tempRect.left , - tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); -} - -bool wxTopLevelWindowMac::IsMaximized() const -{ - return IsWindowInStandardState( (WindowRef)m_macWindow , NULL , NULL ) ; -} - -void wxTopLevelWindowMac::Iconize(bool iconize) -{ - if ( IsWindowCollapsable((WindowRef)m_macWindow) ) - CollapseWindow((WindowRef)m_macWindow , iconize ) ; -} - -bool wxTopLevelWindowMac::IsIconized() const -{ - return IsWindowCollapsed((WindowRef)m_macWindow ) ; -} - -void wxTopLevelWindowMac::Restore() -{ - // not available on mac -} - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac misc -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowMac::SetIcon(const wxIcon& icon) -{ - // this sets m_icon - wxTopLevelWindowBase::SetIcon(icon); -} - -void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) -{ - OSStatus err = noErr ; - SetName(name); - m_windowStyle = style; - m_isShown = FALSE; - - // create frame. - - Rect theBoundsRect; - - m_x = (int)pos.x; - m_y = (int)pos.y; - if ( m_y < 50 ) - m_y = 50 ; - if ( m_x < 20 ) - m_x = 20 ; - - m_width = WidthDefault(size.x); - m_height = HeightDefault(size.y); - - ::SetRect(&theBoundsRect, m_x, m_y , m_x + m_width, m_y + m_height); - - // translate the window attributes in the appropriate window class and attributes - - WindowClass wclass = 0; - WindowAttributes attr = kWindowNoAttributes ; - - if ( HasFlag( wxFRAME_TOOL_WINDOW) ) - { - if ( - HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || - HasFlag( wxSYSTEM_MENU ) || HasFlag( wxCAPTION ) || - HasFlag(wxTINY_CAPTION_HORIZ) || HasFlag(wxTINY_CAPTION_VERT) - ) - { - wclass = kFloatingWindowClass ; - if ( HasFlag(wxTINY_CAPTION_VERT) ) - { - attr |= kWindowSideTitlebarAttribute ; - } - } - else - { -#if TARGET_CARBON - wclass = kPlainWindowClass ; -#else - wclass = kFloatingWindowClass ; -#endif - } - } - else if ( HasFlag( wxCAPTION ) ) - { - wclass = kDocumentWindowClass ; - } - else - { - if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || - HasFlag( wxCLOSE_BOX ) || HasFlag( wxSYSTEM_MENU ) ) - { - wclass = kDocumentWindowClass ; - } - else - { -#if TARGET_CARBON - wclass = kPlainWindowClass ; -#else - wclass = kModalWindowClass ; -#endif - } - } - - if ( HasFlag( wxMINIMIZE_BOX ) ) - { - attr |= kWindowCollapseBoxAttribute ; - } - if ( HasFlag( wxMAXIMIZE_BOX ) ) - { - attr |= kWindowFullZoomAttribute ; - } - if ( HasFlag( wxRESIZE_BORDER ) ) - { - attr |= kWindowResizableAttribute ; - } - if ( HasFlag( wxCLOSE_BOX) ) - { - attr |= kWindowCloseBoxAttribute ; - } - - if (UMAGetSystemVersion() >= 0x1000) - { - //turn on live resizing (OS X only) - attr |= kWindowLiveResizeAttribute; - } - -#if TARGET_CARBON -#if 0 // having problems right now with that - if (HasFlag(wxSTAY_ON_TOP)) - wclass = kUtilityWindowClass; -#endif -#endif - - //this setup lets us have compositing and non-compositing - //windows in the same application. - -#if UNIVERSAL_INTERFACES_VERSION >= 0x0400 - if ( wxTopLevelWindowMac::s_macWindowCompositing ) - { - attr |= kWindowCompositingAttribute; - m_macUsesCompositing = TRUE; - } - else -#endif - { - m_macUsesCompositing = FALSE; - } - -#if TARGET_CARBON - if ( HasFlag(wxFRAME_SHAPED) ) - { - WindowDefSpec customWindowDefSpec; - customWindowDefSpec.defType = kWindowDefProcPtr; - customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef); - - err = ::CreateCustomWindow( &customWindowDefSpec, wclass, - attr, &theBoundsRect, - (WindowRef*) &m_macWindow); - } - else -#endif - { - err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ; - } - - wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") ); - wxAssociateWinWithMacWindow( m_macWindow , this ) ; - UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ; - if ( wxTopLevelWindowMac::s_macWindowCompositing ) - { - ::GetRootControl( (WindowRef)m_macWindow, (ControlHandle*)&m_macRootControl ) ; - } - else - { - ::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ; - } -#if TARGET_CARBON - InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ; - InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacWindowEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler); -#endif - m_macFocus = NULL ; - - -#if TARGET_CARBON - if ( HasFlag(wxFRAME_SHAPED) ) - { - // default shape matches the window size - wxRegion rgn(0, 0, m_width, m_height); - SetShape(rgn); - } -#endif - - wxWindowCreateEvent event(this); - GetEventHandler()->ProcessEvent(event); -} - -bool wxTopLevelWindowMac::MacEnableCompositing( bool useCompositing ) -{ - bool oldval = s_macWindowCompositing; - s_macWindowCompositing = useCompositing; - return oldval; -} - -void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin) -{ - ((Point*)localOrigin)->h = 0; - ((Point*)localOrigin)->v = 0; - ((Rect*)clipRect)->left = 0; - ((Rect*)clipRect)->top = 0; - ((Rect*)clipRect)->right = m_width; - ((Rect*)clipRect)->bottom = m_height; - *window = m_macWindow ; - *rootwin = this ; -} - -void wxTopLevelWindowMac::ClearBackground() -{ - wxWindow::ClearBackground() ; -} - -WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding() -{ - return m_macRootControl ; -} - - -void wxTopLevelWindowMac::MacUpdate( long timestamp) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - - RgnHandle visRgn = NewRgn() ; - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), visRgn ); - BeginUpdate( (WindowRef)m_macWindow ) ; - - RgnHandle updateRgn = NewRgn(); - RgnHandle diffRgn = NewRgn() ; - - if ( updateRgn && diffRgn ) - { -#if 1 - // macos internal control redraws clean up areas we'd like to redraw ourselves - // therefore we pick the boundary rect and make sure we can redraw it - // this has to be intersected by the visRgn in order to avoid drawing over its own - // boundaries - RgnHandle trueUpdateRgn = NewRgn() ; - Rect trueUpdateRgnBoundary ; - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn ); - GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ; - RectRgn( updateRgn , &trueUpdateRgnBoundary ) ; - SectRgn( updateRgn , visRgn , updateRgn ) ; - if ( trueUpdateRgn ) - DisposeRgn( trueUpdateRgn ) ; - SetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ; -#else - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn ); -#endif - DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ; - if ( !EmptyRgn( updateRgn ) ) - { - MacRedraw( updateRgn , timestamp , m_macNeedsErasing || !EmptyRgn( diffRgn ) ) ; - } - } - if ( updateRgn ) - DisposeRgn( updateRgn ); - if ( diffRgn ) - DisposeRgn( diffRgn ); - if ( visRgn ) - DisposeRgn( visRgn ) ; - - EndUpdate( (WindowRef)m_macWindow ) ; - SetEmptyRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ; - m_macNeedsErasing = false ; -} - - -// Raise the window to the top of the Z order -void wxTopLevelWindowMac::Raise() -{ - ::SelectWindow( (WindowRef)m_macWindow ) ; -} - -// Lower the window to the bottom of the Z order -void wxTopLevelWindowMac::Lower() -{ - ::SendBehind( (WindowRef)m_macWindow , NULL ) ; -} - -void wxTopLevelWindowMac::MacFireMouseEvent( - wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) -{ - wxMouseEvent event(wxEVT_LEFT_DOWN); - bool isDown = !(modifiers & btnState) ; // 1 is for up - bool controlDown = modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - - if ( kind == mouseDown ) - { - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_DOWN ) ; - else - event.SetEventType(wxEVT_LEFT_DOWN ) ; - } - else if ( kind == mouseUp ) - { - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_UP ) ; - else - event.SetEventType(wxEVT_LEFT_UP ) ; - } - else - { - event.SetEventType(wxEVT_MOTION ) ; - } - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - Point localwhere ; - localwhere.h = x ; - localwhere.v = y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( (WindowRef)m_macWindow ) ) ; - ::GlobalToLocal( &localwhere ) ; - ::SetPort( port ) ; - - if ( kind == mouseDown ) - { - if ( timestamp - gs_lastWhen <= (long) GetDblTime() ) - { - if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 ) - { - // This is not right if the second mouse down - // event occured in a differen window. We - // correct this in MacDispatchMouseEvent. - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_DCLICK ) ; - else - event.SetEventType(wxEVT_LEFT_DCLICK ) ; - } - gs_lastWhen = 0 ; - } - else - { - gs_lastWhen = timestamp ; - } - gs_lastWhere = localwhere ; - } - - event.m_x = localwhere.h; - event.m_y = localwhere.v; - event.m_x += m_x; - event.m_y += m_y; - - event.m_timeStamp = timestamp; - event.SetEventObject(this); - if ( wxTheApp->s_captureWindow ) - { - int x = event.m_x ; - int y = event.m_y ; - wxTheApp->s_captureWindow->ScreenToClient( &x , &y ) ; - event.m_x = x ; - event.m_y = y ; - event.SetEventObject( wxTheApp->s_captureWindow ) ; - wxTheApp->s_captureWindow->GetEventHandler()->ProcessEvent( event ) ; - - if ( kind == mouseUp ) - { - wxTheApp->s_captureWindow = NULL ; - if ( !wxIsBusy() ) - { - m_cursor.MacInstall() ; - } - } - } - else - { - MacDispatchMouseEvent( event ) ; - } -} - -#if !TARGET_CARBON - -void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part) -{ - MacFireMouseEvent( mouseDown , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; -} - -void wxTopLevelWindowMac::MacMouseUp( WXEVENTREF ev , short part) -{ - switch (part) - { - case inContent: - { - MacFireMouseEvent( mouseUp , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; - } - break ; - } -} - -void wxTopLevelWindowMac::MacMouseMoved( WXEVENTREF ev , short part) -{ - switch (part) - { - case inContent: - { - MacFireMouseEvent( nullEvent /*moved*/ , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; - } - break ; - } -} - -#endif - -void wxTopLevelWindowMac::MacDelayedDeactivation(long timestamp) -{ - if(s_macDeactivateWindow) - { - wxLogDebug(wxT("Doing delayed deactivation of %p"),s_macDeactivateWindow); - s_macDeactivateWindow->MacActivate(timestamp, false); - } -} - -void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating ) -{ - // wxLogDebug(wxT("TopLevel=%p::MacActivate"),this); - - if(s_macDeactivateWindow==this) - s_macDeactivateWindow=NULL; - MacDelayedDeactivation(timestamp); - wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId); - event.m_timeStamp = timestamp ; - event.SetEventObject(this); - - GetEventHandler()->ProcessEvent(event); - - UMAHighlightAndActivateWindow( (WindowRef)m_macWindow , inIsActivating ) ; - - // Early versions of MacOS X don't refresh backgrounds properly, - // so refresh the whole window on activation and deactivation. - long osVersion = UMAGetSystemVersion(); - if (osVersion >= 0x1000 && osVersion < 0x1020 ) - { - Refresh(TRUE); - } - else - { - // for the moment we have to resolve some redrawing issues like this - // the OS is stealing some redrawing areas as soon as it draws a control - Refresh(TRUE); - } -} - -#if !TARGET_CARBON - -void wxTopLevelWindowMac::MacKeyDown( WXEVENTREF ev ) -{ -} - -#endif - -void wxTopLevelWindowMac::SetTitle(const wxString& title) -{ - wxWindow::SetTitle( title ) ; - UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ; -} - -bool wxTopLevelWindowMac::Show(bool show) -{ - if ( !wxWindow::Show(show) ) - return FALSE; - - if (show) - { - #if wxUSE_SYSTEM_OPTIONS //code contributed by Ryan Wilcox December 18, 2003 - if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) ) - { - ::ShowWindow( (WindowRef)m_macWindow ); - } - else - #endif - { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil); - } - ::SelectWindow( (WindowRef)m_macWindow ) ; - // no need to generate events here, they will get them triggered by macos - // actually they should be , but apparently they are not - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - else - { - #if wxUSE_SYSTEM_OPTIONS - if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) ) - { - ::HideWindow((WindowRef) m_macWindow ); - } - else - #endif - { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil); - } - } - - if ( !show ) - { - } - else - { - Refresh() ; - } - - return TRUE; -} - -void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - wxMacWindowClipper clip (this); - - int former_x = m_x ; - int former_y = m_y ; - int former_w = m_width ; - int former_h = m_height ; - - int actualWidth = width; - int actualHeight = height; - int actualX = x; - int actualY = y; - - if ((m_minWidth != -1) && (actualWidth < m_minWidth)) - actualWidth = m_minWidth; - if ((m_minHeight != -1) && (actualHeight < m_minHeight)) - actualHeight = m_minHeight; - if ((m_maxWidth != -1) && (actualWidth > m_maxWidth)) - actualWidth = m_maxWidth; - if ((m_maxHeight != -1) && (actualHeight > m_maxHeight)) - actualHeight = m_maxHeight; - - bool doMove = false ; - bool doResize = false ; - - if ( actualX != former_x || actualY != former_y ) - { - doMove = true ; - } - if ( actualWidth != former_w || actualHeight != former_h ) - { - doResize = true ; - } - - if ( doMove || doResize ) - { - m_x = actualX ; - m_y = actualY ; - - if ( doMove ) - ::MoveWindow((WindowRef)m_macWindow, m_x, m_y , false); // don't make frontmost - - m_width = actualWidth ; - m_height = actualHeight ; - - if ( doResize ) - ::SizeWindow((WindowRef)m_macWindow, m_width, m_height , true); - - // the OS takes care of invalidating and erasing the new area so we only have to - // take care of refreshing for full repaints - - if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) ) - Refresh() ; - - - if ( IsKindOf( CLASSINFO( wxFrame ) ) ) - { - wxFrame* frame = (wxFrame*) this ; -#if wxUSE_STATUSBAR - frame->PositionStatusBar(); -#endif -#if wxUSE_TOOLBAR - frame->PositionToolBar(); -#endif - } - if ( doMove ) - wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified - - MacRepositionScrollBars() ; - if ( doMove ) - { - wxPoint point(m_x, m_y); - wxMoveEvent event(point, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - if ( doResize ) - { - MacRepositionScrollBars() ; - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - -} - -/* - * Invalidation Mechanism - * - * The update mechanism reflects exactely the windows mechanism - * the rect gets added to the window invalidate region, if the eraseBackground flag - * has been true for any part of the update rgn the background is erased in the entire region - * not just in the specified rect. - * - * In order to achive this, we also have an internal m_macNoEraseUpdateRgn, all rects that have - * the eraseBackground flag set to false are also added to this rgn. upon receiving an update event - * the update rgn is compared to the m_macNoEraseUpdateRgn and in case they differ, every window - * will get the eraseBackground event first - */ - -void wxTopLevelWindowMac::MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) -{ - GrafPtr formerPort ; - GetPort( &formerPort ) ; - SetPortWindowPort( (WindowRef)m_macWindow ) ; - - m_macNeedsErasing |= eraseBackground ; - - // if we already know that we will have to erase, there's no need to track the rest - if ( !m_macNeedsErasing) - { - // we end only here if eraseBackground is false - // if we already have a difference between m_macNoEraseUpdateRgn and UpdateRgn - // we will have to erase anyway - - RgnHandle updateRgn = NewRgn(); - RgnHandle diffRgn = NewRgn() ; - if ( updateRgn && diffRgn ) - { - GetWindowUpdateRgn( (WindowRef)m_macWindow , updateRgn ); - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - OffsetRgn( updateRgn , -pt.h , -pt.v ) ; - DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ; - if ( !EmptyRgn( diffRgn ) ) - { - m_macNeedsErasing = true ; - } - } - if ( updateRgn ) - DisposeRgn( updateRgn ); - if ( diffRgn ) - DisposeRgn( diffRgn ); - - if ( !m_macNeedsErasing ) - { - RgnHandle rectRgn = NewRgn() ; - SetRectRgn( rectRgn , ((Rect*)rect)->left , ((Rect*)rect)->top , ((Rect*)rect)->right , ((Rect*)rect)->bottom ) ; - UnionRgn( (RgnHandle) m_macNoEraseUpdateRgn , rectRgn , (RgnHandle) m_macNoEraseUpdateRgn ) ; - DisposeRgn( rectRgn ) ; - } - } - InvalWindowRect( (WindowRef)m_macWindow , (Rect*)rect ) ; - // turn this on to debug the refreshing cycle -#if wxMAC_DEBUG_REDRAW - PaintRect( rect ) ; -#endif - SetPort( formerPort ) ; -} - - -bool wxTopLevelWindowMac::SetShape(const wxRegion& region) -{ - wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); - -#if TARGET_CARBON - // The empty region signifies that the shape should be removed from the - // window. - if ( region.IsEmpty() ) - { - wxSize sz = GetClientSize(); - wxRegion rgn(0, 0, sz.x, sz.y); - return SetShape(rgn); - } - - // Make a copy of the region - RgnHandle shapeRegion = NewRgn(); - CopyRgn( (RgnHandle)region.GetWXHRGN(), shapeRegion ); - - // Dispose of any shape region we may already have - RgnHandle oldRgn = (RgnHandle)GetWRefCon( (WindowRef)MacGetWindowRef() ); - if ( oldRgn ) - DisposeRgn(oldRgn); - - // Save the region so we can use it later - SetWRefCon((WindowRef)MacGetWindowRef(), (SInt32)shapeRegion); - - // Tell the window manager that the window has changed shape - ReshapeCustomWindow((WindowRef)MacGetWindowRef()); - return TRUE; -#else - return FALSE; -#endif -} - -// --------------------------------------------------------------------------- -// Support functions for shaped windows, based on Apple's CustomWindow sample at -// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm -// --------------------------------------------------------------------------- - -#if TARGET_CARBON - -static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect) -{ - GetWindowPortBounds(window, inRect); - Point pt = {inRect->left, inRect->top}; - SetPort((GrafPtr) GetWindowPort(window)); - LocalToGlobal(&pt); - inRect->top = pt.v; - inRect->left = pt.h; - inRect->bottom += pt.v; - inRect->right += pt.h; -} - - -static SInt32 wxShapedMacWindowGetFeatures(WindowRef window, SInt32 param) -{ - /*------------------------------------------------------ - Define which options your custom window supports. - --------------------------------------------------------*/ - //just enable everything for our demo - *(OptionBits*)param=//kWindowCanGrow| - //kWindowCanZoom| - //kWindowCanCollapse| - //kWindowCanGetWindowRegion| - //kWindowHasTitleBar| - //kWindowSupportsDragHilite| - kWindowCanDrawInCurrentPort| - //kWindowCanMeasureTitle| - kWindowWantsDisposeAtProcessDeath| - kWindowSupportsSetGrowImageRegion| - kWindowDefSupportsColorGrafPort; - return 1; -} - -// The content region is left as a rectangle matching the window size, this is -// so the origin in the paint event, and etc. still matches what the -// programmer expects. -static void wxShapedMacWindowContentRegion(WindowRef window, RgnHandle rgn) -{ - SetEmptyRgn(rgn); - wxTopLevelWindowMac* win = wxFindWinFromMacWindow(window); - if (win) - { - wxRect r = win->GetRect(); - SetRectRgn(rgn, r.GetLeft(), r.GetTop(), r.GetRight(), r.GetBottom()); - } -} - -// The structure region is set to the shape given to the SetShape method. -static void wxShapedMacWindowStructureRegion(WindowRef window, RgnHandle rgn) -{ - RgnHandle cachedRegion = (RgnHandle) GetWRefCon(window); - - SetEmptyRgn(rgn); - if (cachedRegion) - { - Rect windowRect; - wxShapedMacWindowGetPos(window, &windowRect); //how big is the window - CopyRgn(cachedRegion, rgn); //make a copy of our cached region - OffsetRgn(rgn, windowRect.left, windowRect.top); // position it over window - //MapRgn(rgn, &mMaskSize, &windowRect); //scale it to our actual window size - } -} - - - -static SInt32 wxShapedMacWindowGetRegion(WindowRef window, SInt32 param) -{ - GetWindowRegionPtr rgnRec=(GetWindowRegionPtr)param; - - switch(rgnRec->regionCode) - { - case kWindowStructureRgn: - wxShapedMacWindowStructureRegion(window, rgnRec->winRgn); - break; - case kWindowContentRgn: - wxShapedMacWindowContentRegion(window, rgnRec->winRgn); - break; - default: - SetEmptyRgn(rgnRec->winRgn); - } //switch - - return noErr; -} - - -static SInt32 wxShapedMacWindowHitTest(WindowRef window,SInt32 param) -{ - /*------------------------------------------------------ - Determine the region of the window which was hit - --------------------------------------------------------*/ - Point hitPoint; - static RgnHandle tempRgn=nil; - - if(!tempRgn) - tempRgn=NewRgn(); - - SetPt(&hitPoint,LoWord(param),HiWord(param));//get the point clicked - - //Mac OS 8.5 or later - wxShapedMacWindowStructureRegion(window, tempRgn); - if (PtInRgn(hitPoint, tempRgn)) //in window content region? - return wInContent; - - return wNoHit;//no significant area was hit. -} - - -static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param) -{ - switch(message) - { - case kWindowMsgHitTest: - return wxShapedMacWindowHitTest(window,param); - - case kWindowMsgGetFeatures: - return wxShapedMacWindowGetFeatures(window,param); - - // kWindowMsgGetRegion is sent during CreateCustomWindow and ReshapeCustomWindow - case kWindowMsgGetRegion: - return wxShapedMacWindowGetRegion(window,param); - } - - return 0; -} - -#endif -// --------------------------------------------------------------------------- - diff --git a/src/mac/carbon/treectrl.cpp b/src/mac/carbon/treectrl.cpp deleted file mode 100644 index 7a548a7436..0000000000 --- a/src/mac/carbon/treectrl.cpp +++ /dev/null @@ -1,419 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp -// Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "treectrl.h" -#endif - -#include "wx/stubs/textctrl.h" -#include "wx/treebase.h" -#include "wx/stubs/treectrl.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxTreeItem, wxObject) - -#endif - -wxTreeCtrl::wxTreeCtrl() -{ - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; -} - -bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxValidator& validator, const wxString& name) -{ - SetName(name); - SetValidator(validator); - - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; - - m_windowStyle = style; - - SetParent(parent); - - m_windowId = (id == -1) ? NewControlId() : id; - - if (parent) parent->AddChild(this); - - // TODO create tree control - - return FALSE; -} - -wxTreeCtrl::~wxTreeCtrl() -{ - if (m_textCtrl) - { - delete m_textCtrl; - } -} - -// Attributes -int wxTreeCtrl::GetCount() const -{ - // TODO - return 0; -} - -int wxTreeCtrl::GetIndent() const -{ - // TODO - return 0; -} - -void wxTreeCtrl::SetIndent(int indent) -{ - // TODO -} - -wxImageList *wxTreeCtrl::GetImageList(int which) const -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - return m_imageListNormal; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - return m_imageListState; - } - return NULL; -} - -void wxTreeCtrl::SetImageList(wxImageList *imageList, int which) -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - m_imageListNormal = imageList; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - m_imageListState = imageList; - } - // TODO -} - -long wxTreeCtrl::GetNextItem(long item, int code) const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::ItemHasChildren(long item) const -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::GetChild(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetItemParent(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetFirstVisibleItem() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetNextVisibleItem(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetSelection() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetRootItem() const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::GetItem(wxTreeItem& info) const -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::SetItem(wxTreeItem& info) -{ - // TODO - return FALSE; -} - -int wxTreeCtrl::GetItemState(long item, long stateMask) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_stateMask = stateMask; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - - return info.m_state; -} - -bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_state = state; - info.m_stateMask = stateMask; - info.m_itemId = item; - - return SetItem(info); -} - -bool wxTreeCtrl::SetItemImage(long item, int image, int selImage) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_IMAGE ; - info.m_image = image; - if ( selImage > -1) - { - info.m_selectedImage = selImage; - info.m_mask |= wxTREE_MASK_SELECTED_IMAGE; - } - info.m_itemId = item; - - return SetItem(info); -} - -wxString wxTreeCtrl::GetItemText(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - - if (!GetItem(info)) - return wxString(""); - return info.m_text; -} - -void wxTreeCtrl::SetItemText(long item, const wxString& str) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - info.m_text = str; - - SetItem(info); -} - -long wxTreeCtrl::GetItemData(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - return info.m_data; -} - -bool wxTreeCtrl::SetItemData(long item, long data) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - info.m_data = data; - - return SetItem(info); -} - -bool wxTreeCtrl::GetItemRect(long item, wxRect& rect, bool textOnly) const -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::GetEditControl() const -{ - return m_textCtrl; -} - -// Operations -bool wxTreeCtrl::DeleteItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ExpandItem(long item, int action) -{ - // TODO - switch ( action ) - { - case wxTREE_EXPAND_EXPAND: - break; - - case wxTREE_EXPAND_COLLAPSE: - break; - - case wxTREE_EXPAND_COLLAPSE_RESET: - break; - - case wxTREE_EXPAND_TOGGLE: - break; - - default: - wxFAIL_MSG("unknown action in wxTreeCtrl::ExpandItem"); - } - - bool bOk = FALSE; // TODO expand item - - // May not send messages, so emulate them - if ( bOk ) { - wxTreeEvent event(wxEVT_NULL, m_windowId); - event.m_item.m_itemId = item; - event.m_item.m_mask = - event.m_item.m_stateMask = 0xffff; // get all - GetItem(event.m_item); - - bool bIsExpanded = (event.m_item.m_state & wxTREE_STATE_EXPANDED) != 0; - - event.m_code = action; - event.SetEventObject(this); - - // @@@ return values of {EXPAND|COLLAPS}ING event handler is discarded - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDING - : wxEVT_COMMAND_TREE_ITEM_COLLAPSING); - GetEventHandler()->ProcessEvent(event); - - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDED - : wxEVT_COMMAND_TREE_ITEM_COLLAPSED); - GetEventHandler()->ProcessEvent(event); - } - - return bOk; -} - -long wxTreeCtrl::InsertItem(long parent, wxTreeItem& info, long insertAfter) -{ - // TODO - return 0; -} - -long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image, int selImage, - long insertAfter) -{ - wxTreeItem info; - info.m_text = label; - info.m_mask = wxTREE_MASK_TEXT; - if ( image > -1 ) - { - info.m_mask |= wxTREE_MASK_IMAGE | wxTREE_MASK_SELECTED_IMAGE; - info.m_image = image; - if ( selImage == -1 ) - info.m_selectedImage = image; - else - info.m_selectedImage = selImage; - } - - return InsertItem(parent, info, insertAfter); -} - -bool wxTreeCtrl::SelectItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ScrollTo(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::EditLabel(long item, wxClassInfo* textControlClass) -{ - // TODO - return NULL; -} - -// End label editing, optionally cancelling the edit -bool wxTreeCtrl::EndEditLabel(bool cancel) -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::HitTest(const wxPoint& point, int& flags) -{ - // TODO - return 0; -} - -bool wxTreeCtrl::SortChildren(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::EnsureVisible(long item) -{ - // TODO - return FALSE; -} - -// Tree item structure -wxTreeItem::wxTreeItem() -{ - m_mask = 0; - m_itemId = 0; - m_state = 0; - m_stateMask = 0; - m_image = -1; - m_selectedImage = -1; - m_children = 0; - m_data = 0; -} - -// Tree event -IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxCommandEvent) - -wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ - m_code = 0; - m_oldItem = 0; -} - diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp deleted file mode 100644 index 48a7599f04..0000000000 --- a/src/mac/carbon/uma.cpp +++ /dev/null @@ -1,815 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uma.cpp -// Purpose: UMA support -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: The wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/defs.h" - -#if wxUSE_GUI - -#include "wx/dc.h" -#include - -#ifndef __DARWIN__ -# include -# if defined(TARGET_CARBON) -# if PM_USE_SESSION_APIS -# include -# endif -# include -# else -# include -# endif -#endif - -#ifndef __DARWIN__ -#include -#endif -#include "wx/mac/uma.h" - - -// since we have decided that we only support 8.6 upwards we are -// checking for these minimum requirements in the startup code of -// the application so all wxWindows code can safely assume that appearance 1.1 -// windows manager, control manager, navigation services etc. are -// present - -static bool sUMAHasAppearance = false ; -static long sUMAAppearanceVersion = 0 ; -static long sUMASystemVersion = 0 ; -static bool sUMAHasAquaLayout = false ; - -static bool sUMAHasInittedAppearance = false; - -extern int gAGABackgroundColor ; -bool UMAHasAppearance() { return sUMAHasAppearance ; } -long UMAGetAppearanceVersion() { return sUMAAppearanceVersion ; } -long UMAGetSystemVersion() { return sUMASystemVersion ; } - -static bool sUMAHasWindowManager = false ; -static long sUMAWindowManagerAttr = 0 ; - -bool UMAHasWindowManager() { return sUMAHasWindowManager ; } -long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; } -bool UMAHasAquaLayout() { return sUMAHasAquaLayout ; } - - -void UMACleanupToolbox() -{ - if (sUMAHasInittedAppearance) - { - UnregisterAppearanceClient() ; - } - if ( NavServicesAvailable() ) - { - NavUnload() ; - } - if ( TXNTerminateTextension != (void*) kUnresolvedCFragSymbolAddress ) - TXNTerminateTextension( ) ; -} -void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded ) -{ -#if !TARGET_CARBON - ::MaxApplZone(); - for (long i = 1; i <= inMoreMastersCalls; i++) - ::MoreMasters(); - - if (!isEmbedded) - { - ::InitGraf(&qd.thePort); - ::InitFonts(); - ::InitMenus(); - ::TEInit(); - ::InitDialogs(0L); - ::FlushEvents(everyEvent, 0); - } - - long total,contig; - PurgeSpace(&total, &contig); -#endif - - ::InitCursor(); - - if ( Gestalt(gestaltSystemVersion, &sUMASystemVersion) != noErr) - sUMASystemVersion = 0x0000 ; - - long theAppearance ; - if ( Gestalt( gestaltAppearanceAttr, &theAppearance ) == noErr ) - { - sUMAHasAppearance = true ; - OSStatus status = RegisterAppearanceClient(); - // If status equals appearanceProcessRegisteredErr it means the - // appearance client already was registered (For example if we run - // embedded, the host might have registered it). In such a case - // we don't unregister it later on. - if (status != appearanceProcessRegisteredErr) - { - // Appearance client wasn't registered yet. - sUMAHasInittedAppearance = true; - } - - if ( Gestalt( gestaltAppearanceVersion, &theAppearance ) == noErr ) - { - sUMAAppearanceVersion = theAppearance ; - } - else - { - sUMAAppearanceVersion = 0x0100 ; - } - } - if ( Gestalt( gestaltWindowMgrAttr, &sUMAWindowManagerAttr ) == noErr ) - { - sUMAHasWindowManager = sUMAWindowManagerAttr & gestaltWindowMgrPresent ; - } - -#if TARGET_CARBON -// Call currently implicitely done : InitFloatingWindows() ; -#else - if (!isEmbedded) - { - if ( sUMAHasWindowManager ) - InitFloatingWindows() ; - else - InitWindows(); - } -#endif - - if ( NavServicesAvailable() ) - { - NavLoad() ; - } - - long menuMgrAttr ; - Gestalt( gestaltMenuMgrAttr , &menuMgrAttr ) ; - if ( menuMgrAttr & gestaltMenuMgrAquaLayoutMask ) - sUMAHasAquaLayout = true ; - - if ( TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress ) - { - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - - TXNMacOSPreferredFontDescription fontDescriptions[] = - { - { fontId , (fontSize << 16) ,kTXNDefaultFontStyle, kTXNSystemDefaultEncoding } - } ; - int noOfFontDescriptions = sizeof( fontDescriptions ) / sizeof(TXNMacOSPreferredFontDescription) ; - - // kTXNAlwaysUseQuickDrawTextMask might be desirable because of speed increases but it crashes the app under OS X upon key stroke -#if 0 - // leads to unexpected content for clients, TODO configurable - OptionBits options = kTXNWantMoviesMask | kTXNWantSoundMask | kTXNWantGraphicsMask ; -#else - OptionBits options = 0 ; -#endif - -#if TARGET_CARBON - if ( !UMAHasAquaLayout() ) -#endif - { - options |= kTXNAlwaysUseQuickDrawTextMask ; - } - TXNInitTextension(fontDescriptions, noOfFontDescriptions, options ); - } - - - UMASetSystemIsInitialized(true); - -} - -/* -Boolean CanUseATSUI() - { - long result; - OSErr err = Gestalt(gestaltATSUVersion, &result); - return (err == noErr); - } -*/ -// process manager -long UMAGetProcessMode() -{ - OSErr err ; - ProcessInfoRec processinfo; - ProcessSerialNumber procno ; - - procno.highLongOfPSN = NULL ; - procno.lowLongOfPSN = kCurrentProcess ; - processinfo.processInfoLength = sizeof(ProcessInfoRec); - processinfo.processName = NULL; - processinfo.processAppSpec = NULL; - - err = ::GetProcessInformation( &procno , &processinfo ) ; - wxASSERT( err == noErr ) ; - return processinfo.processMode ; -} - -bool UMAGetProcessModeDoesActivateOnFGSwitch() -{ - return UMAGetProcessMode() & modeDoesActivateOnFGSwitch ; -} - -// menu manager - -MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding ) -{ - wxString str = wxStripMenuCodes( title ) ; - MenuRef menu ; -#if TARGET_CARBON - CreateNewMenu( id , 0 , &menu ) ; - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding ) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - menu = ::NewMenu( id , ptitle ) ; -#endif - return menu ; -} - -void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding) -{ - wxString str = wxStripMenuCodes( title ) ; -#if TARGET_CARBON - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - SetMenuTitle( menu , ptitle ) ; -#endif -} - -void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding) -{ - wxString str = wxStripMenuCodes( title ) ; -#if TARGET_CARBON - SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - SetMenuItemText( menu , item , ptitle ) ; -#endif -} - - -UInt32 UMAMenuEvent( EventRecord *inEvent ) -{ - return MenuEvent( inEvent ) ; -} - -void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex inItem , bool enable) -{ - if ( enable ) - EnableMenuItem( inMenu , inItem ) ; - else - DisableMenuItem( inMenu , inItem ) ; -} - -void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , SInt16 id ) -{ - MacAppendMenu(menu, "\pA"); - UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding ); - SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ; -} - -void UMAInsertSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , SInt16 id ) -{ - MacInsertMenuItem(menu, "\pA" , item); - UMASetMenuItemText(menu, item , title , encoding); - SetMenuItemHierarchicalID( menu , item , id ) ; -} - -void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry ) -{ - if ( !entry ) - return ; - - UInt8 modifiers = 0 ; - SInt16 key = entry->GetKeyCode() ; - if ( key ) - { - bool explicitCommandKey = false ; - - if ( entry->GetFlags() & wxACCEL_CTRL ) - { - explicitCommandKey = true ; - } - - if (entry->GetFlags() & wxACCEL_ALT ) - { - modifiers |= kMenuOptionModifier ; - } - - if (entry->GetFlags() & wxACCEL_SHIFT) - { - modifiers |= kMenuShiftModifier ; - } - - SInt16 glyph = 0 ; - SInt16 macKey = key ; - if ( key >= WXK_F1 && key <= WXK_F15 ) - { - // for some reasons this must be 0 right now - // everything else leads to just the first function key item - // to be selected. Thanks to Ryan Wilcox for finding out. - macKey = 0 ; - glyph = kMenuF1Glyph + ( key - WXK_F1 ) ; - if ( key >= WXK_F13 ) - glyph += 13 ; - if ( !explicitCommandKey ) - modifiers |= kMenuNoCommandModifier ; - } - else - { - switch( key ) - { - case WXK_BACK : - macKey = kBackspaceCharCode ; - glyph = kMenuDeleteLeftGlyph ; - break ; - case WXK_TAB : - macKey = kTabCharCode ; - glyph = kMenuTabRightGlyph ; - break ; - case kEnterCharCode : - macKey = kEnterCharCode ; - glyph = kMenuEnterGlyph ; - break ; - case WXK_RETURN : - macKey = kReturnCharCode ; - glyph = kMenuReturnGlyph ; - break ; - case WXK_ESCAPE : - macKey = kEscapeCharCode ; - glyph = kMenuEscapeGlyph ; - break ; - case WXK_SPACE : - macKey = ' ' ; - glyph = kMenuSpaceGlyph ; - break ; - case WXK_DELETE : - macKey = kDeleteCharCode ; - glyph = kMenuDeleteRightGlyph ; - break ; - case WXK_CLEAR : - macKey = kClearCharCode ; - glyph = kMenuClearGlyph ; - break ; - case WXK_PRIOR : // PAGE UP - macKey = kPageUpCharCode ; - glyph = kMenuPageUpGlyph ; - break ; - case WXK_NEXT : - macKey = kPageDownCharCode ; - glyph = kMenuPageDownGlyph ; - break ; - case WXK_LEFT : - macKey = kLeftArrowCharCode ; - glyph = kMenuLeftArrowGlyph ; - break ; - case WXK_UP : - macKey = kUpArrowCharCode ; - glyph = kMenuUpArrowGlyph ; - break ; - case WXK_RIGHT : - macKey = kRightArrowCharCode ; - glyph = kMenuRightArrowGlyph ; - break ; - case WXK_DOWN : - macKey = kDownArrowCharCode ; - glyph = kMenuDownArrowGlyph ; - break ; - } - } - - SetItemCmd( menu, item , macKey ); - SetMenuItemModifiers(menu, item , modifiers ) ; - - if ( glyph ) - SetMenuItemKeyGlyph(menu, item , glyph ) ; - } -} - -void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , wxAcceleratorEntry *entry ) -{ - MacAppendMenu(menu, "\pA"); - UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding ); - UMASetMenuItemShortcut( menu , (SInt16) ::CountMenuItems(menu), entry ) ; -} - -void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry ) -{ - MacInsertMenuItem( menu , "\pA" , item) ; - UMASetMenuItemText(menu, item+1 , title , encoding ); - UMASetMenuItemShortcut( menu , item+1 , entry ) ; -} - -// quickdraw - -#if !TARGET_CARBON - -int gPrOpenCounter = 0 ; - -OSStatus UMAPrOpen() -{ - OSErr err = noErr ; - ++gPrOpenCounter ; - if ( gPrOpenCounter == 1 ) - { - PrOpen() ; - err = PrError() ; - wxASSERT( err == noErr ) ; - } - return err ; -} - -OSStatus UMAPrClose() -{ - OSErr err = noErr ; - wxASSERT( gPrOpenCounter >= 1 ) ; - if ( gPrOpenCounter == 1 ) - { - PrClose() ; - err = PrError() ; - wxASSERT( err == noErr ) ; - } - --gPrOpenCounter ; - return err ; -} - -pascal QDGlobalsPtr GetQDGlobalsPtr (void) ; -pascal QDGlobalsPtr GetQDGlobalsPtr (void) -{ - return QDGlobalsPtr (* (Ptr*) LMGetCurrentA5 ( ) - 0xCA); -} - -#endif - -void UMAShowWatchCursor() -{ - OSErr err = noErr; - - CursHandle watchFob = GetCursor (watchCursor); - - if (!watchFob) - err = nilHandleErr; - else - { - #if TARGET_CARBON -// Cursor preservedArrow; -// GetQDGlobalsArrow (&preservedArrow); -// SetQDGlobalsArrow (*watchFob); -// InitCursor ( ); -// SetQDGlobalsArrow (&preservedArrow); - SetCursor (*watchFob); - #else - SetCursor (*watchFob); - #endif - } -} - -void UMAShowArrowCursor() -{ -#if TARGET_CARBON - Cursor arrow; - SetCursor (GetQDGlobalsArrow (&arrow)); -#else - SetCursor (&(qd.arrow)); -#endif -} - -// window manager - -GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) -{ - wxASSERT( inWindowRef != NULL ) ; -#if TARGET_CARBON - return (GrafPtr) GetWindowPort( inWindowRef ) ; -#else - return (GrafPtr) inWindowRef ; -#endif -} - -void UMADisposeWindow( WindowRef inWindowRef ) -{ - wxASSERT( inWindowRef != NULL ) ; - DisposeWindow( inWindowRef ) ; -} - -void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding) -{ -#if TARGET_CARBON - SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( title , ptitle ) ; - SetWTitle( inWindowRef , ptitle ) ; -#endif -} - -// appearance additions - -void UMASetControlTitle( ControlHandle inControl , const wxString& title , wxFontEncoding encoding) -{ -#if TARGET_CARBON - SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( title , ptitle ) ; - SetControlTitle( inControl , ptitle ) ; -#endif -} - -void UMAActivateControl( ControlHandle inControl ) -{ - // we have to add the control after again to the update rgn - // otherwise updates get lost - if ( !IsControlActive( inControl ) ) - { - bool visible = IsControlVisible( inControl ) ; - if ( visible ) - SetControlVisibility( inControl , false , false ) ; - ::ActivateControl( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - } -} - -void UMADrawControl( ControlHandle inControl ) -{ - WindowRef theWindow = GetControlOwner(inControl) ; - wxMacPortStateHelper help( (GrafPtr) GetWindowPort(theWindow) ) ; - RgnHandle updateRgn = NewRgn() ; - GetWindowUpdateRgn( theWindow , updateRgn ) ; - Point zero = { 0 , 0 } ; - LocalToGlobal( &zero ) ; - OffsetRgn( updateRgn , -zero.h , -zero.v ) ; - ::DrawControlInCurrentPort( inControl ) ; - InvalWindowRgn( theWindow, updateRgn) ; - DisposeRgn( updateRgn ) ; -} - -void UMAMoveControl( ControlHandle inControl , short x , short y ) -{ - bool visible = IsControlVisible( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - ::MoveControl( inControl , x , y ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} - -void UMASizeControl( ControlHandle inControl , short x , short y ) -{ - bool visible = IsControlVisible( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - ::SizeControl( inControl , x , y ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} - -void UMADeactivateControl( ControlHandle inControl ) -{ - // we have to add the control after again to the update rgn - // otherwise updates get lost - bool visible = IsControlVisible( inControl ) ; - if ( visible ) - SetControlVisibility( inControl , false , false ) ; - ::DeactivateControl( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} -// shows the control and adds the region to the update region -void UMAShowControl (ControlHandle inControl) -{ - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; -} - -// shows the control and adds the region to the update region -void UMAHideControl (ControlHandle inControl) -{ - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; -} -// keyboard focus -OSErr UMASetKeyboardFocus (WindowPtr inWindow, - ControlHandle inControl, - ControlFocusPart inPart) -{ - OSErr err = noErr; - GrafPtr port ; - GetPort( &port ) ; - - SetPortWindowPort( inWindow ) ; - - err = SetKeyboardFocus( inWindow , inControl , inPart ) ; - SetPort( port ) ; - return err ; -} - - -// events -void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) inWindow) ) ; - RgnHandle updateRgn = NewRgn() ; - GetWindowUpdateRgn( inWindow , updateRgn ) ; - - Point zero = { 0 , 0 } ; - LocalToGlobal( &zero ) ; - OffsetRgn( updateRgn , -zero.h , -zero.v ) ; - - UpdateControls( inWindow , inRgn ) ; - InvalWindowRgn( inWindow, updateRgn) ; - DisposeRgn( updateRgn ) ; -} - -bool UMAIsWindowFloating( WindowRef inWindow ) -{ - WindowClass cl ; - - GetWindowClass( inWindow , &cl ) ; - return cl == kFloatingWindowClass ; -} - -bool UMAIsWindowModal( WindowRef inWindow ) -{ - WindowClass cl ; - - GetWindowClass( inWindow , &cl ) ; - return cl < kFloatingWindowClass ; -} - -// others - -void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) -{ - if ( inWindowRef ) - { -// bool isHighlighted = IsWindowHighlited( inWindowRef ) ; -// if ( inActivate != isHightlited ) - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort( inWindowRef ) ; - HiliteWindow( inWindowRef , inActivate ) ; - ControlHandle control = NULL ; - ::GetRootControl( inWindowRef , & control ) ; - if ( control ) - { - if ( inActivate ) - UMAActivateControl( control ) ; - else - UMADeactivateControl( control ) ; - } - SetPort( port ) ; - } -} - -OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) -{ - return ::DrawThemePlacard( inRect , inState ) ; -} - -#if !TARGET_CARBON -static OSStatus helpMenuStatus = noErr ; -static MenuItemIndex firstCustomItemIndex = 0 ; -#endif - -OSStatus UMAGetHelpMenu( - MenuRef * outHelpMenu, - MenuItemIndex * outFirstCustomItemIndex) -{ -#if TARGET_CARBON - return HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ; -#else - MenuRef helpMenuHandle ; - helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ; - if ( firstCustomItemIndex == 0 && helpMenuStatus == noErr ) - { - firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ; - } - if ( outFirstCustomItemIndex ) - { - *outFirstCustomItemIndex = firstCustomItemIndex ; - } - *outHelpMenu = helpMenuHandle ; - return helpMenuStatus ; -#endif -} - -wxMacPortStateHelper::wxMacPortStateHelper( GrafPtr newport) -{ - m_clip = NULL ; - Setup( newport ) ; -} - -wxMacPortStateHelper::wxMacPortStateHelper() -{ - m_clip = NULL ; -} - -void wxMacPortStateHelper::Setup( GrafPtr newport ) -{ - GetPort( &m_oldPort ) ; - SetPort( newport ) ; - SetOrigin(0,0); - wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ; - m_clip = NewRgn() ; - GetClip( m_clip ); - m_textFont = GetPortTextFont( (CGrafPtr) newport); - m_textSize = GetPortTextSize( (CGrafPtr) newport); - m_textStyle = GetPortTextFace( (CGrafPtr) newport); - m_textMode = GetPortTextMode( (CGrafPtr) newport); - GetThemeDrawingState( &m_drawingState ) ; - m_currentPort = newport ; -} -void wxMacPortStateHelper::Clear() -{ - if ( m_clip ) - { - DisposeRgn( m_clip ) ; - DisposeThemeDrawingState( m_drawingState ) ; - m_clip = NULL ; - } -} - -wxMacPortStateHelper::~wxMacPortStateHelper() -{ - if ( m_clip ) - { - SetPort( m_currentPort ) ; - SetClip( m_clip ) ; - DisposeRgn( m_clip ) ; - TextFont( m_textFont ); - TextSize( m_textSize ); - TextFace( m_textStyle ); - TextMode( m_textMode ); - SetThemeDrawingState( m_drawingState , true ) ; - SetPort( m_oldPort ) ; - } -} - -OSStatus UMAPutScrap( Size size , OSType type , void *data ) -{ - OSStatus err = noErr ; -#if !TARGET_CARBON - err = PutScrap( size , type , data ) ; -#else - ScrapRef scrap; - err = GetCurrentScrap (&scrap); - if ( !err ) - { - err = PutScrapFlavor (scrap, type , 0, size, data); - } -#endif - return err ; -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -static bool sUMASystemInitialized = false ; - -bool UMASystemIsInitialized() -{ - return sUMASystemInitialized ; -} - -void UMASetSystemIsInitialized(bool val) -{ - sUMASystemInitialized = val; -} - - -#endif // wxUSE_BASE diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp deleted file mode 100644 index b64f77fae0..0000000000 --- a/src/mac/carbon/utils.cpp +++ /dev/null @@ -1,1395 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp -// Purpose: Various utilities -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -// Note: this is done in utilscmn.cpp now. -// #pragma implementation "utils.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/apptrait.h" - -#if wxUSE_GUI - #include "wx/mac/uma.h" - #include "wx/font.h" -#else - #include "wx/intl.h" -#endif - -#include - -#include -#include -#include -#include - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -#ifndef __DARWIN__ -#include -#include -#endif - -#include -#include -#include - -#include "wx/mac/private.h" // includes mac headers - -#if defined(__MWERKS__) && wxUSE_UNICODE - #include -#endif - -// --------------------------------------------------------------------------- -// code used in both base and GUI compilation -// --------------------------------------------------------------------------- - -// our OS version is the same in non GUI and GUI cases -static int DoGetOSVersion(int *majorVsn, int *minorVsn) -{ - long theSystem ; - - // are there x-platform conventions ? - - Gestalt(gestaltSystemVersion, &theSystem) ; - if (minorVsn != NULL) { - *minorVsn = (theSystem & 0xFF ) ; - } - if (majorVsn != NULL) { - *majorVsn = (theSystem >> 8 ) ; - } -#ifdef __DARWIN__ - return wxMAC_DARWIN; -#else - return wxMAC; -#endif -} - -#if wxUSE_BASE - -#ifndef __DARWIN__ -// defined in unix/utilsunx.cpp for Mac OS X - -// get full hostname (with domain name if possible) -bool wxGetFullHostName(wxChar *buf, int maxSize) -{ - return wxGetHostName(buf, maxSize); -} - -// Get hostname only (without domain name) -bool wxGetHostName(wxChar *buf, int maxSize) -{ - // Gets Chooser name of user by examining a System resource. - - const short kComputerNameID = -16413; - - short oldResFile = CurResFile() ; - UseResFile(0); - StringHandle chooserName = (StringHandle)::GetString(kComputerNameID); - UseResFile(oldResFile); - - if (chooserName && *chooserName) - { - HLock( (Handle) chooserName ) ; - wxString name = wxMacMakeStringFromPascal( *chooserName ) ; - HUnlock( (Handle) chooserName ) ; - ReleaseResource( (Handle) chooserName ) ; - wxStrncpy( buf , name , maxSize - 1 ) ; - } - else - buf[0] = 0 ; - - return TRUE; -} - -// Get user ID e.g. jacs -bool wxGetUserId(wxChar *buf, int maxSize) -{ - return wxGetUserName( buf , maxSize ) ; -} - -const wxChar* wxGetHomeDir(wxString *pstr) -{ - *pstr = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ; - return pstr->c_str() ; -} - -// Get user name e.g. Stefan Csomor -bool wxGetUserName(wxChar *buf, int maxSize) -{ - // Gets Chooser name of user by examining a System resource. - - const short kChooserNameID = -16096; - - short oldResFile = CurResFile() ; - UseResFile(0); - StringHandle chooserName = (StringHandle)::GetString(kChooserNameID); - UseResFile(oldResFile); - - if (chooserName && *chooserName) - { - HLock( (Handle) chooserName ) ; - wxString name = wxMacMakeStringFromPascal( *chooserName ) ; - HUnlock( (Handle) chooserName ) ; - ReleaseResource( (Handle) chooserName ) ; - wxStrncpy( buf , name , maxSize - 1 ) ; - } - else - buf[0] = 0 ; - - return TRUE; -} - -int wxKill(long pid, wxSignal sig , wxKillError *rc ) -{ - // TODO - return 0; -} - -WXDLLEXPORT bool wxGetEnv(const wxString& var, wxString *value) -{ - // TODO : under classic there is no environement support, under X yes - return false ; -} - -// set the env var name to the given value, return TRUE on success -WXDLLEXPORT bool wxSetEnv(const wxString& var, const wxChar *value) -{ - // TODO : under classic there is no environement support, under X yes - return false ; -} - -// -// Execute a program in an Interactive Shell -// -bool wxShell(const wxString& command) -{ - // TODO - return FALSE; -} - -// Shutdown or reboot the PC -bool wxShutdown(wxShutdownFlags wFlags) -{ - // TODO - return FALSE; -} - -// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -long wxGetFreeMemory() -{ - return FreeMem() ; -} - -void wxUsleep(unsigned long milliseconds) -{ - clock_t start = clock() ; - do - { - YieldToAnyThread() ; - } while( clock() - start < milliseconds / 1000.0 * CLOCKS_PER_SEC ) ; -} - -void wxSleep(int nSecs) -{ - wxUsleep(1000*nSecs); -} - -// Consume all events until no more left -void wxFlushEvents() -{ -} - -#endif // !__DARWIN__ - -// Emit a beeeeeep -void wxBell() -{ - SysBeep(30); -} - -wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo() -{ - static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); - info.name = _T("wxBase"); - return info; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() -{ - static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); - info.shortName = _T("mac"); - info.name = _T("wxMac"); -#ifdef __WXUNIVERSAL__ - info.shortName << _T("univ"); - info.name << _T("/wxUniversal"); -#endif - return info; -} - -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%.4f"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%ld"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%d"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} -#endif // wxUSE_RESOURCES - -int gs_wxBusyCursorCount = 0; -extern wxCursor gMacCurrentCursor ; -wxCursor gMacStoredActiveCursor ; - -// Set the cursor to the busy cursor for all windows -void wxBeginBusyCursor(wxCursor *cursor) -{ - if (gs_wxBusyCursorCount++ == 0) - { - gMacStoredActiveCursor = gMacCurrentCursor ; - cursor->MacInstall() ; - } - //else: nothing to do, already set -} - -// Restore cursor to normal -void wxEndBusyCursor() -{ - wxCHECK_RET( gs_wxBusyCursorCount > 0, - wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()") ); - - if (--gs_wxBusyCursorCount == 0) - { - gMacStoredActiveCursor.MacInstall() ; - gMacStoredActiveCursor = wxNullCursor ; - } -} - -// TRUE if we're between the above two calls -bool wxIsBusy() -{ - return (gs_wxBusyCursorCount > 0); -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -wxString wxMacFindFolder( short vol, - OSType folderType, - Boolean createFolder) -{ - short vRefNum ; - long dirID ; - wxString strDir ; - - if ( FindFolder( vol, folderType, createFolder, &vRefNum, &dirID) == noErr) - { - FSSpec file ; - if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr ) - { - strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ; - } - } - return strDir ; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -// Check whether this window wants to process messages, e.g. Stop button -// in long calculations. -bool wxCheckForInterrupt(wxWindow *wnd) -{ - // TODO - return FALSE; -} - -void wxGetMousePosition( int* x, int* y ) -{ - Point pt ; - - GetMouse( &pt ) ; - LocalToGlobal( &pt ) ; - *x = pt.h ; - *y = pt.v ; -}; - -// Return TRUE if we have a colour display -bool wxColourDisplay() -{ - return TRUE; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - Rect globRect ; - SetRect(&globRect, -32760, -32760, 32760, 32760); - GDHandle theMaxDevice; - - int theDepth = 8; - theMaxDevice = GetMaxDevice(&globRect); - if (theMaxDevice != nil) - theDepth = (**(**theMaxDevice).gdPMap).pixelSize; - - return theDepth ; -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - if (width != NULL) { - *width = screenBits.bounds.right - screenBits.bounds.left ; - } - if (height != NULL) { - *height = screenBits.bounds.bottom - screenBits.bounds.top ; - } -} - -void wxDisplaySizeMM(int *width, int *height) -{ - wxDisplaySize(width, height); - // on mac 72 is fixed (at least now ;-) - float cvPt2Mm = 25.4 / 72; - - if (width != NULL) { - *width = int( *width * cvPt2Mm ); - } - if (height != NULL) { - *height = int( *height * cvPt2Mm ); - } -} - -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ -#if TARGET_CARBON - Rect r ; - GetAvailableWindowPositioningBounds( GetMainDevice() , &r ) ; - if ( x ) - *x = r.left ; - if ( y ) - *y = r.top ; - if ( width ) - *width = r.right - r.left ; - if ( height ) - *height = r.bottom - r.top ; -#else - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - if (x) *x = 0; - if (y) *y = 0; - - if (width != NULL) { - *width = screenBits.bounds.right - screenBits.bounds.left ; - } - if (height != NULL) { - *height = screenBits.bounds.bottom - screenBits.bounds.top ; - } - - SInt16 mheight ; -#if TARGET_CARBON - GetThemeMenuBarHeight( &mheight ) ; -#else - mheight = LMGetMBarHeight() ; -#endif - if (height != NULL) { - *height -= mheight ; - } - if (y) - *y = mheight ; -#endif -} - -wxWindow* wxFindWindowAtPoint(const wxPoint& pt) -{ - return wxGenericFindWindowAtPoint(pt); -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -wxString wxGetOsDescription() -{ -#ifdef WXWIN_OS_DESCRIPTION - // use configure generated description if available - return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION) + wxString(wxT(")")); -#else - return wxT("MacOS") ; //TODO:define further -#endif -} - -#ifndef __DARWIN__ -wxChar *wxGetUserHome (const wxString& user) -{ - // TODO - return NULL; -} - -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) -{ - if ( path.empty() ) - return FALSE; - - wxString p = path ; - if (p[0u] == ':' ) { - p = wxGetCwd() + p ; - } - - int pos = p.Find(':') ; - if ( pos != wxNOT_FOUND ) { - p = p.Mid(1,pos) ; - } - - p = p + wxT(":") ; - - Str255 volumeName ; - XVolumeParam pb ; - - wxMacStringToPascal( p , volumeName ) ; - OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; - if ( err == noErr ) { - if ( pTotal ) { - (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; - } - if ( pFree ) { - (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; - } - } - - return err == noErr ; -} -#endif // !__DARWIN__ - -//--------------------------------------------------------------------------- -// wxMac Specific utility functions -//--------------------------------------------------------------------------- - -void wxMacStringToPascal( const wxString&from , StringPtr to ) -{ - wxCharBuffer buf = from.mb_str( wxConvLocal ) ; - int len = strlen(buf) ; - - if ( len > 255 ) - len = 255 ; - to[0] = len ; - memcpy( (char*) &to[1] , buf , len ) ; -} - -wxString wxMacMakeStringFromPascal( ConstStringPtr from ) -{ - return wxString( (char*) &from[1] , wxConvLocal , from[0] ) ; -} - - -wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) -{ - TextEncodingBase enc = 0 ; - if ( encoding == wxFONTENCODING_DEFAULT ) - { -#if wxUSE_GUI - encoding = wxFont::GetDefaultEncoding() ; -#else - encoding = wxLocale::GetSystemEncoding() ; -#endif - } - - switch( encoding) - { - case wxFONTENCODING_ISO8859_1 : - enc = kTextEncodingISOLatin1 ; - break ; - case wxFONTENCODING_ISO8859_2 : - enc = kTextEncodingISOLatin2; - break ; - case wxFONTENCODING_ISO8859_3 : - enc = kTextEncodingISOLatin3 ; - break ; - case wxFONTENCODING_ISO8859_4 : - enc = kTextEncodingISOLatin4; - break ; - case wxFONTENCODING_ISO8859_5 : - enc = kTextEncodingISOLatinCyrillic; - break ; - case wxFONTENCODING_ISO8859_6 : - enc = kTextEncodingISOLatinArabic; - break ; - case wxFONTENCODING_ISO8859_7 : - enc = kTextEncodingISOLatinGreek; - break ; - case wxFONTENCODING_ISO8859_8 : - enc = kTextEncodingISOLatinHebrew; - break ; - case wxFONTENCODING_ISO8859_9 : - enc = kTextEncodingISOLatin5; - break ; - case wxFONTENCODING_ISO8859_10 : - enc = kTextEncodingISOLatin6; - break ; - case wxFONTENCODING_ISO8859_13 : - enc = kTextEncodingISOLatin7; - break ; - case wxFONTENCODING_ISO8859_14 : - enc = kTextEncodingISOLatin8; - break ; - case wxFONTENCODING_ISO8859_15 : - enc = kTextEncodingISOLatin9; - break ; - - case wxFONTENCODING_KOI8 : - enc = kTextEncodingKOI8_R; - break ; - case wxFONTENCODING_ALTERNATIVE : // MS-DOS CP866 - enc = kTextEncodingDOSRussian; - break ; -/* - case wxFONTENCODING_BULGARIAN : - enc = ; - break ; -*/ - case wxFONTENCODING_CP437 : - enc =kTextEncodingDOSLatinUS ; - break ; - case wxFONTENCODING_CP850 : - enc = kTextEncodingDOSLatin1; - break ; - case wxFONTENCODING_CP852 : - enc = kTextEncodingDOSLatin2; - break ; - case wxFONTENCODING_CP855 : - enc = kTextEncodingDOSCyrillic; - break ; - case wxFONTENCODING_CP866 : - enc =kTextEncodingDOSRussian ; - break ; - case wxFONTENCODING_CP874 : - enc = kTextEncodingDOSThai; - break ; - case wxFONTENCODING_CP932 : - enc = kTextEncodingDOSJapanese; - break ; - case wxFONTENCODING_CP936 : - enc =kTextEncodingDOSChineseSimplif ; - break ; - case wxFONTENCODING_CP949 : - enc = kTextEncodingDOSKorean; - break ; - case wxFONTENCODING_CP950 : - enc = kTextEncodingDOSChineseTrad; - break ; - - case wxFONTENCODING_CP1250 : - enc = kTextEncodingWindowsLatin2; - break ; - case wxFONTENCODING_CP1251 : - enc =kTextEncodingWindowsCyrillic ; - break ; - case wxFONTENCODING_CP1252 : - enc =kTextEncodingWindowsLatin1 ; - break ; - case wxFONTENCODING_CP1253 : - enc = kTextEncodingWindowsGreek; - break ; - case wxFONTENCODING_CP1254 : - enc = kTextEncodingWindowsLatin5; - break ; - case wxFONTENCODING_CP1255 : - enc =kTextEncodingWindowsHebrew ; - break ; - case wxFONTENCODING_CP1256 : - enc =kTextEncodingWindowsArabic ; - break ; - case wxFONTENCODING_CP1257 : - enc = kTextEncodingWindowsBalticRim; - break ; - - case wxFONTENCODING_UTF7 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF7Format) ; - break ; - case wxFONTENCODING_UTF8 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF8Format) ; - break ; - case wxFONTENCODING_EUC_JP : - enc = kTextEncodingEUC_JP; - break ; - case wxFONTENCODING_UTF16BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF16LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF32BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - case wxFONTENCODING_UTF32LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - - case wxFONTENCODING_MACROMAN : - enc = kTextEncodingMacRoman ; - break ; - case wxFONTENCODING_MACJAPANESE : - enc = kTextEncodingMacJapanese ; - break ; - case wxFONTENCODING_MACCHINESETRAD : - enc = kTextEncodingMacChineseTrad ; - break ; - case wxFONTENCODING_MACKOREAN : - enc = kTextEncodingMacKorean ; - break ; - case wxFONTENCODING_MACARABIC : - enc = kTextEncodingMacArabic ; - break ; - case wxFONTENCODING_MACHEBREW : - enc = kTextEncodingMacHebrew ; - break ; - case wxFONTENCODING_MACGREEK : - enc = kTextEncodingMacGreek ; - break ; - case wxFONTENCODING_MACCYRILLIC : - enc = kTextEncodingMacCyrillic ; - break ; - case wxFONTENCODING_MACDEVANAGARI : - enc = kTextEncodingMacDevanagari ; - break ; - case wxFONTENCODING_MACGURMUKHI : - enc = kTextEncodingMacGurmukhi ; - break ; - case wxFONTENCODING_MACGUJARATI : - enc = kTextEncodingMacGujarati ; - break ; - case wxFONTENCODING_MACORIYA : - enc = kTextEncodingMacOriya ; - break ; - case wxFONTENCODING_MACBENGALI : - enc = kTextEncodingMacBengali ; - break ; - case wxFONTENCODING_MACTAMIL : - enc = kTextEncodingMacTamil ; - break ; - case wxFONTENCODING_MACTELUGU : - enc = kTextEncodingMacTelugu ; - break ; - case wxFONTENCODING_MACKANNADA : - enc = kTextEncodingMacKannada ; - break ; - case wxFONTENCODING_MACMALAJALAM : - enc = kTextEncodingMacMalayalam ; - break ; - case wxFONTENCODING_MACSINHALESE : - enc = kTextEncodingMacSinhalese ; - break ; - case wxFONTENCODING_MACBURMESE : - enc = kTextEncodingMacBurmese ; - break ; - case wxFONTENCODING_MACKHMER : - enc = kTextEncodingMacKhmer ; - break ; - case wxFONTENCODING_MACTHAI : - enc = kTextEncodingMacThai ; - break ; - case wxFONTENCODING_MACLAOTIAN : - enc = kTextEncodingMacLaotian ; - break ; - case wxFONTENCODING_MACGEORGIAN : - enc = kTextEncodingMacGeorgian ; - break ; - case wxFONTENCODING_MACARMENIAN : - enc = kTextEncodingMacArmenian ; - break ; - case wxFONTENCODING_MACCHINESESIMP : - enc = kTextEncodingMacChineseSimp ; - break ; - case wxFONTENCODING_MACTIBETAN : - enc = kTextEncodingMacTibetan ; - break ; - case wxFONTENCODING_MACMONGOLIAN : - enc = kTextEncodingMacMongolian ; - break ; - case wxFONTENCODING_MACETHIOPIC : - enc = kTextEncodingMacEthiopic ; - break ; - case wxFONTENCODING_MACCENTRALEUR : - enc = kTextEncodingMacCentralEurRoman ; - break ; - case wxFONTENCODING_MACVIATNAMESE : - enc = kTextEncodingMacVietnamese ; - break ; - case wxFONTENCODING_MACARABICEXT : - enc = kTextEncodingMacExtArabic ; - break ; - case wxFONTENCODING_MACSYMBOL : - enc = kTextEncodingMacSymbol ; - break ; - case wxFONTENCODING_MACDINGBATS : - enc = kTextEncodingMacDingbats ; - break ; - case wxFONTENCODING_MACTURKISH : - enc = kTextEncodingMacTurkish ; - break ; - case wxFONTENCODING_MACCROATIAN : - enc = kTextEncodingMacCroatian ; - break ; - case wxFONTENCODING_MACICELANDIC : - enc = kTextEncodingMacIcelandic ; - break ; - case wxFONTENCODING_MACROMANIAN : - enc = kTextEncodingMacRomanian ; - break ; - case wxFONTENCODING_MACCELTIC : - enc = kTextEncodingMacCeltic ; - break ; - case wxFONTENCODING_MACGAELIC : - enc = kTextEncodingMacGaelic ; - break ; - case wxFONTENCODING_MACKEYBOARD : - enc = kTextEncodingMacKeyboardGlyphs ; - break ; - default : - // to make gcc happy - break ; - } ; - return enc ; -} - -wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) -{ - wxFontEncoding enc = wxFONTENCODING_DEFAULT ; - - switch( encoding) - { - case kTextEncodingISOLatin1 : - enc = wxFONTENCODING_ISO8859_1 ; - break ; - case kTextEncodingISOLatin2 : - enc = wxFONTENCODING_ISO8859_2; - break ; - case kTextEncodingISOLatin3 : - enc = wxFONTENCODING_ISO8859_3 ; - break ; - case kTextEncodingISOLatin4 : - enc = wxFONTENCODING_ISO8859_4; - break ; - case kTextEncodingISOLatinCyrillic : - enc = wxFONTENCODING_ISO8859_5; - break ; - case kTextEncodingISOLatinArabic : - enc = wxFONTENCODING_ISO8859_6; - break ; - case kTextEncodingISOLatinGreek : - enc = wxFONTENCODING_ISO8859_7; - break ; - case kTextEncodingISOLatinHebrew : - enc = wxFONTENCODING_ISO8859_8; - break ; - case kTextEncodingISOLatin5 : - enc = wxFONTENCODING_ISO8859_9; - break ; - case kTextEncodingISOLatin6 : - enc = wxFONTENCODING_ISO8859_10; - break ; - case kTextEncodingISOLatin7 : - enc = wxFONTENCODING_ISO8859_13; - break ; - case kTextEncodingISOLatin8 : - enc = wxFONTENCODING_ISO8859_14; - break ; - case kTextEncodingISOLatin9 : - enc =wxFONTENCODING_ISO8859_15 ; - break ; - - case kTextEncodingKOI8_R : - enc = wxFONTENCODING_KOI8; - break ; -/* - case : - enc = wxFONTENCODING_BULGARIAN; - break ; -*/ - case kTextEncodingDOSLatinUS : - enc = wxFONTENCODING_CP437; - break ; - case kTextEncodingDOSLatin1 : - enc = wxFONTENCODING_CP850; - break ; - case kTextEncodingDOSLatin2 : - enc =wxFONTENCODING_CP852 ; - break ; - case kTextEncodingDOSCyrillic : - enc = wxFONTENCODING_CP855; - break ; - case kTextEncodingDOSRussian : - enc = wxFONTENCODING_CP866; - break ; - case kTextEncodingDOSThai : - enc =wxFONTENCODING_CP874 ; - break ; - case kTextEncodingDOSJapanese : - enc = wxFONTENCODING_CP932; - break ; - case kTextEncodingDOSChineseSimplif : - enc = wxFONTENCODING_CP936; - break ; - case kTextEncodingDOSKorean : - enc = wxFONTENCODING_CP949; - break ; - case kTextEncodingDOSChineseTrad : - enc = wxFONTENCODING_CP950; - break ; - - case kTextEncodingWindowsLatin2 : - enc = wxFONTENCODING_CP1250; - break ; - case kTextEncodingWindowsCyrillic : - enc = wxFONTENCODING_CP1251; - break ; - case kTextEncodingWindowsLatin1 : - enc = wxFONTENCODING_CP1252; - break ; - case kTextEncodingWindowsGreek : - enc = wxFONTENCODING_CP1253; - break ; - case kTextEncodingWindowsLatin5 : - enc = wxFONTENCODING_CP1254; - break ; - case kTextEncodingWindowsHebrew : - enc = wxFONTENCODING_CP1255; - break ; - case kTextEncodingWindowsArabic : - enc = wxFONTENCODING_CP1256; - break ; - case kTextEncodingWindowsBalticRim : - enc =wxFONTENCODING_CP1257 ; - break ; - case kTextEncodingEUC_JP : - enc = wxFONTENCODING_EUC_JP; - break ; - /* - case wxFONTENCODING_UTF7 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF7Format) ; - break ; - case wxFONTENCODING_UTF8 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF8Format) ; - break ; - case wxFONTENCODING_UTF16BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF16LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF32BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - case wxFONTENCODING_UTF32LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - */ - case kTextEncodingMacRoman : - enc = wxFONTENCODING_MACROMAN ; - break ; - case kTextEncodingMacJapanese : - enc = wxFONTENCODING_MACJAPANESE ; - break ; - case kTextEncodingMacChineseTrad : - enc = wxFONTENCODING_MACCHINESETRAD ; - break ; - case kTextEncodingMacKorean : - enc = wxFONTENCODING_MACKOREAN ; - break ; - case kTextEncodingMacArabic : - enc =wxFONTENCODING_MACARABIC ; - break ; - case kTextEncodingMacHebrew : - enc = wxFONTENCODING_MACHEBREW ; - break ; - case kTextEncodingMacGreek : - enc = wxFONTENCODING_MACGREEK ; - break ; - case kTextEncodingMacCyrillic : - enc = wxFONTENCODING_MACCYRILLIC ; - break ; - case kTextEncodingMacDevanagari : - enc = wxFONTENCODING_MACDEVANAGARI ; - break ; - case kTextEncodingMacGurmukhi : - enc = wxFONTENCODING_MACGURMUKHI ; - break ; - case kTextEncodingMacGujarati : - enc = wxFONTENCODING_MACGUJARATI ; - break ; - case kTextEncodingMacOriya : - enc =wxFONTENCODING_MACORIYA ; - break ; - case kTextEncodingMacBengali : - enc =wxFONTENCODING_MACBENGALI ; - break ; - case kTextEncodingMacTamil : - enc = wxFONTENCODING_MACTAMIL ; - break ; - case kTextEncodingMacTelugu : - enc = wxFONTENCODING_MACTELUGU ; - break ; - case kTextEncodingMacKannada : - enc = wxFONTENCODING_MACKANNADA ; - break ; - case kTextEncodingMacMalayalam : - enc = wxFONTENCODING_MACMALAJALAM ; - break ; - case kTextEncodingMacSinhalese : - enc = wxFONTENCODING_MACSINHALESE ; - break ; - case kTextEncodingMacBurmese : - enc = wxFONTENCODING_MACBURMESE ; - break ; - case kTextEncodingMacKhmer : - enc = wxFONTENCODING_MACKHMER ; - break ; - case kTextEncodingMacThai : - enc = wxFONTENCODING_MACTHAI ; - break ; - case kTextEncodingMacLaotian : - enc = wxFONTENCODING_MACLAOTIAN ; - break ; - case kTextEncodingMacGeorgian : - enc = wxFONTENCODING_MACGEORGIAN ; - break ; - case kTextEncodingMacArmenian : - enc = wxFONTENCODING_MACARMENIAN ; - break ; - case kTextEncodingMacChineseSimp : - enc = wxFONTENCODING_MACCHINESESIMP ; - break ; - case kTextEncodingMacTibetan : - enc = wxFONTENCODING_MACTIBETAN ; - break ; - case kTextEncodingMacMongolian : - enc = wxFONTENCODING_MACMONGOLIAN ; - break ; - case kTextEncodingMacEthiopic : - enc = wxFONTENCODING_MACETHIOPIC ; - break ; - case kTextEncodingMacCentralEurRoman: - enc = wxFONTENCODING_MACCENTRALEUR ; - break ; - case kTextEncodingMacVietnamese: - enc = wxFONTENCODING_MACVIATNAMESE ; - break ; - case kTextEncodingMacExtArabic : - enc = wxFONTENCODING_MACARABICEXT ; - break ; - case kTextEncodingMacSymbol : - enc = wxFONTENCODING_MACSYMBOL ; - break ; - case kTextEncodingMacDingbats : - enc = wxFONTENCODING_MACDINGBATS ; - break ; - case kTextEncodingMacTurkish : - enc = wxFONTENCODING_MACTURKISH ; - break ; - case kTextEncodingMacCroatian : - enc = wxFONTENCODING_MACCROATIAN ; - break ; - case kTextEncodingMacIcelandic : - enc = wxFONTENCODING_MACICELANDIC ; - break ; - case kTextEncodingMacRomanian : - enc = wxFONTENCODING_MACROMANIAN ; - break ; - case kTextEncodingMacCeltic : - enc = wxFONTENCODING_MACCELTIC ; - break ; - case kTextEncodingMacGaelic : - enc = wxFONTENCODING_MACGAELIC ; - break ; - case kTextEncodingMacKeyboardGlyphs : - enc = wxFONTENCODING_MACKEYBOARD ; - break ; - } ; - return enc ; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - - -// -// CFStringRefs (Carbon only) -// - -#if TARGET_CARBON - -// converts this string into a carbon foundation string with optional pc 2 mac encoding -void wxMacCFStringHolder::Assign( const wxString &st , wxFontEncoding encoding ) -{ - Release() ; - - wxString str = st ; - wxMacConvertNewlines13To10( &str ) ; -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault, - (UniChar*)str.wc_str() , str.Len() ); -#else - wxMBConvUTF16BE converter ; - size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ; - UniChar *unibuf = new UniChar[ unicharlen / sizeof(UniChar) + 1 ] ; - converter.WC2MB( (char*)unibuf , str.wc_str() , unicharlen ) ; - m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault , - unibuf , unicharlen / sizeof(UniChar) ) ; - delete[] unibuf ; -#endif -#else // not wxUSE_UNICODE - m_cfs = CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() , - wxMacGetSystemEncFromFontEnc( encoding ) ) ; -#endif - m_release = true ; -} - -wxString wxMacCFStringHolder::AsString(wxFontEncoding encoding) -{ - Size cflen = CFStringGetLength( m_cfs ) ; - size_t noChars ; - wxChar* buf = NULL ; - -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - buf = new wxChar[ cflen + 1 ] ; - CFStringGetCharacters( m_cfs , CFRangeMake( 0 , cflen ) , (UniChar*) buf ) ; - noChars = cflen ; -#else - UniChar* unibuf = new UniChar[ cflen + 1 ] ; - CFStringGetCharacters( m_cfs , CFRangeMake( 0 , cflen ) , (UniChar*) unibuf ) ; - unibuf[cflen] = 0 ; - wxMBConvUTF16BE converter ; - noChars = converter.MB2WC( NULL , (const char*)unibuf , 0 ) ; - buf = new wxChar[ noChars + 1 ] ; - converter.MB2WC( buf , (const char*)unibuf , noChars ) ; - delete[] unibuf ; -#endif -#else - CFIndex cStrLen ; - CFStringGetBytes( m_cfs , CFRangeMake(0, cflen) , wxMacGetSystemEncFromFontEnc( encoding ) , - '?' , false , NULL , 0 , &cStrLen ) ; - buf = new wxChar[ cStrLen + 1 ] ; - CFStringGetBytes( m_cfs , CFRangeMake(0, cflen) , wxMacGetSystemEncFromFontEnc( encoding ) , - '?' , false , (unsigned char*) buf , cStrLen , &cStrLen) ; - noChars = cStrLen ; -#endif - - buf[noChars] = 0 ; - wxMacConvertNewlines10To13( buf ) ; - wxString result(buf) ; - delete[] buf ; - return result ; -} - -#endif //TARGET_CARBON - -void wxMacConvertNewlines13To10( char * data ) -{ - char * buf = data ; - while( (buf=strchr(buf,0x0d)) != NULL ) - { - *buf = 0x0a ; - buf++ ; - } -} - -void wxMacConvertNewlines10To13( char * data ) -{ - char * buf = data ; - while( (buf=strchr(buf,0x0a)) != NULL ) - { - *buf = 0x0d ; - buf++ ; - } -} - -void wxMacConvertNewlines13To10( wxString * data ) -{ - size_t len = data->Length() ; - - if ( len == 0 || wxStrchr(data->c_str(),0x0d)==NULL) - return ; - - wxString temp(*data) ; - wxStringBuffer buf(*data,len ) ; - memcpy( buf , temp.c_str() , (len+1)*sizeof(wxChar) ) ; - - wxMacConvertNewlines13To10( buf ) ; -} - -void wxMacConvertNewlines10To13( wxString * data ) -{ - size_t len = data->Length() ; - - if ( data->Length() == 0 || wxStrchr(data->c_str(),0x0a)==NULL) - return ; - - wxString temp(*data) ; - wxStringBuffer buf(*data,len ) ; - memcpy( buf , temp.c_str() , (len+1)*sizeof(wxChar) ) ; - wxMacConvertNewlines10To13( buf ) ; -} - - -#if wxUSE_UNICODE -void wxMacConvertNewlines13To10( wxChar * data ) -{ - wxChar * buf = data ; - while( (buf=wxStrchr(buf,0x0d)) != NULL ) - { - *buf = 0x0a ; - buf++ ; - } -} - -void wxMacConvertNewlines10To13( wxChar * data ) -{ - wxChar * buf = data ; - while( (buf=wxStrchr(buf,0x0a)) != NULL ) - { - *buf = 0x0d ; - buf++ ; - } -} -#endif - -// ---------------------------------------------------------------------------- -// debugging support -// ---------------------------------------------------------------------------- - -#if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400) - -// MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds... - -#ifndef __MetroNubUtils__ -#include "MetroNubUtils.h" -#endif - -#ifndef __GESTALT__ -#include -#endif - -#if TARGET_API_MAC_CARBON - - #include - - extern "C" long CallUniversalProc(UniversalProcPtr theProcPtr, ProcInfoType procInfo, ...); - - ProcPtr gCallUniversalProc_Proc = NULL; - -#endif - -static MetroNubUserEntryBlock* gMetroNubEntry = NULL; - -static long fRunOnce = false; - -/* --------------------------------------------------------------------------- - IsMetroNubInstalled - --------------------------------------------------------------------------- */ - -Boolean IsMetroNubInstalled() -{ - if (!fRunOnce) - { - long result, value; - - fRunOnce = true; - gMetroNubEntry = NULL; - - if (Gestalt(gestaltSystemVersion, &value) == noErr && value < 0x1000) - { - /* look for MetroNub's Gestalt selector */ - if (Gestalt(kMetroNubUserSignature, &result) == noErr) - { - - #if TARGET_API_MAC_CARBON - if (gCallUniversalProc_Proc == NULL) - { - CFragConnectionID connectionID; - Ptr mainAddress; - Str255 errorString; - ProcPtr symbolAddress; - OSErr err; - CFragSymbolClass symbolClass; - - symbolAddress = NULL; - err = GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch, kFindCFrag, - &connectionID, &mainAddress, errorString); - - if (err != noErr) - { - gCallUniversalProc_Proc = NULL; - goto end; - } - - err = FindSymbol(connectionID, "\pCallUniversalProc", - (Ptr *) &gCallUniversalProc_Proc, &symbolClass); - - if (err != noErr) - { - gCallUniversalProc_Proc = NULL; - goto end; - } - } - #endif - - { - MetroNubUserEntryBlock* block = (MetroNubUserEntryBlock *)result; - - /* make sure the version of the API is compatible */ - if (block->apiLowVersion <= kMetroNubUserAPIVersion && - kMetroNubUserAPIVersion <= block->apiHiVersion) - gMetroNubEntry = block; /* success! */ - } - - } - } - } - -end: - -#if TARGET_API_MAC_CARBON - return (gMetroNubEntry != NULL && gCallUniversalProc_Proc != NULL); -#else - return (gMetroNubEntry != NULL); -#endif -} - -/* --------------------------------------------------------------------------- - IsMWDebuggerRunning [v1 API] - --------------------------------------------------------------------------- */ - -Boolean IsMWDebuggerRunning() -{ - if (IsMetroNubInstalled()) - return CallIsDebuggerRunningProc(gMetroNubEntry->isDebuggerRunning); - else - return false; -} - -/* --------------------------------------------------------------------------- - AmIBeingMWDebugged [v1 API] - --------------------------------------------------------------------------- */ - -Boolean AmIBeingMWDebugged() -{ - if (IsMetroNubInstalled()) - return CallAmIBeingDebuggedProc(gMetroNubEntry->amIBeingDebugged); - else - return false; -} - -extern bool WXDLLEXPORT wxIsDebuggerRunning() -{ - return IsMWDebuggerRunning() && AmIBeingMWDebugged(); -} - -#else - -extern bool WXDLLEXPORT wxIsDebuggerRunning() -{ - return false; -} - -#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) - -#endif // wxUSE_GUI - diff --git a/src/mac/carbon/utilsexc.cpp b/src/mac/carbon/utilsexc.cpp deleted file mode 100644 index f270694d38..0000000000 --- a/src/mac/carbon/utilsexc.cpp +++ /dev/null @@ -1,223 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utilsexec.cpp -// Purpose: Execution-related utilities -// Author: Stefan Csomor -// Modified by: David Elliott -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -//#pragma implementation -#endif - -#include "wx/log.h" -#include "wx/utils.h" -#ifdef __DARWIN__ -#include "wx/unix/execute.h" -#include -#include -extern "C" { -#include -} -#include -#endif - -#include -#include -#include - -#ifndef __DARWIN__ -#define wxEXECUTE_WIN_MESSAGE 10000 - -#include "wx/mac/private.h" - -/* -Below FinderLaunch function comes from: -http://developer.apple.com/technotes/tn/tn1002.html#fndrask -*/ - /* FinderLaunch converts a list of nTargets FSSpec records - pointed to by the targetList parameter and converts the - list to an Apple Event. It then sends that event to the - Finder. The array of FSSpec records pointed to by the - targetList parameter may contain references to files, - folders, or applications. The net effect of this command - is equivalent to the user selecting an icon in one of the - Finder's windows and then choosing the open command from - the Finder's file menu. */ -static OSErr FinderLaunch(long nTargets, FSSpec *targetList) { - OSErr err; - AppleEvent theAEvent, theReply; - AEAddressDesc fndrAddress; - AEDescList targetListDesc; - OSType fndrCreator; - Boolean wasChanged; - AliasHandle targetAlias; - long index; - - /* set up locals */ - AECreateDesc(typeNull, NULL, 0, &theAEvent); - AECreateDesc(typeNull, NULL, 0, &fndrAddress); - AECreateDesc(typeNull, NULL, 0, &theReply); - AECreateDesc(typeNull, NULL, 0, &targetListDesc); - targetAlias = NULL; - fndrCreator = 'MACS'; - - /* verify parameters */ - if ((nTargets == 0) || (targetList == NULL)) { - err = paramErr; - goto bail; - } - - /* create an open documents event targeting the - finder */ - err = AECreateDesc(typeApplSignature, (Ptr) &fndrCreator, - sizeof(fndrCreator), &fndrAddress); - if (err != noErr) goto bail; - err = AECreateAppleEvent(kCoreEventClass, kAEOpenDocuments, - &fndrAddress, kAutoGenerateReturnID, - kAnyTransactionID, &theAEvent); - if (err != noErr) goto bail; - - /* create the list of files to open */ - err = AECreateList(NULL, 0, false, &targetListDesc); - if (err != noErr) goto bail; - for ( index=0; index < nTargets; index++) { - if (targetAlias == NULL) - err = NewAlias(NULL, (targetList + index), - &targetAlias); - else err = UpdateAlias(NULL, (targetList + index), - targetAlias, &wasChanged); - if (err != noErr) goto bail; - HLock((Handle) targetAlias); - err = AEPutPtr(&targetListDesc, (index + 1), - typeAlias, *targetAlias, - GetHandleSize((Handle) targetAlias)); - HUnlock((Handle) targetAlias); - if (err != noErr) goto bail; - } - - /* add the file list to the Apple Event */ - err = AEPutParamDesc(&theAEvent, keyDirectObject, - &targetListDesc); - if (err != noErr) goto bail; - - /* send the event to the Finder */ - err = AESend(&theAEvent, &theReply, kAENoReply, - kAENormalPriority, kAEDefaultTimeout, NULL, NULL); - - /* clean up and leave */ -bail: - if (targetAlias != NULL) DisposeHandle((Handle) targetAlias); - AEDisposeDesc(&targetListDesc); - AEDisposeDesc(&theAEvent); - AEDisposeDesc(&fndrAddress); - AEDisposeDesc(&theReply); - return err; -} - -long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler)) -{ - wxASSERT_MSG( flags == wxEXEC_ASYNC, - wxT("wxExecute: Only wxEXEC_ASYNC is supported") ); - - FSSpec fsSpec; - wxMacFilename2FSSpec(command, &fsSpec); - - // 0 means execution failed. Returning non-zero is a PID, but not - // on Mac where PIDs are 64 bits and won't fit in a long, so we - // return a dummy value for now. - return ( FinderLaunch(1 /*one file*/, &fsSpec) == noErr ) ? -1 : 0; -} - -#endif - -#ifdef __DARWIN__ -void wxMAC_MachPortEndProcessDetect(CFMachPortRef port, void *data) -{ - wxEndProcessData *proc_data = (wxEndProcessData*)data; - wxLogDebug(wxT("Wow.. this actually worked!")); - int status = 0; - int rc = waitpid(abs(proc_data->pid), &status, WNOHANG); - if(!rc) - { - wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!")); - return; - } - if((rc != -1) && WIFEXITED(status)) - proc_data->exitcode = WEXITSTATUS(status); - else - proc_data->exitcode = -1; - wxHandleProcessTermination(proc_data); -} - -int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid) -{ - if(pid < 1) - return -1; - kern_return_t kernResult; - mach_port_t taskOfOurProcess; - mach_port_t machPortForProcess; - taskOfOurProcess = mach_task_self(); - if(taskOfOurProcess == MACH_PORT_NULL) - { - wxLogDebug(wxT("No mach_task_self()")); - return -1; - } - wxLogDebug(wxT("pid=%d"),pid); - kernResult = task_for_pid(taskOfOurProcess,pid, &machPortForProcess); - if(kernResult != KERN_SUCCESS) - { - wxLogDebug(wxT("no task_for_pid()")); - // try seeing if it is already dead or something - // FIXME: a better method would be to call the callback function - // from idle time until the process terminates. Of course, how - // likely is it that it will take more than 0.1 seconds for the - // mach terminate event to make its way to the BSD subsystem? - usleep(100); // sleep for 0.1 seconds - wxMAC_MachPortEndProcessDetect(NULL, (void*)proc_data); - return -1; - } - CFMachPortContext termcb_contextinfo; - termcb_contextinfo.version = NULL; - termcb_contextinfo.info = (void*)proc_data; - termcb_contextinfo.retain = NULL; - termcb_contextinfo.release = NULL; - termcb_contextinfo.copyDescription = NULL; - CFMachPortRef CFMachPortForProcess; - Boolean ShouldFreePort; - CFMachPortForProcess = CFMachPortCreateWithPort(NULL, machPortForProcess, NULL, &termcb_contextinfo, &ShouldFreePort); - if(!CFMachPortForProcess) - { - wxLogDebug(wxT("No CFMachPortForProcess")); - mach_port_deallocate(taskOfOurProcess, machPortForProcess); - return -1; - } - if(ShouldFreePort) - { - kernResult = mach_port_deallocate(taskOfOurProcess, machPortForProcess); - if(kernResult!=KERN_SUCCESS) - { - wxLogDebug(wxT("Couldn't deallocate mach port")); - return -1; - } - } - CFMachPortSetInvalidationCallBack(CFMachPortForProcess, &wxMAC_MachPortEndProcessDetect); - CFRunLoopSourceRef runloopsource; - runloopsource = CFMachPortCreateRunLoopSource(NULL,CFMachPortForProcess, (CFIndex)0); - if(!runloopsource) - { - wxLogDebug(wxT("Couldn't create runloopsource")); - return -1; - } - - CFRelease(CFMachPortForProcess); - - CFRunLoopAddSource(CFRunLoopGetCurrent(),runloopsource,kCFRunLoopDefaultMode); - CFRelease(runloopsource); - wxLogDebug(wxT("Successfully added notification to the runloop")); - return 0; -} -#endif diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp deleted file mode 100644 index a5c56e4202..0000000000 --- a/src/mac/carbon/window.cpp +++ /dev/null @@ -1,2096 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp -// Purpose: wxWindowMac -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "window.h" -#endif - -#include "wx/setup.h" -#include "wx/menu.h" -#include "wx/window.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/panel.h" -#include "wx/layout.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/scrolbar.h" -#include "wx/statbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" -#include "wx/frame.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/tooltip.h" -#include "wx/statusbr.h" -#include "wx/menuitem.h" -#include "wx/spinctrl.h" -#include "wx/log.h" -#include "wx/geometry.h" - -#if wxUSE_CARET - #include "wx/caret.h" -#endif // wxUSE_CARET - -#define wxWINDOW_HSCROLL 5998 -#define wxWINDOW_VSCROLL 5997 -#define MAC_SCROLLBAR_SIZE 16 - -#include "wx/mac/uma.h" -#ifndef __DARWIN__ -#include -#include -#endif - -#if wxUSE_DRAG_AND_DROP -#include "wx/dnd.h" -#endif - -#include - -extern wxList wxPendingDelete; -wxWindowMac* gFocusWindow = NULL ; - -#ifdef __WXUNIVERSAL__ - IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase) -#else // __WXMAC__ - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) -#endif // __WXUNIVERSAL__/__WXMAC__ - -#if !USE_SHARED_LIBRARY - -BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase) - EVT_NC_PAINT(wxWindowMac::OnNcPaint) - EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground) - EVT_SYS_COLOUR_CHANGED(wxWindowMac::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindowMac::OnInitDialog) - EVT_SET_FOCUS(wxWindowMac::OnSetFocus) - EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent) -END_EVENT_TABLE() - -#endif - -#define wxMAC_DEBUG_REDRAW 0 -#ifndef wxMAC_DEBUG_REDRAW -#define wxMAC_DEBUG_REDRAW 0 -#endif - -#define wxMAC_USE_THEME_BORDER 0 - - -// =========================================================================== -// implementation -// =========================================================================== - - -// ---------------------------------------------------------------------------- -// constructors and such -// ---------------------------------------------------------------------------- - -void wxWindowMac::Init() -{ - m_backgroundTransparent = FALSE; - - // as all windows are created with WS_VISIBLE style... - m_isShown = TRUE; - - m_x = 0; - m_y = 0 ; - m_width = 0 ; - m_height = 0 ; - - m_hScrollBar = NULL ; - m_vScrollBar = NULL ; -} - -// Destructor -wxWindowMac::~wxWindowMac() -{ - SendDestroyEvent(); - - // deleting a window while it is shown invalidates the region - if ( IsShown() ) { - wxWindowMac* iter = this ; - while( iter ) { - if ( iter->IsTopLevel() ) - { - Refresh() ; - break ; - } - iter = iter->GetParent() ; - - } - } - - m_isBeingDeleted = TRUE; - -#ifndef __WXUNIVERSAL__ - // VS: make sure there's no wxFrame with last focus set to us: - for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) - { - wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - { - frame->SetLastFocus((wxWindow*)NULL); - } - break; - } - } -#endif // __WXUNIVERSAL__ - - if ( s_lastMouseWindow == this ) - { - s_lastMouseWindow = NULL ; - } - - wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ; - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - frame->SetLastFocus( NULL ) ; - } - - if ( gFocusWindow == this ) - { - gFocusWindow = NULL ; - } - - DestroyChildren(); - - // delete our drop target if we've got one -#if wxUSE_DRAG_AND_DROP - if ( m_dropTarget != NULL ) - { - delete m_dropTarget; - m_dropTarget = NULL; - } -#endif // wxUSE_DRAG_AND_DROP -} - -// Constructor -bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindowMac without parent") ); - -#if wxUSE_STATBOX - // wxGTK doesn't allow to create controls with static box as the parent so - // this will result in a crash when the program is ported to wxGTK - warn - // about it - // - // the correct solution is to create the controls as siblings of the - // static box - wxASSERT_MSG( !wxDynamicCast(parent, wxStaticBox), - _T("wxStaticBox can't be used as a window parent!") ); -#endif // wxUSE_STATBOX - - if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; - - parent->AddChild(this); - - m_x = (int)pos.x; - m_y = (int)pos.y; - AdjustForParentClientOrigin(m_x, m_y, wxSIZE_USE_EXISTING); - m_width = WidthDefault( size.x ); - m_height = HeightDefault( size.y ) ; -#ifndef __WXUNIVERSAL__ - // Don't give scrollbars to wxControls unless they ask for them - if ( (! IsKindOf(CLASSINFO(wxControl)) && ! IsKindOf(CLASSINFO(wxStatusBar))) || - (IsKindOf(CLASSINFO(wxControl)) && ( style & wxHSCROLL || style & wxVSCROLL))) - { - MacCreateScrollBars( style ) ; - } -#endif - - wxWindowCreateEvent event(this); - GetEventHandler()->AddPendingEvent(event); - - return TRUE; -} - -void wxWindowMac::SetFocus() -{ - if ( gFocusWindow == this ) - return ; - - if ( AcceptsFocus() ) - { - if (gFocusWindow ) - { -#if wxUSE_CARET - // Deal with caret - if ( gFocusWindow->m_caret ) - { - gFocusWindow->m_caret->OnKillFocus(); - } -#endif // wxUSE_CARET -#ifndef __WXUNIVERSAL__ - wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; - if ( control && control->GetMacControl() ) - { - UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNoPart ) ; - control->MacRedrawControl() ; - } -#endif - // Without testing the window id, for some reason - // a kill focus event can still be sent to - // the control just being focussed. - int thisId = this->m_windowId; - int gFocusWindowId = gFocusWindow->m_windowId; - if (gFocusWindowId != thisId) - { - wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId); - event.SetEventObject(gFocusWindow); - gFocusWindow->GetEventHandler()->ProcessEvent(event) ; - } - } - gFocusWindow = this ; - { - #if wxUSE_CARET - // Deal with caret - if ( m_caret ) - { - m_caret->OnSetFocus(); - } - #endif // wxUSE_CARET - // panel wants to track the window which was the last to have focus in it - wxChildFocusEvent eventFocus(this); - GetEventHandler()->ProcessEvent(eventFocus); - - #ifndef __WXUNIVERSAL__ - wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; - if ( control && control->GetMacControl() ) - { - UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNextPart ) ; - } - #endif - wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - } -} - -bool wxWindowMac::Enable(bool enable) -{ - if ( !wxWindowBase::Enable(enable) ) - return FALSE; - - MacSuperEnabled( enable ) ; - - return TRUE; -} - -void wxWindowMac::DoCaptureMouse() -{ - wxTheApp->s_captureWindow = this ; -} - -wxWindow* wxWindowBase::GetCapture() -{ - return wxTheApp->s_captureWindow ; -} - -void wxWindowMac::DoReleaseMouse() -{ - wxTheApp->s_captureWindow = NULL ; -} - -#if wxUSE_DRAG_AND_DROP - -void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget) -{ - if ( m_dropTarget != 0 ) { - delete m_dropTarget; - } - - m_dropTarget = pDropTarget; - if ( m_dropTarget != 0 ) - { - // TODO - } -} - -#endif - -// Old style file-manager drag&drop -void wxWindowMac::DragAcceptFiles(bool accept) -{ - // TODO -} - -// Get total size -void wxWindowMac::DoGetSize(int *x, int *y) const -{ - if(x) *x = m_width ; - if(y) *y = m_height ; -} - -void wxWindowMac::DoGetPosition(int *x, int *y) const -{ - int xx,yy; - - xx = m_x ; - yy = m_y ; - if ( !IsTopLevel() && GetParent()) - { - wxPoint pt(GetParent()->GetClientAreaOrigin()); - xx -= pt.x; - yy -= pt.y; - } - if(x) *x = xx; - if(y) *y = yy; -} - -#if wxUSE_MENUS -bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) -{ - menu->SetInvokingWindow(this); - menu->UpdateUI(); - ClientToScreen( &x , &y ) ; - - menu->MacBeforeDisplay( true ) ; - long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ; - if ( HiWord(menuResult) != 0 ) - { - MenuCommand id ; - GetMenuItemCommandID( GetMenuHandle(HiWord(menuResult)) , LoWord(menuResult) , &id ) ; - wxMenuItem* item = NULL ; - wxMenu* realmenu ; - item = menu->FindItem(id, &realmenu) ; - if (item->IsCheckable()) - { - item->Check( !item->IsChecked() ) ; - } - menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; - } - menu->MacAfterDisplay( true ) ; - - menu->SetInvokingWindow(NULL); - - return TRUE; -} -#endif - -void wxWindowMac::DoScreenToClient(int *x, int *y) const -{ - WindowRef window = (WindowRef) MacGetRootWindow() ; - - Point localwhere = {0,0} ; - - if(x) localwhere.h = * x ; - if(y) localwhere.v = * y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - ::GlobalToLocal( &localwhere ) ; - ::SetPort( port ) ; - - if(x) *x = localwhere.h ; - if(y) *y = localwhere.v ; - - MacRootWindowToWindow( x , y ) ; - if ( x ) - *x -= MacGetLeftBorderSize() ; - if ( y ) - *y -= MacGetTopBorderSize() ; -} - -void wxWindowMac::DoClientToScreen(int *x, int *y) const -{ - WindowRef window = (WindowRef) MacGetRootWindow() ; - - if ( x ) - *x += MacGetLeftBorderSize() ; - if ( y ) - *y += MacGetTopBorderSize() ; - - MacWindowToRootWindow( x , y ) ; - - Point localwhere = { 0,0 }; - if(x) localwhere.h = * x ; - if(y) localwhere.v = * y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - - ::LocalToGlobal( &localwhere ) ; - ::SetPort( port ) ; - if(x) *x = localwhere.h ; - if(y) *y = localwhere.v ; -} - -void wxWindowMac::MacClientToRootWindow( int *x , int *y ) const -{ - wxPoint origin = GetClientAreaOrigin() ; - if(x) *x += origin.x ; - if(y) *y += origin.y ; - - MacWindowToRootWindow( x , y ) ; -} - -void wxWindowMac::MacRootWindowToClient( int *x , int *y ) const -{ - wxPoint origin = GetClientAreaOrigin() ; - MacRootWindowToWindow( x , y ) ; - if(x) *x -= origin.x ; - if(y) *y -= origin.y ; -} - -void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const -{ - if ( !IsTopLevel() ) - { - if(x) *x += m_x ; - if(y) *y += m_y ; - GetParent()->MacWindowToRootWindow( x , y ) ; - } -} - -void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const -{ - if ( !IsTopLevel() ) - { - if(x) *x -= m_x ; - if(y) *y -= m_y ; - GetParent()->MacRootWindowToWindow( x , y ) ; - } -} - -bool wxWindowMac::SetCursor(const wxCursor& cursor) -{ - if (m_cursor == cursor) - return FALSE; - - if (wxNullCursor == cursor) - { - if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) ) - return FALSE ; - } - else - { - if ( ! wxWindowBase::SetCursor( cursor ) ) - return FALSE ; - } - - wxASSERT_MSG( m_cursor.Ok(), - wxT("cursor must be valid after call to the base version")); - - Point pt ; - wxWindowMac *mouseWin ; - GetMouse( &pt ) ; - - // Change the cursor NOW if we're within the correct window - - if ( MacGetWindowFromPoint( wxPoint( pt.h , pt.v ) , &mouseWin ) ) - { - if ( mouseWin == this && !wxIsBusy() ) - { - m_cursor.MacInstall() ; - } - } - - return TRUE ; -} - - -// Get size *available for subwindows* i.e. excluding menu bar etc. -void wxWindowMac::DoGetClientSize(int *x, int *y) const -{ - int ww, hh; - ww = m_width ; - hh = m_height ; - - ww -= MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ; - hh -= MacGetTopBorderSize( ) + MacGetBottomBorderSize( ); - - if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) ) - { - int x1 = 0 ; - int y1 = 0 ; - int w = m_width ; - int h = m_height ; - - MacClientToRootWindow( &x1 , &y1 ) ; - MacClientToRootWindow( &w , &h ) ; - - wxWindowMac *iter = (wxWindowMac*)this ; - - int totW = 10000 , totH = 10000; - while( iter ) - { - if ( iter->IsTopLevel() ) - { - totW = iter->m_width ; - totH = iter->m_height ; - break ; - } - - iter = iter->GetParent() ; - } - - if (m_hScrollBar && m_hScrollBar->IsShown() ) - { - hh -= MAC_SCROLLBAR_SIZE; - if ( h-y1 >= totH ) - { - hh += 1 ; - } - } - if (m_vScrollBar && m_vScrollBar->IsShown() ) - { - ww -= MAC_SCROLLBAR_SIZE; - if ( w-x1 >= totW ) - { - ww += 1 ; - } - } - } - if(x) *x = ww; - if(y) *y = hh; -} - - -// ---------------------------------------------------------------------------- -// tooltips -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLTIPS - -void wxWindowMac::DoSetToolTip(wxToolTip *tooltip) -{ - wxWindowBase::DoSetToolTip(tooltip); - - if ( m_tooltip ) - m_tooltip->SetWindow(this); -} - -#endif // wxUSE_TOOLTIPS - -void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) -{ - int former_x = m_x ; - int former_y = m_y ; - int former_w = m_width ; - int former_h = m_height ; - - int actualWidth = width; - int actualHeight = height; - int actualX = x; - int actualY = y; - - if ((m_minWidth != -1) && (actualWidth < m_minWidth)) - actualWidth = m_minWidth; - if ((m_minHeight != -1) && (actualHeight < m_minHeight)) - actualHeight = m_minHeight; - if ((m_maxWidth != -1) && (actualWidth > m_maxWidth)) - actualWidth = m_maxWidth; - if ((m_maxHeight != -1) && (actualHeight > m_maxHeight)) - actualHeight = m_maxHeight; - - bool doMove = false ; - bool doResize = false ; - - if ( actualX != former_x || actualY != former_y ) - { - doMove = true ; - } - if ( actualWidth != former_w || actualHeight != former_h ) - { - doResize = true ; - } - - if ( doMove || doResize ) - { - // erase former position - - bool partialRepaint = false ; - - if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) ) - { - wxPoint oldPos( m_x , m_y ) ; - wxPoint newPos( actualX , actualY ) ; - MacWindowToRootWindow( &oldPos.x , &oldPos.y ) ; - MacWindowToRootWindow( &newPos.x , &newPos.y ) ; - if ( oldPos == newPos ) - { - partialRepaint = true ; - RgnHandle oldRgn,newRgn,diffRgn ; - oldRgn = NewRgn() ; - newRgn = NewRgn() ; - diffRgn = NewRgn() ; - - // invalidate the differences between the old and the new area - - SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ; - SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ; - DiffRgn( newRgn , oldRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - DiffRgn( oldRgn , newRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - // we also must invalidate the border areas, someone might optimize this one day to invalidate only the really - // changing pixels... - - if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 || - MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 ) - { - RgnHandle innerOldRgn, innerNewRgn ; - innerOldRgn = NewRgn() ; - innerNewRgn = NewRgn() ; - - SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() , - oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ; - DiffRgn( oldRgn , innerOldRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() , - newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ; - DiffRgn( newRgn , innerNewRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - DisposeRgn( innerOldRgn ) ; - DisposeRgn( innerNewRgn ) ; - } - - DisposeRgn(oldRgn) ; - DisposeRgn(newRgn) ; - DisposeRgn(diffRgn) ; - } - } - - if ( !partialRepaint ) - Refresh() ; - - m_x = actualX ; - m_y = actualY ; - m_width = actualWidth ; - m_height = actualHeight ; - - // update any low-level frame-relative positions - - MacUpdateDimensions() ; - // erase new position - - if ( !partialRepaint ) - Refresh() ; - if ( doMove ) - wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified - - MacRepositionScrollBars() ; - if ( doMove ) - { - wxPoint point(m_x, m_y); - wxMoveEvent event(point, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - if ( doResize ) - { - MacRepositionScrollBars() ; - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - -} - -// set the size of the window: if the dimensions are positive, just use them, -// but if any of them is equal to -1, it means that we must find the value for -// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in -// which case -1 is a valid value for x and y) -// -// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate -// the width/height to best suit our contents, otherwise we reuse the current -// width/height -void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - // get the current size and position... - int currentX, currentY; - GetPosition(¤tX, ¤tY); - - int currentW,currentH; - GetSize(¤tW, ¤tH); - - // ... and don't do anything (avoiding flicker) if it's already ok - if ( x == currentX && y == currentY && - width == currentW && height == currentH ) - { - MacRepositionScrollBars() ; // we might have a real position shift - return; - } - - if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) - x = currentX; - if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) - y = currentY; - - AdjustForParentClientOrigin(x, y, sizeFlags); - - wxSize size(-1, -1); - if ( width == -1 ) - { - if ( sizeFlags & wxSIZE_AUTO_WIDTH ) - { - size = DoGetBestSize(); - width = size.x; - } - else - { - // just take the current one - width = currentW; - } - } - - if ( height == -1 ) - { - if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) - { - if ( size.x == -1 ) - { - size = DoGetBestSize(); - } - //else: already called DoGetBestSize() above - - height = size.y; - } - else - { - // just take the current one - height = currentH; - } - } - - DoMoveWindow(x, y, width, height); - -} -// For implementation purposes - sometimes decorations make the client area -// smaller - -wxPoint wxWindowMac::GetClientAreaOrigin() const -{ - return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); -} - -void wxWindowMac::SetTitle(const wxString& title) -{ - m_label = title ; -} - -wxString wxWindowMac::GetTitle() const -{ - return m_label ; -} - -bool wxWindowMac::Show(bool show) -{ - if ( !wxWindowBase::Show(show) ) - return FALSE; - - MacSuperShown( show ) ; - Refresh() ; - - return TRUE; -} - -void wxWindowMac::MacSuperShown( bool show ) -{ - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - if ( child->m_isShown ) - child->MacSuperShown( show ) ; - node = node->GetNext(); - } -} - -void wxWindowMac::MacSuperEnabled( bool enabled ) -{ - if ( !IsTopLevel() ) - { - // to be absolutely correct we'd have to invalidate (with eraseBkground - // because unter MacOSX the frames are drawn with an addXXX mode) - // the borders area - } - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = (wxWindowMac *)node->GetData(); - if ( child->m_isShown ) - child->MacSuperEnabled( enabled ) ; - node = node->GetNext(); - } -} - -bool wxWindowMac::MacIsReallyShown() const -{ - if ( m_isShown && (m_parent != NULL && !IsTopLevel() ) ) { - return m_parent->MacIsReallyShown(); - } - return m_isShown; -/* - bool status = m_isShown ; - wxWindowMac * win = this ; - while ( status && win->m_parent != NULL ) - { - win = win->m_parent ; - status = win->m_isShown ; - } - return status ; -*/ -} - -int wxWindowMac::GetCharHeight() const -{ - wxClientDC dc ( (wxWindowMac*)this ) ; - return dc.GetCharHeight() ; -} - -int wxWindowMac::GetCharWidth() const -{ - wxClientDC dc ( (wxWindowMac*)this ) ; - return dc.GetCharWidth() ; -} - -void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, - int *descent, int *externalLeading, const wxFont *theFont ) const -{ - const wxFont *fontToUse = theFont; - if ( !fontToUse ) - fontToUse = &m_font; - - wxClientDC dc( (wxWindowMac*) this ) ; - long lx,ly,ld,le ; - dc.GetTextExtent( string , &lx , &ly , &ld, &le, (wxFont *)fontToUse ) ; - if ( externalLeading ) - *externalLeading = le ; - if ( descent ) - *descent = ld ; - if ( x ) - *x = lx ; - if ( y ) - *y = ly ; -} - -/* - * Rect is given in client coordinates, for further reading, read wxTopLevelWindowMac::InvalidateRect - * we always intersect with the entire window, not only with the client area - */ - -void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) -{ - if ( MacGetTopLevelWindow() == NULL ) - return ; - - if ( !MacIsReallyShown() ) - return ; - - wxPoint client = GetClientAreaOrigin(); - int x1 = -client.x; - int y1 = -client.y; - int x2 = m_width - client.x; - int y2 = m_height - client.y; - - if (IsKindOf( CLASSINFO(wxButton))) - { - // buttons have an "aura" - y1 -= 5; - x1 -= 5; - y2 += 5; - x2 += 5; - } - - Rect clientrect = { y1, x1, y2, x2 }; - - if ( rect ) - { - Rect r = { rect->y , rect->x , rect->y + rect->height , rect->x + rect->width } ; - SectRect( &clientrect , &r , &clientrect ) ; - } - - if ( !EmptyRect( &clientrect ) ) - { - int top = 0 , left = 0 ; - - MacClientToRootWindow( &left , &top ) ; - OffsetRect( &clientrect , left , top ) ; - - MacGetTopLevelWindow()->MacInvalidate( &clientrect , eraseBack ) ; - } -} - -wxWindowMac *wxGetActiveWindow() -{ - // actually this is a windows-only concept - return NULL; -} - -// Coordinates relative to the window -void wxWindowMac::WarpPointer (int x_pos, int y_pos) -{ - // We really don't move the mouse programmatically under Mac. -} - -const wxBrush& wxWindowMac::MacGetBackgroundBrush() -{ - if ( m_backgroundColour == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) - { - m_macBackgroundBrush.SetMacTheme( kThemeBrushDocumentWindowBackground ) ; - } - else if ( m_backgroundColour == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) ) - { - // on mac we have the difficult situation, that 3dface gray can be different colours, depending whether - // it is on a notebook panel or not, in order to take care of that we walk up the hierarchy until we have - // either a non gray background color or a non control window - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - wxWindowMac* parent = GetParent() ; - while( parent ) - { - if ( parent->MacGetRootWindow() != window ) - { - // we are in a different window on the mac system - parent = NULL ; - break ; - } - - { - if ( parent->m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) - && parent->m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) - { - // if we have any other colours in the hierarchy - m_macBackgroundBrush.SetColour( parent->m_backgroundColour ) ; - break ; - } - // if we have the normal colours in the hierarchy but another control etc. -> use it's background - if ( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - Rect extent = { 0 , 0 , 0 , 0 } ; - int x , y ; - x = y = 0 ; - wxSize size = parent->GetSize() ; - parent->MacClientToRootWindow( &x , &y ) ; - extent.left = x ; - extent.top = y ; - extent.top-- ; - extent.right = x + size.x ; - extent.bottom = y + size.y ; - m_macBackgroundBrush.SetMacThemeBackground( kThemeBackgroundTabPane , (WXRECTPTR) &extent ) ; // todo eventually change for inactive - break ; - } - } - parent = parent->GetParent() ; - } - if ( !parent ) - { - m_macBackgroundBrush.SetMacTheme( kThemeBrushDialogBackgroundActive ) ; // todo eventually change for inactive - } - } - else - { - m_macBackgroundBrush.SetColour( m_backgroundColour ) ; - } - - return m_macBackgroundBrush ; -} - -void wxWindowMac::OnEraseBackground(wxEraseEvent& event) -{ - event.GetDC()->Clear() ; -} - -void wxWindowMac::OnNcPaint( wxNcPaintEvent& event ) -{ - wxWindowDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - MacPaintBorders( dc.m_macLocalOrigin.x , dc.m_macLocalOrigin.y) ; -} - -int wxWindowMac::GetScrollPos(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetThumbPosition() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetThumbPosition() ; - } - return 0; -} - -// This now returns the whole range, not just the number -// of positions that we can scroll. -int wxWindowMac::GetScrollRange(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetRange() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetRange() ; - } - return 0; -} - -int wxWindowMac::GetScrollThumb(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetThumbSize() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetThumbSize() ; - } - return 0; -} - -void wxWindowMac::SetScrollPos(int orient, int pos, bool refresh) -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - m_hScrollBar->SetThumbPosition( pos ) ; - } - else - { - if ( m_vScrollBar ) - m_vScrollBar->SetThumbPosition( pos ) ; - } -} - -void wxWindowMac::MacPaintBorders( int left , int top ) -{ - if( IsTopLevel() ) - return ; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ; - RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ; - - RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ; - RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ; - // OS X has lighter border edges than classic: - if (major >= 10) - { - darkShadow.red = 0x8E8E; - darkShadow.green = 0x8E8E; - darkShadow.blue = 0x8E8E; - lightShadow.red = 0xBDBD; - lightShadow.green = 0xBDBD; - lightShadow.blue = 0xBDBD; - } - - PenNormal() ; - - if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) ) - { -#if wxMAC_USE_THEME_BORDER - Rect rect = { top , left , m_height + top , m_width + left } ; - SInt32 border = 0 ; - /* - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; - InsetRect( &rect , border , border ); - DrawThemeListBoxFrame(&rect,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; - */ - - DrawThemePrimaryGroup(&rect ,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; -#else - bool sunken = HasFlag( wxSUNKEN_BORDER ) ; - RGBForeColor( &face ); - MoveTo( left + 0 , top + m_height - 2 ); - LineTo( left + 0 , top + 0 ); - LineTo( left + m_width - 2 , top + 0 ); - - MoveTo( left + 2 , top + m_height - 3 ); - LineTo( left + m_width - 3 , top + m_height - 3 ); - LineTo( left + m_width - 3 , top + 2 ); - - RGBForeColor( sunken ? &face : &darkShadow ); - MoveTo( left + 0 , top + m_height - 1 ); - LineTo( left + m_width - 1 , top + m_height - 1 ); - LineTo( left + m_width - 1 , top + 0 ); - - RGBForeColor( sunken ? &lightShadow : &white ); - MoveTo( left + 1 , top + m_height - 3 ); - LineTo( left + 1, top + 1 ); - LineTo( left + m_width - 3 , top + 1 ); - - RGBForeColor( sunken ? &white : &lightShadow ); - MoveTo( left + 1 , top + m_height - 2 ); - LineTo( left + m_width - 2 , top + m_height - 2 ); - LineTo( left + m_width - 2 , top + 1 ); - - RGBForeColor( sunken ? &darkShadow : &face ); - MoveTo( left + 2 , top + m_height - 4 ); - LineTo( left + 2 , top + 2 ); - LineTo( left + m_width - 4 , top + 2 ); -#endif - } - else if (HasFlag(wxSIMPLE_BORDER)) - { - Rect rect = { top , left , m_height + top , m_width + left } ; - RGBForeColor( &darkShadow ) ; - FrameRect( &rect ) ; - } -} - -void wxWindowMac::RemoveChild( wxWindowBase *child ) -{ - if ( child == m_hScrollBar ) - m_hScrollBar = NULL ; - if ( child == m_vScrollBar ) - m_vScrollBar = NULL ; - - wxWindowBase::RemoveChild( child ) ; -} - -// New function that will replace some of the above. -void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh) -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - { - if ( range == 0 || thumbVisible >= range ) - { - if ( m_hScrollBar->IsShown() ) - m_hScrollBar->Show(false) ; - } - else - { - if ( !m_hScrollBar->IsShown() ) - m_hScrollBar->Show(true) ; - m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ; - } - } - } - else - { - if ( m_vScrollBar ) - { - if ( range == 0 || thumbVisible >= range ) - { - if ( m_vScrollBar->IsShown() ) - m_vScrollBar->Show(false) ; - } - else - { - if ( !m_vScrollBar->IsShown() ) - m_vScrollBar->Show(true) ; - m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ; - } - } - } - MacRepositionScrollBars() ; -} - -// Does a physical scroll -void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) -{ - if( dx == 0 && dy ==0 ) - return ; - - - { - wxClientDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - int width , height ; - GetClientSize( &width , &height ) ; - - Rect scrollrect = { dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) , dc.YLOG2DEVMAC(height) , dc.XLOG2DEVMAC(width) } ; - RgnHandle updateRgn = NewRgn() ; - ClipRect( &scrollrect ) ; - if ( rect ) - { - Rect r = { dc.YLOG2DEVMAC(rect->y) , dc.XLOG2DEVMAC(rect->x) , dc.YLOG2DEVMAC(rect->y + rect->height) , - dc.XLOG2DEVMAC(rect->x + rect->width) } ; - SectRect( &scrollrect , &r , &scrollrect ) ; - } - ScrollRect( &scrollrect , dx , dy , updateRgn ) ; - // we also have to scroll the update rgn in this rectangle - // in order not to loose updates - WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; - RgnHandle formerUpdateRgn = NewRgn() ; - RgnHandle scrollRgn = NewRgn() ; - RectRgn( scrollRgn , &scrollrect ) ; - GetWindowUpdateRgn( rootWindow , formerUpdateRgn ) ; - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - OffsetRgn( formerUpdateRgn , -pt.h , -pt.v ) ; - SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ; - if ( !EmptyRgn( formerUpdateRgn ) ) - { - MacOffsetRgn( formerUpdateRgn , dx , dy ) ; - SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ; - InvalWindowRgn(rootWindow , formerUpdateRgn ) ; - } - InvalWindowRgn(rootWindow , updateRgn ) ; - DisposeRgn( updateRgn ) ; - DisposeRgn( formerUpdateRgn ) ; - DisposeRgn( scrollRgn ) ; - } - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - if (child == m_vScrollBar) continue; - if (child == m_hScrollBar) continue; - if (child->IsTopLevel()) continue; - - int x,y; - child->GetPosition( &x, &y ); - int w,h; - child->GetSize( &w, &h ); - if (rect) - { - wxRect rc(x,y,w,h); - if (rect->Intersects(rc)) - child->SetSize( x+dx, y+dy, w, h ); - } - else - { - child->SetSize( x+dx, y+dy, w, h ); - } - } - - Update() ; - -} - -void wxWindowMac::MacOnScroll(wxScrollEvent &event ) -{ - if ( event.m_eventObject == m_vScrollBar || event.m_eventObject == m_hScrollBar ) - { - wxScrollWinEvent wevent; - wevent.SetPosition(event.GetPosition()); - wevent.SetOrientation(event.GetOrientation()); - wevent.m_eventObject = this; - - if (event.m_eventType == wxEVT_SCROLL_TOP) - wevent.m_eventType = wxEVT_SCROLLWIN_TOP; - else if (event.m_eventType == wxEVT_SCROLL_BOTTOM) - wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM; - else if (event.m_eventType == wxEVT_SCROLL_LINEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP; - else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_PAGEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP; - else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK; - else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE; - - GetEventHandler()->ProcessEvent(wevent); - } -} - -// Get the window with the focus -wxWindowMac *wxWindowBase::FindFocus() -{ - return gFocusWindow ; -} - -void wxWindowMac::OnSetFocus(wxFocusEvent& event) -{ - // panel wants to track the window which was the last to have focus in it, - // so we want to set ourselves as the window which last had focus - // - // notice that it's also important to do it upwards the tree becaus - // otherwise when the top level panel gets focus, it won't set it back to - // us, but to some other sibling - - // CS:don't know if this is still needed: - //wxChildFocusEvent eventFocus(this); - //(void)GetEventHandler()->ProcessEvent(eventFocus); - - event.Skip(); -} - -// Setup background and foreground colours correctly -void wxWindowMac::SetupColours() -{ - if ( GetParent() ) - SetBackgroundColour(GetParent()->GetBackgroundColour()); -} - -void wxWindowMac::OnInternalIdle() -{ - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this)) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - -// Raise the window to the top of the Z order -void wxWindowMac::Raise() -{ -} - -// Lower the window to the bottom of the Z order -void wxWindowMac::Lower() -{ -} - -void wxWindowMac::DoSetClientSize(int width, int height) -{ - if ( width != -1 || height != -1 ) - { - - if ( width != -1 && m_vScrollBar ) - width += MAC_SCROLLBAR_SIZE ; - if ( height != -1 && m_vScrollBar ) - height += MAC_SCROLLBAR_SIZE ; - - width += MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ; - height += MacGetTopBorderSize( ) + MacGetBottomBorderSize( ) ; - - DoSetSize( -1 , -1 , width , height ) ; - } -} - - -wxWindowMac* wxWindowMac::s_lastMouseWindow = NULL ; - -bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) -{ - if ( IsTopLevel() ) - { - if ((point.x < 0) || (point.y < 0) || - (point.x > (m_width)) || (point.y > (m_height))) - return FALSE; - } - else - { - if ((point.x < m_x) || (point.y < m_y) || - (point.x > (m_x + m_width)) || (point.y > (m_y + m_height))) - return FALSE; - } - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - wxPoint newPoint( point ) ; - - if ( !IsTopLevel() ) - { - newPoint.x -= m_x; - newPoint.y -= m_y; - } - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - // added the m_isShown test --dmazzoni - if ( child->MacGetRootWindow() == window && child->m_isShown ) - { - if (child->MacGetWindowFromPointSub(newPoint , outWin )) - return TRUE; - } - } - - *outWin = this ; - return TRUE; -} - -bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMac** outWin ) -{ - WindowRef window ; - - Point pt = { screenpoint.y , screenpoint.x } ; - if ( ::FindWindow( pt , &window ) == 3 ) - { - - wxWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - { - // No, this yields the CLIENT are, we need the whole frame. RR. - // point = win->ScreenToClient( point ) ; - - GrafPtr port; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - ::GlobalToLocal( &pt ) ; - ::SetPort( port ) ; - - wxPoint point( pt.h, pt.v ) ; - - return win->MacGetWindowFromPointSub( point , outWin ) ; - } - } - return FALSE ; -} - -static wxWindow *gs_lastWhich = NULL; - -bool wxWindowMac::MacSetupCursor( const wxPoint& pt) -{ - // first trigger a set cursor event - - wxPoint clientorigin = GetClientAreaOrigin() ; - wxSize clientsize = GetClientSize() ; - wxCursor cursor ; - if ( wxRect2DInt( clientorigin.x , clientorigin.y , clientsize.x , clientsize.y ).Contains( wxPoint2DInt( pt ) ) ) - { - wxSetCursorEvent event( pt.x , pt.y ); - - bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event); - if ( processedEvtSetCursor && event.HasCursor() ) - { - cursor = event.GetCursor() ; - } - else - { - - // the test for processedEvtSetCursor is here to prevent using m_cursor - // if the user code caught EVT_SET_CURSOR() and returned nothing from - // it - this is a way to say that our cursor shouldn't be used for this - // point - if ( !processedEvtSetCursor && m_cursor.Ok() ) - { - cursor = m_cursor ; - } - if ( wxIsBusy() ) - { - } - else - { - if ( !GetParent() ) - cursor = *wxSTANDARD_CURSOR ; - } - } - if ( cursor.Ok() ) - cursor.MacInstall() ; - } - return cursor.Ok() ; -} - -bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) -{ - if ((event.m_x < m_x) || (event.m_y < m_y) || - (event.m_x > (m_x + m_width)) || (event.m_y > (m_y + m_height))) - return FALSE; - - - if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */) - return FALSE ; - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - event.m_x -= m_x; - event.m_y -= m_y; - - int x = event.m_x ; - int y = event.m_y ; - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - if ( child->MacGetRootWindow() == window && child->IsShown() && child->IsEnabled() ) - { - if (child->MacDispatchMouseEvent(event)) - return TRUE; - } - } - - wxWindow* cursorTarget = this ; - wxPoint cursorPoint( x , y ) ; - - while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) ) - { - cursorTarget = cursorTarget->GetParent() ; - if ( cursorTarget ) - cursorPoint += cursorTarget->GetPosition() ; - } - event.m_x = x ; - event.m_y = y ; - event.SetEventObject( this ) ; - - if ( event.GetEventType() == wxEVT_LEFT_DOWN ) - { - // set focus to this window - if (AcceptsFocus() && FindFocus()!=this) - SetFocus(); - } - -#if wxUSE_TOOLTIPS - if ( event.GetEventType() == wxEVT_MOTION - || event.GetEventType() == wxEVT_ENTER_WINDOW - || event.GetEventType() == wxEVT_LEAVE_WINDOW ) - wxToolTip::RelayEvent( this , event); -#endif // wxUSE_TOOLTIPS - - if (gs_lastWhich != this) - { - gs_lastWhich = this; - - // Double clicks must always occur on the same window - if (event.GetEventType() == wxEVT_LEFT_DCLICK) - event.SetEventType( wxEVT_LEFT_DOWN ); - if (event.GetEventType() == wxEVT_RIGHT_DCLICK) - event.SetEventType( wxEVT_RIGHT_DOWN ); - - // Same for mouse up events - if (event.GetEventType() == wxEVT_LEFT_UP) - return TRUE; - if (event.GetEventType() == wxEVT_RIGHT_UP) - return TRUE; - } - - GetEventHandler()->ProcessEvent( event ) ; - - return TRUE; -} - -wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) -{ - if ( m_tooltip ) - { - return m_tooltip->GetTip() ; - } - return wxEmptyString ; -} - -void wxWindowMac::Update() -{ - wxRegion visRgn = MacGetVisibleRegion( false ) ; - int top = 0 , left = 0 ; - MacWindowToRootWindow( &left , &top ) ; - WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; - RgnHandle updateRgn = NewRgn() ; - // getting the update region in macos local coordinates - GetWindowUpdateRgn( rootWindow , updateRgn ) ; - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( rootWindow ) ) ; - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - ::SetPort( port ) ; - OffsetRgn( updateRgn , -pt.h , -pt.v ) ; - // translate to window local coordinates - OffsetRgn( updateRgn , -left , -top ) ; - SectRgn( updateRgn , (RgnHandle) visRgn.GetWXHRGN() , updateRgn ) ; - MacRedraw( updateRgn , 0 , true ) ; - // for flushing and validating we need macos-local coordinates again - OffsetRgn( updateRgn , left , top ) ; -#if TARGET_API_MAC_CARBON - if ( QDIsPortBuffered( GetWindowPort( rootWindow ) ) ) - { - QDFlushPortBuffer( GetWindowPort( rootWindow ) , updateRgn ) ; - } -#endif - ValidWindowRgn( rootWindow , updateRgn ) ; - DisposeRgn( updateRgn ) ; -} - -wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const -{ - wxTopLevelWindowMac* win = NULL ; - WindowRef window = (WindowRef) MacGetRootWindow() ; - if ( window ) - { - win = wxFindWinFromMacWindow( window ) ; - } - return win ; -} - -const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSiblings ) -{ - RgnHandle visRgn = NewRgn() ; - RgnHandle tempRgn = NewRgn() ; - RgnHandle tempStaticBoxRgn = NewRgn() ; - - if ( MacIsReallyShown() ) - { - SetRectRgn( visRgn , 0 , 0 , m_width , m_height ) ; - - //TODO : as soon as the new scheme has proven to work correctly, move this to wxStaticBox - if ( IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , borderOther , borderTop , m_width - borderOther , m_height - borderOther ) ; - DiffRgn( visRgn , tempStaticBoxRgn , visRgn ) ; - } - - if ( !IsTopLevel() ) - { - wxWindow* parent = GetParent() ; - while( parent ) - { - wxSize size = parent->GetSize() ; - int x , y ; - x = y = 0 ; - parent->MacWindowToRootWindow( &x, &y ) ; - MacRootWindowToWindow( &x , &y ) ; - - SetRectRgn( tempRgn , - x + parent->MacGetLeftBorderSize() , y + parent->MacGetTopBorderSize() , - x + size.x - parent->MacGetRightBorderSize(), - y + size.y - parent->MacGetBottomBorderSize()) ; - - SectRgn( visRgn , tempRgn , visRgn ) ; - if ( parent->IsTopLevel() ) - break ; - parent = parent->GetParent() ; - } - } - if ( respectChildrenAndSiblings ) - { - if ( GetWindowStyle() & wxCLIP_CHILDREN ) - { - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - - if ( !child->IsTopLevel() && child->IsShown() ) - { - SetRectRgn( tempRgn , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; - if ( child->IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ; - DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ; - } - DiffRgn( visRgn , tempRgn , visRgn ) ; - } - } - } - - if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() ) - { - bool thisWindowThrough = false ; - for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *sibling = node->GetData(); - if ( sibling == this ) - { - thisWindowThrough = true ; - continue ; - } - if( !thisWindowThrough ) - { - continue ; - } - - if ( !sibling->IsTopLevel() && sibling->IsShown() ) - { - SetRectRgn( tempRgn , sibling->m_x - m_x , sibling->m_y - m_y , sibling->m_x + sibling->m_width - m_x , sibling->m_y + sibling->m_height - m_y ) ; - if ( sibling->IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , sibling->m_x - m_x + borderOther , sibling->m_y - m_y + borderTop , sibling->m_x + sibling->m_width - m_x - borderOther , sibling->m_y + sibling->m_height - m_y - borderOther ) ; - DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ; - } - DiffRgn( visRgn , tempRgn , visRgn ) ; - } - } - } - } - } - m_macVisibleRegion = visRgn ; - DisposeRgn( visRgn ) ; - DisposeRgn( tempRgn ) ; - DisposeRgn( tempStaticBoxRgn ) ; - return m_macVisibleRegion ; -} - -void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) -{ - RgnHandle updatergn = (RgnHandle) updatergnr ; - // updatergn is always already clipped to our boundaries - // it is in window coordinates, not in client coordinates - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - { - // ownUpdateRgn is the area that this window has to repaint, it is in window coordinates - RgnHandle ownUpdateRgn = NewRgn() ; - CopyRgn( updatergn , ownUpdateRgn ) ; - - SectRgn( ownUpdateRgn , (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , ownUpdateRgn ) ; - - // newupdate is the update region in client coordinates - RgnHandle newupdate = NewRgn() ; - wxSize point = GetClientSize() ; - wxPoint origin = GetClientAreaOrigin() ; - SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ; - SectRgn( newupdate , ownUpdateRgn , newupdate ) ; - OffsetRgn( newupdate , -origin.x , -origin.y ) ; - m_updateRegion = newupdate ; - DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion - - if ( erase && !EmptyRgn(ownUpdateRgn) ) - { - wxWindowDC dc(this); - if (!EmptyRgn(ownUpdateRgn)) - dc.SetClippingRegion(wxRegion(ownUpdateRgn)); - wxEraseEvent eevent( GetId(), &dc ); - eevent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( eevent ); - - wxNcPaintEvent eventNc( GetId() ); - eventNc.SetEventObject( this ); - GetEventHandler()->ProcessEvent( eventNc ); - } - DisposeRgn( ownUpdateRgn ) ; - if ( !m_updateRegion.Empty() ) - { - wxWindowList hiddenWindows ; - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; - - if ( child && child->MacGetRootWindow() == window && child->IsShown() && child->GetMacControl() ) - { - SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ; - hiddenWindows.Append( child ) ; - } - } - - wxPaintEvent event; - event.m_timeStamp = time ; - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - - for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext()) - { - wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; - - if ( child && child->GetMacControl() ) - { - SetControlVisibility( (ControlHandle) child->GetMacControl() , true , false ) ; - } - } - } - } - - // now intersect for each of the children their rect with the updateRgn and call MacRedraw recursively - - RgnHandle childupdate = NewRgn() ; - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - // calculate the update region for the child windows by intersecting the window rectangle with our own - // passed in update region and then offset it to be client-wise window coordinates again - wxWindowMac *child = node->GetData(); - SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; - SectRgn( childupdate , updatergn , childupdate ) ; - OffsetRgn( childupdate , -child->m_x , -child->m_y ) ; - if ( child->MacGetRootWindow() == window && child->IsShown() && !EmptyRgn( childupdate ) ) - { - // because dialogs may also be children - child->MacRedraw( childupdate , time , erase ) ; - } - } - DisposeRgn( childupdate ) ; - // eventually a draw grow box here - -} - -WXHWND wxWindowMac::MacGetRootWindow() const -{ - wxWindowMac *iter = (wxWindowMac*)this ; - - while( iter ) - { - if ( iter->IsTopLevel() ) - return ((wxTopLevelWindow*)iter)->MacGetWindowRef() ; - - iter = iter->GetParent() ; - } - wxASSERT_MSG( 1 , wxT("No valid mac root window") ) ; - return NULL ; -} - -void wxWindowMac::MacCreateScrollBars( long style ) -{ - wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ; - - bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ; - int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ; - int width, height ; - GetClientSize( &width , &height ) ; - - wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ; - wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ; - wxPoint hPoint(0 , height-MAC_SCROLLBAR_SIZE ) ; - wxSize hSize( width - adjust, MAC_SCROLLBAR_SIZE) ; - - m_vScrollBar = new wxScrollBar(this, wxWINDOW_VSCROLL, vPoint, - vSize , wxVERTICAL); - - if ( style & wxVSCROLL ) - { - - } - else - { - m_vScrollBar->Show(false) ; - } - m_hScrollBar = new wxScrollBar(this, wxWINDOW_HSCROLL, hPoint, - hSize , wxHORIZONTAL); - if ( style & wxHSCROLL ) - { - } - else - { - m_hScrollBar->Show(false) ; - } - - // because the create does not take into account the client area origin - MacRepositionScrollBars() ; // we might have a real position shift -} - -void wxWindowMac::MacRepositionScrollBars() -{ - bool hasBoth = ( m_hScrollBar && m_hScrollBar->IsShown()) && ( m_vScrollBar && m_vScrollBar->IsShown()) ; - int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1 : 0 ; - - // get real client area - - int width = m_width ; - int height = m_height ; - - width -= MacGetLeftBorderSize() + MacGetRightBorderSize(); - height -= MacGetTopBorderSize() + MacGetBottomBorderSize(); - - wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ; - wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ; - wxPoint hPoint(0 , height-MAC_SCROLLBAR_SIZE ) ; - wxSize hSize( width - adjust, MAC_SCROLLBAR_SIZE) ; - - int x = 0 ; - int y = 0 ; - int w = m_width ; - int h = m_height ; - - MacClientToRootWindow( &x , &y ) ; - MacClientToRootWindow( &w , &h ) ; - - wxWindowMac *iter = (wxWindowMac*)this ; - - int totW = 10000 , totH = 10000; - while( iter ) - { - if ( iter->IsTopLevel() ) - { - totW = iter->m_width ; - totH = iter->m_height ; - break ; - } - - iter = iter->GetParent() ; - } - - if ( x == 0 ) - { - hPoint.x = -1 ; - hSize.x += 1 ; - } - if ( y == 0 ) - { - vPoint.y = -1 ; - vSize.y += 1 ; - } - - if ( w-x >= totW ) - { - hSize.x += 1 ; - vPoint.x += 1 ; - } - - if ( h-y >= totH ) - { - vSize.y += 1 ; - hPoint.y += 1 ; - } - - if ( m_vScrollBar ) - { - m_vScrollBar->SetSize( vPoint.x , vPoint.y, vSize.x, vSize.y , wxSIZE_ALLOW_MINUS_ONE); - } - if ( m_hScrollBar ) - { - m_hScrollBar->SetSize( hPoint.x , hPoint.y, hSize.x, hSize.y, wxSIZE_ALLOW_MINUS_ONE); - } -} - -bool wxWindowMac::AcceptsFocus() const -{ - return MacCanFocus() && wxWindowBase::AcceptsFocus(); -} - -WXWidget wxWindowMac::MacGetContainerForEmbedding() -{ - return GetParent()->MacGetContainerForEmbedding() ; -} - -void wxWindowMac::MacSuperChangedPosition() -{ - // only window-absolute structures have to be moved i.e. controls - - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - child->MacSuperChangedPosition() ; - node = node->GetNext(); - } -} - -void wxWindowMac::MacTopLevelWindowChangedPosition() -{ - // only screen-absolute structures have to be moved i.e. glcanvas - - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - child->MacTopLevelWindowChangedPosition() ; - node = node->GetNext(); - } -} -long wxWindowMac::MacGetLeftBorderSize( ) const -{ - if( IsTopLevel() ) - return 0 ; - - if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER ) - { - SInt32 border = 3 ; -#if wxMAC_USE_THEME_BORDER -#if TARGET_CARBON - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; -#endif -#endif - return border ; - } - else if ( m_windowStyle &wxDOUBLE_BORDER) - { - SInt32 border = 3 ; -#if wxMAC_USE_THEME_BORDER -#if TARGET_CARBON - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; -#endif -#endif - return border ; - } - else if (m_windowStyle &wxSIMPLE_BORDER) - { - return 1 ; - } - return 0 ; -} - -long wxWindowMac::MacGetRightBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacGetTopBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacGetBottomBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacRemoveBordersFromStyle( long style ) -{ - return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ; -} - -// Find the wxWindowMac at the current mouse position, returning the mouse -// position. -wxWindowMac* wxFindWindowAtPointer(wxPoint& pt) -{ - pt = wxGetMousePosition(); - wxWindowMac* found = wxFindWindowAtPoint(pt); - return found; -} - -// Get the current mouse position. -wxPoint wxGetMousePosition() -{ - int x, y; - wxGetMousePosition(& x, & y); - return wxPoint(x, y); -} - -void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) -{ - if ( event.GetEventType() == wxEVT_RIGHT_DOWN ) - { - // copied from wxGTK : CS - // generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN - // except that: - // - // (a) it's a command event and so is propagated to the parent - // (b) under MSW it can be generated from kbd too - // (c) it uses screen coords (because of (a)) - wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, - this->GetId(), - this->ClientToScreen(event.GetPosition())); - if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) - event.Skip() ; - } - else - { - event.Skip() ; - } -} - diff --git a/src/mac/carbon/wxmac.icns b/src/mac/carbon/wxmac.icns deleted file mode 100644 index 2c4e6f097d2f4315aaabf16668dbab4f4db6ebd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36901 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 - - - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleIdentifier - org.wxwindows.IDENTIFIER - CFBundleDevelopmentRegion - English - CFBundleExecutable - EXECUTABLE - CFBundleIconFile - wxmac.icns - CFBundleName - EXECUTABLE - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - VERSION - CFBundleShortVersionString - VERSION - CFBundleGetInfoString - EXECUTABLE version VERSION, (c) 2002 wxWindows - CFBundleLongVersionString - VERSION, (c) 2002 wxWindows - NSHumanReadableCopyright - Copyright 2002 wxWindows - LSRequiresCarbon - - CSResourcesFileMapped - - - diff --git a/src/mac/classic/accel.cpp b/src/mac/classic/accel.cpp deleted file mode 100644 index 14aa88e53a..0000000000 --- a/src/mac/classic/accel.cpp +++ /dev/null @@ -1,108 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: accel.cpp -// Purpose: wxAcceleratorTable -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "accel.h" -#endif - -#include "wx/setup.h" -#include "wx/accel.h" -#include "wx/string.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) -#endif - -// ---------------------------------------------------------------------------- -// wxAccelList: a list of wxAcceleratorEntries -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST(wxAcceleratorEntry, wxAccelList); -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxAccelList); - -// ---------------------------------------------------------------------------- -// wxAccelRefData: the data used by wxAcceleratorTable -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData -{ - friend class WXDLLEXPORT wxAcceleratorTable; -public: - wxAcceleratorRefData(); - ~wxAcceleratorRefData(); - - wxAccelList m_accels; -}; - -#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) - -wxAcceleratorRefData::wxAcceleratorRefData() - : m_accels() -{ -} - -wxAcceleratorRefData::~wxAcceleratorRefData() -{ - m_accels.DeleteContents( TRUE ); -} - -wxAcceleratorTable::wxAcceleratorTable() -{ - m_refData = NULL; -} - -wxAcceleratorTable::~wxAcceleratorTable() -{ -} - -// Create from an array -wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) -{ - m_refData = new wxAcceleratorRefData; - - for (int i = 0; i < n; i++) - { - int flag = entries[i].GetFlags(); - int keycode = entries[i].GetKeyCode(); - int command = entries[i].GetCommand(); - if ((keycode >= (int)'a') && (keycode <= (int)'z')) keycode = (int)toupper( (char)keycode ); - M_ACCELDATA->m_accels.Append( new wxAcceleratorEntry( flag, keycode, command ) ); - } -} - -bool wxAcceleratorTable::Ok() const -{ - return (m_refData != NULL); -} - -int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) -{ - if (!Ok()) return -1; - - wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); - while (node) - { - wxAcceleratorEntry *entry = (wxAcceleratorEntry*)node->GetData(); - if ((event.m_keyCode == entry->GetKeyCode()) && - (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && - (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && - (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) - { - return entry->GetCommand(); - } - node = node->GetNext(); - } - - return -1; -} - - diff --git a/src/mac/classic/aga.cpp b/src/mac/classic/aga.cpp deleted file mode 100644 index 543fc10137..0000000000 --- a/src/mac/classic/aga.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// NOT NEEDED ANYMORE - diff --git a/src/mac/classic/app.cpp b/src/mac/classic/app.cpp deleted file mode 100644 index 613c323b92..0000000000 --- a/src/mac/classic/app.cpp +++ /dev/null @@ -1,2439 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp -// Purpose: wxApp -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "app.h" -#endif - -#include "wx/defs.h" - -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/button.h" -#include "wx/app.h" -#include "wx/utils.h" -#include "wx/gdicmn.h" -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/cursor.h" -#include "wx/intl.h" -#include "wx/icon.h" -#include "wx/palette.h" -#include "wx/dc.h" -#include "wx/dialog.h" -#include "wx/msgdlg.h" -#include "wx/log.h" -#include "wx/module.h" -#include "wx/memory.h" -#include "wx/tooltip.h" -#include "wx/textctrl.h" -#include "wx/menu.h" -#include "wx/docview.h" -#include "wx/filename.h" - -#include - -// mac - -#ifndef __DARWIN__ - #if __option(profile) - #include - #endif -#endif - -#include "apprsrc.h" - -#include "wx/mac/uma.h" -#include "wx/mac/macnotfy.h" - -#ifdef __DARWIN__ -# include -# if defined(WXMAKINGDLL_CORE) -# include -# endif -#else -# include -# include -# include -# include -# include -#endif - -extern wxList wxPendingDelete; -extern wxList *wxWinMacWindowList; -extern wxList *wxWinMacControlList; -#if wxUSE_THREADS -extern size_t g_numberOfThreads; -#endif // wxUSE_THREADS - -// statics for implementation - -static bool s_inYield = FALSE; - -#if TARGET_CARBON -static bool s_inReceiveEvent = FALSE ; -static EventTime sleepTime = kEventDurationNoWait ; -#else -static long sleepTime = 0 ; -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) -BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) - EVT_END_SESSION(wxApp::OnEndSession) - EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession) -END_EVENT_TABLE() -#endif - - -const short kMacMinHeap = (29 * 1024) ; -// platform specific static variables - -const short kwxMacMenuBarResource = 1 ; -const short kwxMacAppleMenuId = 1 ; - -WXHRGN wxApp::s_macCursorRgn = NULL; -wxWindow* wxApp::s_captureWindow = NULL ; -int wxApp::s_lastMouseDown = 0 ; -long wxApp::sm_lastMessageTime = 0; -long wxApp::s_lastModifiers = 0 ; - - -bool wxApp::s_macSupportPCMenuShortcuts = true ; -long wxApp::s_macAboutMenuItemId = wxID_ABOUT ; -long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ; -long wxApp::s_macExitMenuItemId = wxID_EXIT ; -wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ; - -// Normally we're not a plugin -bool wxApp::sm_isEmbedded = false; -//---------------------------------------------------------------------- -// Core Apple Event Support -//---------------------------------------------------------------------- - -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleRApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ; - -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ; -} - -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ; -} - -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ; -} - -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ; -} - -pascal OSErr AEHandleRApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) -{ - return wxTheApp->MacHandleAERApp( (AppleEvent*) event , reply) ; -} - -// AEODoc Calls MacOpenFile on each of the files passed - -short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) -{ - AEDescList docList; - AEKeyword keywd; - DescType returnedType; - Size actualSize; - long itemsInList; - FSSpec theSpec; - OSErr err; - short i; - err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); - if (err != noErr) - return err; - - err = AECountItems(&docList, &itemsInList); - if (err != noErr) - return err; - - ProcessSerialNumber PSN ; - PSN.highLongOfPSN = 0 ; - PSN.lowLongOfPSN = kCurrentProcess ; - SetFrontProcess( &PSN ) ; - - for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); - MacOpenFile(fName); - } - return noErr; -} - -// AEPDoc Calls MacPrintFile on each of the files passed - -short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply)) -{ - AEDescList docList; - AEKeyword keywd; - DescType returnedType; - Size actualSize; - long itemsInList; - FSSpec theSpec; - OSErr err; - short i; - err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); - if (err != noErr) - return err; - - err = AECountItems(&docList, &itemsInList); - if (err != noErr) - return err; - - ProcessSerialNumber PSN ; - PSN.highLongOfPSN = 0 ; - PSN.lowLongOfPSN = kCurrentProcess ; - SetFrontProcess( &PSN ) ; - - for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); - MacPrintFile(fName); - } - return noErr; -} - -// AEOApp calls MacNewFile - -short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - MacNewFile() ; - return noErr ; -} - -// AEQuit attempts to quit the application - -short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - wxWindow* win = GetTopWindow() ; - if ( win ) - { - wxCommandEvent exitEvent(wxEVT_COMMAND_MENU_SELECTED, s_macExitMenuItemId); - if (!win->ProcessEvent(exitEvent)) - win->Close(TRUE ) ; - } - else - { - ExitMainLoop() ; - } - return noErr ; -} - -// AEROApp calls MacReopenApp - -short wxApp::MacHandleAERApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) -{ - MacReopenApp() ; - return noErr ; -} - - -//---------------------------------------------------------------------- -// Support Routines linking the Mac...File Calls to the Document Manager -//---------------------------------------------------------------------- - -void wxApp::MacOpenFile(const wxString & fileName ) -{ - wxDocManager* dm = wxDocManager::GetDocumentManager() ; - if ( dm ) - dm->CreateDocument(fileName , wxDOC_SILENT ) ; -} - -void wxApp::MacPrintFile(const wxString & fileName ) -{ - wxDocManager* dm = wxDocManager::GetDocumentManager() ; - if ( dm ) - { - wxDocument *doc = dm->CreateDocument(fileName , wxDOC_SILENT ) ; - if ( doc ) - { - wxView* view = doc->GetFirstView() ; - if( view ) - { - wxPrintout *printout = view->OnCreatePrintout(); - if (printout) - { - wxPrinter printer; - printer.Print(view->GetFrame(), printout, TRUE); - delete printout; - } - } - if (doc->Close()) - { - doc->DeleteAllViews(); - dm->RemoveDocument(doc) ; - } - } - } -} - -void wxApp::MacNewFile() -{ -} - -void wxApp::MacReopenApp() -{ - // eventually check for open docs, if none, call MacNewFile -} - -//---------------------------------------------------------------------- -// Carbon Event Handler -//---------------------------------------------------------------------- - -#if TARGET_CARBON - - static const EventTypeSpec eventList[] = - { - { kEventClassCommand, kEventProcessCommand } , - { kEventClassCommand, kEventCommandUpdateStatus } , - - { kEventClassMenu, kEventMenuOpening }, - { kEventClassMenu, kEventMenuClosed }, - { kEventClassMenu, kEventMenuTargetItem }, - - { kEventClassApplication , kEventAppActivated } , - { kEventClassApplication , kEventAppDeactivated } , - // handling the quit event is not recommended by apple - // rather using the quit apple event - which we do - - { kEventClassAppleEvent , kEventAppleEvent } , - - { kEventClassMouse , kEventMouseDown } , - { kEventClassMouse , kEventMouseMoved } , - { kEventClassMouse , kEventMouseUp } , - { kEventClassMouse , kEventMouseDragged } , - { 'WXMC' , 'WXMC' } - } ; - -static pascal OSStatus -MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar(); - - if ( mbar ) - { - wxFrame* win = mbar->GetFrame(); - if ( win ) - { - - // VZ: we could find the menu from its handle here by examining all - // the menus in the menu bar recursively but knowing that neither - // wxMSW nor wxGTK do it why bother... - #if 0 - MenuRef menuRef; - - GetEventParameter(event, - kEventParamDirectObject, - typeMenuRef, NULL, - sizeof(menuRef), NULL, - &menuRef); - #endif // 0 - - wxEventType type=0; - MenuCommand cmd=0; - switch (GetEventKind(event)) - { - case kEventMenuOpening: - type = wxEVT_MENU_OPEN; - break; - case kEventMenuClosed: - type = wxEVT_MENU_CLOSE; - break; - case kEventMenuTargetItem: - type = wxEVT_MENU_HIGHLIGHT; - GetEventParameter(event, kEventParamMenuCommand, - typeMenuCommand, NULL, - sizeof(cmd), NULL, &cmd); - if (cmd == 0) return eventNotHandledErr; - break; - default: - wxFAIL_MSG(wxT("Unexpected menu event kind")); - break; - } - - wxMenuEvent wxevent(type, cmd); - wxevent.SetEventObject(win); - - (void)win->GetEventHandler()->ProcessEvent(wxevent); - } - } - - return eventNotHandledErr; -} - -// due to the rather low-level event API of wxWindows, we cannot use RunApplicationEventLoop -// but have to use ReceiveNextEvent dealing with events manually, therefore we also have -// deal with clicks in the menu bar explicitely - -pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ; - -static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - Point point ; - UInt32 modifiers = 0; - EventMouseButton button = 0 ; - UInt32 click = 0 ; - - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &modifiers ); - GetEventParameter( event, kEventParamMouseButton, typeMouseButton, NULL, - sizeof( EventMouseButton ), NULL, &button ); - GetEventParameter( event, kEventParamClickCount, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &click ); - - if ( button == 0 || GetEventKind( event ) == kEventMouseUp ) - modifiers += btnState ; - - - switch( GetEventKind(event) ) - { - case kEventMouseDown : - { - WindowRef window ; - - short windowPart = ::FindWindow(point, &window); - - if ( windowPart == inMenuBar ) - { - MenuSelect( point ) ; - result = noErr ; - } - } - break ; - case kEventMouseDragged : - case kEventMouseUp : - { - if ( wxTheApp->s_captureWindow ) - wxMacWindowEventHandler( handler , event , (void*) wxTheApp->s_captureWindow->MacGetTopLevelWindow() ) ; - } - break ; - case kEventMouseMoved : - { - wxTheApp->MacHandleMouseMovedEvent( point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - } - break ; - } - - return result ; -} - -static pascal OSStatus CommandEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - HICommand command ; - - GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, - sizeof( HICommand ), NULL, &command ); - - MenuCommand id = command.commandID ; - if ( id == kHICommandPreferences ) - id = wxApp::s_macPreferencesMenuItemId ; - - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; - wxMenu* menu = NULL ; - wxMenuItem* item = NULL ; - - if ( mbar ) - { - item = mbar->FindItem( id , &menu ) ; - // it is not 100 % sure that an menu of id 0 is really ours, safety check - if ( id == 0 && menu != NULL && menu->GetHMenu() != command.menu.menuRef ) - { - item = NULL ; - menu = NULL ; - } - } - - if ( item == NULL || menu == NULL || mbar == NULL ) - return result ; - - switch( GetEventKind( event ) ) - { - case kEventProcessCommand : - { - if (item->IsCheckable()) - { - item->Check( !item->IsChecked() ) ; - } - - menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; - result = noErr ; - } - break ; - case kEventCommandUpdateStatus: - // eventually trigger an updateui round - result = noErr ; - break ; - default : - break ; - } - - return result ; -} - -static pascal OSStatus ApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - switch ( GetEventKind( event ) ) - { - case kEventAppActivated : - { - if ( wxTheApp ) - wxTheApp->MacResume( true ) ; - result = noErr ; - } - break ; - case kEventAppDeactivated : - { - if ( wxTheApp ) - wxTheApp->MacSuspend( true ) ; - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} - -pascal OSStatus wxAppEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - switch( GetEventClass( event ) ) - { - case kEventClassCommand : - result = CommandEventHandler( handler , event , data ) ; - break ; - case kEventClassApplication : - result = ApplicationEventHandler( handler , event , data ) ; - break ; - case kEventClassMenu : - result = MenuEventHandler( handler , event , data ) ; - break ; - case kEventClassMouse : - result = MouseEventHandler( handler , event , data ) ; - break ; - case kEventClassAppleEvent : - { - EventRecord rec ; - wxMacConvertEventToRecord( event , &rec ) ; - result = AEProcessAppleEvent( &rec ) ; - } - break ; - default : - break ; - } - - return result ; -} - -DEFINE_ONE_SHOT_HANDLER_GETTER( wxAppEventHandler ) - -#endif - -#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__) -// we know it's there ;-) -WXIMPORT char std::__throws_bad_alloc ; -#endif - -bool wxApp::Initialize(int& argc, wxChar **argv) -{ - int error = 0 ; - - // Mac-specific - - UMAInitToolbox( 4, sm_isEmbedded ) ; - SetEventMask( everyEvent ) ; - UMAShowWatchCursor() ; - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // open shared library resources from here since we don't have - // __wxinitialize in Mach-O shared libraries - wxStAppResource::OpenSharedLibraryResource(NULL); -#endif - -#ifndef __DARWIN__ - // test the minimal configuration necessary - -# if !TARGET_CARBON - long theSystem ; - long theMachine; - - if (Gestalt(gestaltMachineType, &theMachine) != noErr) - { - error = kMacSTRWrongMachine; - } - else if (theMachine < gestaltMacPlus) - { - error = kMacSTRWrongMachine; - } - else if (Gestalt(gestaltSystemVersion, &theSystem) != noErr ) - { - error = kMacSTROldSystem ; - } - else if ( theSystem < 0x0860 ) - { - error = kMacSTROldSystem ; - } - else if ((long)GetApplLimit() - (long)ApplicationZone() < kMacMinHeap) - { - error = kMacSTRSmallSize; - } -# endif - /* - else - { - if ( !UMAHasAppearance() ) - { - error = kMacSTRNoPre8Yet ; - } - } - */ -#endif - - // if we encountered any problems so far, give the error code and exit immediately - - if ( error ) - { - wxStAppResource resload ; - short itemHit; - Str255 message; - - GetIndString(message, 128, error); - UMAShowArrowCursor() ; - ParamText("\pFatal Error", message, (ConstStr255Param)"\p", (ConstStr255Param)"\p"); - itemHit = Alert(128, nil); - return FALSE ; - } - -#ifndef __DARWIN__ -# if __option(profile) - ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ; -# endif -#endif - -#ifndef __DARWIN__ - // now avoid exceptions thrown for new (bad_alloc) - // FIXME CS for some changes outside wxMac does not compile anymore -#if 0 - std::__throws_bad_alloc = 0 ; -#endif - -#endif - - s_macCursorRgn = ::NewRgn() ; - - // Mac OS X passes a process serial number command line argument when - // the application is launched from the Finder. This argument must be - // removed from the command line arguments before being handled by the - // application (otherwise applications would need to handle it) - if ( argc > 1 ) - { - static const wxChar *ARG_PSN = _T("-psn_"); - if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) - { - // remove this argument - --argc; - memmove(argv + 1, argv + 2, argc * sizeof(char *)); - } - } - - if ( !wxAppBase::Initialize(argc, argv) ) - return false; - -#if wxUSE_INTL - wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); -#endif - - - wxWinMacWindowList = new wxList(wxKEY_INTEGER); - wxWinMacControlList = new wxList(wxKEY_INTEGER); - - wxMacCreateNotifierTable() ; - - UMAShowArrowCursor() ; - - return true; -} - -bool wxApp::OnInitGui() -{ - if( !wxAppBase::OnInitGui() ) - return false ; - -#if TARGET_CARBON - InstallStandardEventHandler( GetApplicationEventTarget() ) ; - - if (!sm_isEmbedded) - { - InstallApplicationEventHandler( - GetwxAppEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, wxTheApp, (EventHandlerRef *)&(wxTheApp->m_macEventHandler)); - } -#endif - - if (!sm_isEmbedded) - { -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , - NewAEEventHandlerUPP(AEHandleODoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , - NewAEEventHandlerUPP(AEHandleOApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , - NewAEEventHandlerUPP(AEHandlePDoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEReopenApplication , - NewAEEventHandlerUPP(AEHandleRApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , - NewAEEventHandlerUPP(AEHandleQuit) , - 0 , FALSE ) ; -#else - AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , - NewAEEventHandlerProc(AEHandleODoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , - NewAEEventHandlerProc(AEHandleOApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , - NewAEEventHandlerProc(AEHandlePDoc) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEReopenApplication , - NewAEEventHandlerProc(AEHandleRApp) , - 0 , FALSE ) ; - AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , - NewAEEventHandlerProc(AEHandleQuit) , - 0 , FALSE ) ; -#endif - } - - return TRUE ; -} - -void wxApp::CleanUp() -{ - wxToolTip::RemoveToolTips() ; - - // One last chance for pending objects to be cleaned up - wxTheApp->DeletePendingObjects(); - - wxMacDestroyNotifierTable() ; - - delete wxWinMacWindowList ; - wxWinMacWindowList = NULL; - - delete wxWinMacControlList ; - wxWinMacControlList = NULL; - -#ifndef __DARWIN__ -# if __option(profile) - ProfilerDump( (StringPtr)"\papp.prof" ) ; - ProfilerTerm() ; -# endif -#endif - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // close shared library resources from here since we don't have - // __wxterminate in Mach-O shared libraries - wxStAppResource::CloseSharedLibraryResource(); -#endif - - UMACleanupToolbox() ; - if (s_macCursorRgn) { - ::DisposeRgn((RgnHandle)s_macCursorRgn); - } - - #if 0 - TerminateAE() ; - #endif - - wxAppBase::CleanUp(); -} - -//---------------------------------------------------------------------- -// misc initialization stuff -//---------------------------------------------------------------------- - -// extern variable for shared library resource id -// need to be able to find it with NSLookupAndBindSymbol -short gSharedLibraryResource = kResFileNotOpened ; - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) -CFBundleRef gSharedLibraryBundle = NULL; -#endif /* WXMAKINGDLL_CORE && __DARWIN__ */ - -wxStAppResource::wxStAppResource() -{ - m_currentRefNum = CurResFile() ; - if ( gSharedLibraryResource != kResFileNotOpened ) - { - UseResFile( gSharedLibraryResource ) ; - } -} - -wxStAppResource::~wxStAppResource() -{ - if ( m_currentRefNum != kResFileNotOpened ) - { - UseResFile( m_currentRefNum ) ; - } -} - -void wxStAppResource::OpenSharedLibraryResource(const void *initBlock) -{ - gSharedLibraryResource = kResFileNotOpened; - -#ifdef WXMAKINGDLL_CORE - if ( initBlock != NULL ) { - const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock; - FSSpec *fileSpec = NULL; - - if (theInitBlock->fragLocator.where == kDataForkCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec; - } - else if (theInitBlock->fragLocator.where == kResourceCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec; - } - - if (fileSpec != NULL) { - gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm); - } - } - else { -#ifdef __DARWIN__ - // Open the shared library resource file if it is not yet open - NSSymbol theSymbol; - NSModule theModule; - const char *theLibPath; - - gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows")); - if (gSharedLibraryBundle != NULL) { - // wxWindows has been bundled into a framework - // load the framework resources - - gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle); - } - else { - // wxWindows is a simple dynamic shared library - // load the resources from the data fork of a separate resource file - wxString theResPath; - wxString theName; - FSRef theResRef; - OSErr theErr = noErr; - - // get the library path - theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource"); - theModule = NSModuleForSymbol(theSymbol); - theLibPath = NSLibraryNameForModule(theModule); - - // if we call wxLogDebug from here then, as wxTheApp hasn't been - // created yet when we're called from wxApp::Initialize(), wxLog - // is going to create a default stderr-based log target instead of - // the expected normal GUI one -- don't do it, if we really want - // to see this message just use fprintf() here -#if 0 - wxLogDebug( wxT("wxMac library installation name is '%s'"), - theLibPath ); -#endif - - // allocate copy to replace .dylib.* extension with .rsrc - if (theLibPath != NULL) { -#if wxUSE_UNICODE - theResPath = wxString(theLibPath, wxConvLocal); -#else - theResPath = wxString(theLibPath); -#endif - // replace '_core' with '' in case of multi-lib build - theResPath.Replace(wxT("_core"), wxEmptyString); - // replace ".dylib" shared library extension with ".rsrc" - theResPath.Replace(wxT(".dylib"), wxT(".rsrc")); - // Find the begining of the filename - theName = theResPath.AfterLast('/'); - -#if 0 - wxLogDebug( wxT("wxMac resources file name is '%s'"), - theResPath.mb_str() ); -#endif - - theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false); - if (theErr != noErr) { - // try in current directory (using name only) - theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false); - } - - // open the resource file - if (theErr == noErr) { - theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm, - &gSharedLibraryResource); - } - if (theErr != noErr) { -#ifdef __WXDEBUG__ - wxLogDebug( wxT("unable to open wxMac resource file '%s'\n"), - theResPath.mb_str() ); -#endif // __WXDEBUG__ - } - - } - } -#endif /* __DARWIN__ */ - } -#endif /* WXMAKINGDLL_CORE */ -} - -void wxStAppResource::CloseSharedLibraryResource() -{ -#ifdef WXMAKINGDLL_CORE - // Close the shared library resource file - if (gSharedLibraryResource != kResFileNotOpened) { -#ifdef __DARWIN__ - if (gSharedLibraryBundle != NULL) { - CFBundleCloseBundleResourceMap(gSharedLibraryBundle, - gSharedLibraryResource); - gSharedLibraryBundle = NULL; - } - else -#endif /* __DARWIN__ */ - { - CloseResFile(gSharedLibraryResource); - } - gSharedLibraryResource = kResFileNotOpened; - } -#endif /* WXMAKINGDLL_CORE */ -} - -#if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__) - -// for shared libraries we have to manually get the correct resource -// ref num upon initializing and releasing when terminating, therefore -// the __wxinitialize and __wxterminate must be used - -extern "C" { - void __sinit(void); /* (generated by linker) */ - pascal OSErr __initialize(const CFragInitBlock *theInitBlock); - pascal void __terminate(void); -} - -pascal OSErr __wxinitialize(const CFragInitBlock *theInitBlock) -{ - wxStAppResource::OpenSharedLibraryResource( theInitBlock ) ; - return __initialize( theInitBlock ) ; -} - -pascal void __wxterminate(void) -{ - wxStAppResource::CloseSharedLibraryResource() ; - __terminate() ; -} - -#endif /* WXMAKINGDLL_CORE && !__DARWIN__ */ - -#if TARGET_CARBON - -bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec) -{ - bool converted = ConvertEventRefToEventRecord( event,rec) ; - OSStatus err = noErr ; - if ( !converted ) - { - switch( GetEventClass( event ) ) - { - case kEventClassKeyboard : - { - converted = true ; - switch( GetEventKind(event) ) - { - case kEventRawKeyDown : - rec->what = keyDown ; - break ; - case kEventRawKeyRepeat : - rec->what = autoKey ; - break ; - case kEventRawKeyUp : - rec->what = keyUp ; - break ; - case kEventRawKeyModifiersChanged : - rec->what = nullEvent ; - break ; - default : - converted = false ; - break ; - } - if ( converted ) - { - UInt32 keyCode ; - unsigned char charCode ; - UInt32 modifiers ; - GetMouse( &rec->where) ; - - err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers); - err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode); - err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode); - rec->modifiers = modifiers ; - rec->message = (keyCode << 8 ) + charCode ; - } - } - break ; - case kEventClassTextInput : - { - switch( GetEventKind( event ) ) - { - case kEventTextInputUnicodeForKeyEvent : - { - EventRef rawEvent ; - err = GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ; - converted = true ; - { - UInt32 keyCode ; - unsigned char charCode ; - UInt32 modifiers ; - GetMouse( &rec->where) ; - rec->what = keyDown ; - err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers); - err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode); - err = GetEventParameter(rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode); - rec->modifiers = modifiers ; - rec->message = (keyCode << 8 ) + charCode ; - } - } - break ; - default : - break ; - } - } - break ; - } - } - - return converted ; -} - -/* -pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - EventRecord rec ; - switch ( GetEventClass( event ) ) - { - case kEventClassKeyboard : - if ( wxMacConvertEventToRecord( event , &rec ) ) - { - wxTheApp->MacHandleModifierEvents( &rec ) ; - wxTheApp->MacHandleOneEvent( &rec ) ; - result = noErr ; - } - break ; - case kEventClassTextInput : - if ( wxMacConvertEventToRecord( event , &rec ) ) - { - wxTheApp->MacHandleModifierEvents( &rec ) ; - wxTheApp->MacHandleOneEvent( &rec ) ; - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} -*/ -#endif - -wxApp::wxApp() -{ - m_printMode = wxPRINT_WINDOWS; - m_auto3D = TRUE; - - m_macCurrentEvent = NULL ; -#if TARGET_CARBON - m_macCurrentEventHandlerCallRef = NULL ; -#endif -} - -int wxApp::MainLoop() -{ - m_keepGoing = TRUE; - - while (m_keepGoing) - { - MacDoOneEvent() ; - } - - return 0; -} - -void wxApp::ExitMainLoop() -{ - m_keepGoing = FALSE; -} - -// Is a message/event pending? -bool wxApp::Pending() -{ -#if TARGET_CARBON - // without the receive event (with pull param = false ) nothing is ever reported - EventRef theEvent; - ReceiveNextEvent (0, NULL, kEventDurationNoWait, false, &theEvent); - return GetNumEventsInQueue( GetMainEventQueue() ) > 0 ; -#else - EventRecord event ; - - return EventAvail( everyEvent , &event ) ; -#endif -} - -// Dispatch a message. -bool wxApp::Dispatch() -{ - MacDoOneEvent() ; - - return true; -} - -void wxApp::OnIdle(wxIdleEvent& event) -{ - wxAppBase::OnIdle(event); - - // If they are pending events, we must process them: pending events are - // either events to the threads other than main or events posted with - // wxPostEvent() functions - wxMacProcessNotifierAndPendingEvents(); - - if(!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar()) - wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar(); -} - -void wxApp::WakeUpIdle() -{ - wxMacWakeUp() ; -} - -void wxApp::Exit() -{ - wxApp::CleanUp(); - ::ExitToShell() ; -} - -void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event)) -{ - if (GetTopWindow()) - GetTopWindow()->Close(TRUE); -} - -// Default behaviour: close the application with prompts. The -// user can veto the close, and therefore the end session. -void wxApp::OnQueryEndSession(wxCloseEvent& event) -{ - if (GetTopWindow()) - { - if (!GetTopWindow()->Close(!event.CanVeto())) - event.Veto(TRUE); - } -} - -extern "C" void wxCYield() ; -void wxCYield() -{ - wxYield() ; -} - -// Yield to other processes - -bool wxApp::Yield(bool onlyIfNeeded) -{ - if (s_inYield) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } - - return FALSE; - } - - s_inYield = TRUE; - -#if wxUSE_THREADS - YieldToAnyThread() ; -#endif - // by definition yield should handle all non-processed events -#if TARGET_CARBON - EventRef theEvent; - - OSStatus status = noErr ; - do - { - s_inReceiveEvent = true ; - status = ReceiveNextEvent(0, NULL,kEventDurationNoWait,true,&theEvent) ; - s_inReceiveEvent = false ; - - if ( status == eventLoopTimedOutErr ) - { - // make sure next time the event loop will trigger idle events - sleepTime = kEventDurationNoWait ; - } - else if ( status == eventLoopQuitErr ) - { - // according to QA1061 this may also occur when a WakeUp Process - // is executed - } - else - { - MacHandleOneEvent( theEvent ) ; - ReleaseEvent(theEvent); - } - } while( status == noErr ) ; -#else - EventRecord event ; - - // having a larger value here leads to large performance slowdowns - // so we cannot give background apps more processor time here - // we do so however having a large sleep value in the main event loop - sleepTime = 0 ; - - while ( !IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, (RgnHandle) wxApp::s_macCursorRgn)) - { - MacHandleModifierEvents( &event ) ; - MacHandleOneEvent( &event ); - if ( event.what != kHighLevelEvent ) - SetRectRgn( (RgnHandle) wxApp::s_macCursorRgn , event.where.h , event.where.v , event.where.h + 1 , event.where.v + 1 ) ; - } - MacHandleModifierEvents( &event ) ; -#endif - - wxMacProcessNotifierAndPendingEvents() ; - s_inYield = FALSE; - - return TRUE; -} - -// platform specifics - -void wxApp::MacSuspend( bool convertClipboard ) -{ -#if !TARGET_CARBON - // we have to deactive the top level windows manually - - wxWindowListNode* node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxTopLevelWindow* win = (wxTopLevelWindow*) node->Data(); -#if TARGET_CARBON -#if 0 // having problems right now with that - if (!win->HasFlag(wxSTAY_ON_TOP)) -#endif -#endif - win->MacActivate( ((EventRecord*) MacGetCurrentEvent())->when , false ) ; - - node = node->GetNext(); - } - - ::HideFloatingWindows() ; -#endif - s_lastMouseDown = 0 ; - - if( convertClipboard ) - { - MacConvertPrivateToPublicScrap() ; - } -} - -extern wxList wxModalDialogs; - -void wxApp::MacResume( bool convertClipboard ) -{ - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPublicToPrivateScrap() ; - } - -#if !TARGET_CARBON - ::ShowFloatingWindows() ; - // raise modal dialogs in case a non modal window was selected to activate the app - - wxNode* node = wxModalDialogs.GetFirst(); - while (node) - { - wxDialog* dialog = (wxDialog *) node->GetData(); - dialog->Raise(); - - node = node->GetNext(); - } -#endif -} - -void wxApp::MacConvertPrivateToPublicScrap() -{ -} - -void wxApp::MacConvertPublicToPrivateScrap() -{ -} - -void wxApp::MacDoOneEvent() -{ -#if TARGET_CARBON - EventRef theEvent; - - s_inReceiveEvent = true ; - OSStatus status = ReceiveNextEvent(0, NULL,sleepTime,true,&theEvent) ; - s_inReceiveEvent = false ; - if ( status == eventLoopTimedOutErr ) - { - if ( wxTheApp->ProcessIdle() ) - sleepTime = kEventDurationNoWait ; - else - { -#if wxUSE_THREADS - if (g_numberOfThreads) - { - sleepTime = kEventDurationNoWait; - } - else -#endif // wxUSE_THREADS - { - sleepTime = kEventDurationSecond; - } - } - } - else if ( status == eventLoopQuitErr ) - { - // according to QA1061 this may also occur when a WakeUp Process - // is executed - } - else - { - MacHandleOneEvent( theEvent ) ; - ReleaseEvent(theEvent); - sleepTime = kEventDurationNoWait ; - } -#else - EventRecord event ; - - EventMask eventMask = everyEvent ; - - if (WaitNextEvent(eventMask, &event, sleepTime, (RgnHandle) s_macCursorRgn)) - { - MacHandleModifierEvents( &event ) ; - MacHandleOneEvent( &event ); - } - else - { - MacHandleModifierEvents( &event ) ; - // idlers - WindowPtr window = ::FrontWindow() ; - if ( window ) - ::IdleControls( window ) ; - - if ( wxTheApp->ProcessIdle() ) - sleepTime = kEventDurationNoWait; - else - { -#if wxUSE_THREADS - if (g_numberOfThreads) - { - sleepTime = kEventDurationNoWait; - } - else -#endif // wxUSE_THREADS - { - sleepTime = kEventDurationSecond; - } - } - } - if ( event.what != kHighLevelEvent ) - SetRectRgn( (RgnHandle) s_macCursorRgn , event.where.h , event.where.v , event.where.h + 1 , event.where.v + 1 ) ; -#endif - // repeaters - - DeletePendingObjects() ; - wxMacProcessNotifierAndPendingEvents() ; -} - -/*virtual*/ void wxApp::MacHandleUnhandledEvent( WXEVENTREF evr ) -{ - // Override to process unhandled events as you please -} - -void wxApp::MacHandleOneEvent( WXEVENTREF evr ) -{ -#if TARGET_CARBON - EventTargetRef theTarget; - theTarget = GetEventDispatcherTarget(); - m_macCurrentEvent = evr ; - OSStatus status = SendEventToEventTarget ((EventRef) evr , theTarget); - if(status == eventNotHandledErr) - { - MacHandleUnhandledEvent(evr); - } -#else - EventRecord* ev = (EventRecord*) evr ; - m_macCurrentEvent = ev ; - - wxApp::sm_lastMessageTime = ev->when ; - - switch (ev->what) - { - case mouseDown: - MacHandleMouseDownEvent( ev ) ; - if ( ev->modifiers & controlKey ) - s_lastMouseDown = 2; - else - s_lastMouseDown = 1; - break; - case mouseUp: - if ( s_lastMouseDown == 2 ) - { - ev->modifiers |= controlKey ; - } - else - { - ev->modifiers &= ~controlKey ; - } - MacHandleMouseUpEvent( ev ) ; - s_lastMouseDown = 0; - break; - case activateEvt: - MacHandleActivateEvent( ev ) ; - break; - case updateEvt: - // In embedded mode we first let the UnhandledEvent function - // try to handle the update event. If we handle it ourselves - // first and then pass it on, the host's windows won't update. - MacHandleUnhandledEvent(ev); - MacHandleUpdateEvent( ev ) ; - break; - case keyDown: - case autoKey: - MacHandleKeyDownEvent( ev ) ; - break; - case keyUp: - MacHandleKeyUpEvent( ev ) ; - break; - case diskEvt: - MacHandleDiskEvent( ev ) ; - break; - case osEvt: - MacHandleOSEvent( ev ) ; - break; - case kHighLevelEvent: - MacHandleHighLevelEvent( ev ) ; - break; - default: - break; - } -#endif - wxMacProcessNotifierAndPendingEvents() ; -} - -#if !TARGET_CARBON -bool s_macIsInModalLoop = false ; - -void wxApp::MacHandleModifierEvents( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - if ( ev->modifiers != s_lastModifiers && wxWindow::FindFocus() != NULL ) - { - wxKeyEvent event(wxEVT_KEY_DOWN); - - event.m_shiftDown = ev->modifiers & shiftKey; - event.m_controlDown = ev->modifiers & controlKey; - event.m_altDown = ev->modifiers & optionKey; - event.m_metaDown = ev->modifiers & cmdKey; - - event.m_x = ev->where.h; - event.m_y = ev->where.v; - event.m_timeStamp = ev->when; - wxWindow* focus = wxWindow::FindFocus() ; - event.SetEventObject(focus); - - if ( (ev->modifiers ^ s_lastModifiers ) & controlKey ) - { - event.m_keyCode = WXK_CONTROL ; - event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey ) - { - event.m_keyCode = WXK_SHIFT ; - event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( (ev->modifiers ^ s_lastModifiers ) & optionKey ) - { - event.m_keyCode = WXK_ALT ; - event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( ( ev->modifiers ^ s_lastModifiers ) & cmdKey ) - { - event.m_keyCode = WXK_COMMAND ; - event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - s_lastModifiers = ev->modifiers ; - } -} - -void wxApp::MacHandleHighLevelEvent( WXEVENTREF evr ) -{ - // we must avoid reentrancy problems when processing high level events eg printing - bool former = s_inYield ; - s_inYield = TRUE ; - EventRecord* ev = (EventRecord*) evr ; - ::AEProcessAppleEvent( ev ) ; - s_inYield = former ; -} - -void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - WindowRef window; - WindowRef frontWindow = ::FrontNonFloatingWindow() ; - WindowAttributes frontWindowAttributes = NULL ; - if ( frontWindow ) - ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ; - - short windowPart = ::FindWindow(ev->where, &window); - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( wxPendingDelete.Member(win) ) - return ; - - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - switch (windowPart) - { - case inMenuBar : - if ( s_macIsInModalLoop ) - { - SysBeep ( 30 ) ; - } - else - { - UInt32 menuresult = MenuSelect(ev->where) ; - MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ); - s_lastMouseDown = 0; - } - break ; - case inSysWindow : - SystemClick( ev , window ) ; - s_lastMouseDown = 0; - break ; - case inDrag : - if ( window != frontWindow && s_macIsInModalLoop && !(ev->modifiers & cmdKey ) ) - { - SysBeep ( 30 ) ; - } - else - { - DragWindow(window, ev->where, &screenBits.bounds); - if (win) - { - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort(window) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - win->SetSize( pt.h , pt.v , -1 , - -1 , wxSIZE_USE_EXISTING); - } - s_lastMouseDown = 0; - } - break ; - case inGoAway: - if (TrackGoAway(window, ev->where)) - { - if ( win ) - win->Close() ; - } - s_lastMouseDown = 0; - break; - case inGrow: - { - Rect newContentRect ; - Rect constraintRect ; - constraintRect.top = win->GetMinHeight() ; - if ( constraintRect.top == -1 ) - constraintRect.top = 0 ; - constraintRect.left = win->GetMinWidth() ; - if ( constraintRect.left == -1 ) - constraintRect.left = 0 ; - constraintRect.right = win->GetMaxWidth() ; - if ( constraintRect.right == -1 ) - constraintRect.right = 32000 ; - constraintRect.bottom = win->GetMaxHeight() ; - if ( constraintRect.bottom == -1 ) - constraintRect.bottom = 32000 ; - - Boolean growResult = ResizeWindow( window , ev->where , - &constraintRect , &newContentRect ) ; - if ( growResult ) - { - win->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - } - s_lastMouseDown = 0; - } - break; - case inZoomIn: - case inZoomOut: - if (TrackBox(window, ev->where, windowPart)) - { - // TODO setup size event - ZoomWindow( window , windowPart , false ) ; - if (win) - { - Rect tempRect ; - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort(window) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - - GetWindowPortBounds(window, &tempRect ) ; - win->SetSize( pt.h , pt.v , tempRect.right-tempRect.left , - tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); - } - } - s_lastMouseDown = 0; - break; - case inCollapseBox : - // TODO setup size event - s_lastMouseDown = 0; - break ; - - case inContent : - { - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort(window) ; - SetPort( port ) ; - } - if ( window != frontWindow && wxTheApp->s_captureWindow == NULL ) - { - if ( s_macIsInModalLoop ) - { - SysBeep ( 30 ) ; - } - else if ( UMAIsWindowFloating( window ) ) - { - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - else - { - // Activate window first - ::SelectWindow( window ) ; - - // Send event later - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - } - else - { - if ( win ) - win->MacMouseDown( ev , windowPart ) ; - } - break ; - default: - break; - } -} - -void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window; - - short windowPart = inNoWindow ; - if ( wxTheApp->s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - windowPart = ::FindWindow(ev->where, &window) ; - } - - switch (windowPart) - { - case inMenuBar : - break ; - case inSysWindow : - break ; - default: - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacMouseUp( ev , windowPart ) ; - } - break; - } -} - -#endif - -long wxMacTranslateKey(unsigned char key, unsigned char code) ; -long wxMacTranslateKey(unsigned char key, unsigned char code) -{ - long retval = key ; - switch (key) - { - case kHomeCharCode : - retval = WXK_HOME; - break; - case kEnterCharCode : - retval = WXK_RETURN; - break; - case kEndCharCode : - retval = WXK_END; - break; - case kHelpCharCode : - retval = WXK_HELP; - break; - case kBackspaceCharCode : - retval = WXK_BACK; - break; - case kTabCharCode : - retval = WXK_TAB; - break; - case kPageUpCharCode : - retval = WXK_PAGEUP; - break; - case kPageDownCharCode : - retval = WXK_PAGEDOWN; - break; - case kReturnCharCode : - retval = WXK_RETURN; - break; - case kFunctionKeyCharCode : - { - switch( code ) - { - case 0x7a : - retval = WXK_F1 ; - break; - case 0x78 : - retval = WXK_F2 ; - break; - case 0x63 : - retval = WXK_F3 ; - break; - case 0x76 : - retval = WXK_F4 ; - break; - case 0x60 : - retval = WXK_F5 ; - break; - case 0x61 : - retval = WXK_F6 ; - break; - case 0x62: - retval = WXK_F7 ; - break; - case 0x64 : - retval = WXK_F8 ; - break; - case 0x65 : - retval = WXK_F9 ; - break; - case 0x6D : - retval = WXK_F10 ; - break; - case 0x67 : - retval = WXK_F11 ; - break; - case 0x6F : - retval = WXK_F12 ; - break; - case 0x69 : - retval = WXK_F13 ; - break; - case 0x6B : - retval = WXK_F14 ; - break; - case 0x71 : - retval = WXK_F15 ; - break; - } - } - break ; - case kEscapeCharCode : - retval = WXK_ESCAPE ; - break ; - case kLeftArrowCharCode : - retval = WXK_LEFT ; - break ; - case kRightArrowCharCode : - retval = WXK_RIGHT ; - break ; - case kUpArrowCharCode : - retval = WXK_UP ; - break ; - case kDownArrowCharCode : - retval = WXK_DOWN ; - break ; - case kDeleteCharCode : - retval = WXK_DELETE ; - default: - break ; - } // end switch - - return retval; -} - -int wxKeyCodeToMacModifier(wxKeyCode key) -{ - switch (key) - { - case WXK_START: - case WXK_MENU: - return cmdKey; - - case WXK_SHIFT: - return shiftKey; - - case WXK_CAPITAL: - return alphaLock; - - case WXK_ALT: - return optionKey; - - case WXK_CONTROL: - return controlKey; - - default: - return 0; - } -} - -bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below -{ -//#ifdef __DARWIN__ -// wxHIDKeyboard keyboard; -// return keyboard.IsActive(key); -//#else -// TODO: Have it use HID Manager on OSX... -//if OS X > 10.2 (i.e. 10.2.x) -//a known apple bug prevents the system from determining led -//states with GetKeys... can only determine caps lock led - return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); -//else -// KeyMapByteArray keymap; -// GetKeys((BigEndianLong*)keymap); -// return !!(BitTst(keymap, (sizeof(KeyMapByteArray)*8) - iKey)); -//#endif -} - -#if !TARGET_CARBON -void wxApp::MacHandleKeyDownEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - UInt32 menuresult = UMAMenuEvent(ev) ; - if ( HiWord( menuresult ) ) - { - if ( !s_macIsInModalLoop ) - MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ; - } - else - { - wxWindow* focus = wxWindow::FindFocus() ; - - if ( MacSendKeyDownEvent( focus , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) == false ) - { -#if 0 - // we must handle control keys the other way round, otherwise text content is updated too late - // has not been handled -> perform default - wxControl* control = wxDynamicCast( focus , wxControl ) ; - if ( control && control->GetMacControl() != NULL ) - { - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - ::HandleControlKey( (ControlHandle) control->GetMacControl() , keycode , keychar , ev->modifiers ) ; - } -#endif - } - } -} - -void wxApp::MacHandleKeyUpEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - wxToolTip::RemoveToolTips() ; - - UInt32 menuresult = UMAMenuEvent(ev) ; - if ( HiWord( menuresult ) ) - { - } - else - { - MacSendKeyUpEvent( wxWindow::FindFocus() , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) ; - } -} - -#endif - -bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey ) -{ - if ( !focus ) - return false ; - - short keycode ; - short keychar ; - keychar = short(keymessage & charCodeMask); - keycode = short(keymessage & keyCodeMask) >> 8 ; - - if ( modifiers & ( controlKey|shiftKey|optionKey ) ) - { - // control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier - // and look at the character after - UInt32 state = 0; - UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey|shiftKey|optionKey))) | keycode, &state); - keychar = short(keyInfo & charCodeMask); - keycode = short(keyInfo & keyCodeMask) >> 8 ; - } - long keyval = wxMacTranslateKey(keychar, keycode) ; - long realkeyval = keyval ; - if ( keyval == keychar ) - { - // we are not on a special character combo -> pass the real os event-value to EVT_CHAR, but not to EVT_KEY (make upper first) - realkeyval = short(keymessage & charCodeMask) ; - keyval = wxToupper( keyval ) ; - } - - wxKeyEvent event(wxEVT_KEY_DOWN); - bool handled = false ; - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - event.m_keyCode = keyval ; - - event.m_x = wherex; - event.m_y = wherey; - event.m_timeStamp = when; - event.SetEventObject(focus); - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - if ( handled && event.GetSkipped() ) - handled = false ; - if ( !handled ) - { -#if wxUSE_ACCEL - if (!handled) - { - wxWindow *ancestor = focus; - while (ancestor) - { - int command = ancestor->GetAcceleratorTable()->GetCommand( event ); - if (command != -1) - { - wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); - handled = ancestor->GetEventHandler()->ProcessEvent( command_event ); - break; - } - if (ancestor->IsTopLevel()) - break; - ancestor = ancestor->GetParent(); - } - } -#endif // wxUSE_ACCEL - } - if (!handled) - { - event.Skip( FALSE ) ; - event.SetEventType( wxEVT_CHAR ) ; - // raw value again - event.m_keyCode = realkeyval ; - - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - if ( handled && event.GetSkipped() ) - handled = false ; - } - if ( !handled && - (keyval == WXK_TAB) && -// CS: copied the change below from wxGTK -// VZ: testing for wxTE_PROCESS_TAB shouldn't be done here the control may -// have this style, yet choose not to process this particular TAB in which -// case TAB must still work as a navigational character -#if 0 - (!focus->HasFlag(wxTE_PROCESS_TAB)) && -#endif - (focus->GetParent()) && - (focus->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) - { - wxNavigationKeyEvent new_event; - new_event.SetEventObject( focus ); - new_event.SetDirection( !event.ShiftDown() ); - /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - new_event.SetWindowChange( event.ControlDown() ); - new_event.SetCurrentFocus( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); - if ( handled && new_event.GetSkipped() ) - handled = false ; - } - // backdoor handler for default return and command escape - if ( !handled && (!focus->IsKindOf(CLASSINFO(wxControl) ) || !focus->MacCanFocus() ) ) - { - // if window is not having a focus still testing for default enter or cancel - // TODO add the UMA version for ActiveNonFloatingWindow - wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ; - if ( focus ) - { - if ( keyval == WXK_RETURN ) - { - wxButton *def = wxDynamicCast(focus->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return true ; - } - } - /* generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) */ - else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) ) - { - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); - new_event.SetEventObject( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); - } - } - } - return handled ; -} - -bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey ) -{ - if ( !focus ) - return false ; - - short keycode ; - short keychar ; - keychar = short(keymessage & charCodeMask); - keycode = short(keymessage & keyCodeMask) >> 8 ; - if ( modifiers & ( controlKey|shiftKey|optionKey ) ) - { - // control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier - // and look at the character after - UInt32 state = 0; - UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey|shiftKey|optionKey))) | keycode, &state); - keychar = short(keyInfo & charCodeMask); - keycode = short(keyInfo & keyCodeMask) >> 8 ; - } - long keyval = wxMacTranslateKey(keychar, keycode) ; - - if ( keyval == keychar ) - { - keyval = wxToupper( keyval ) ; - } - bool handled = false ; - - wxKeyEvent event(wxEVT_KEY_UP); - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - event.m_keyCode = keyval ; - - event.m_x = wherex; - event.m_y = wherey; - event.m_timeStamp = when; - event.SetEventObject(focus); - handled = focus->GetEventHandler()->ProcessEvent( event ) ; - - return handled ; -} - -#if !TARGET_CARBON -void wxApp::MacHandleActivateEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window = (WindowRef) ev->message ; - if ( window ) - { - bool activate = (ev->modifiers & activeFlag ) ; - WindowClass wclass ; - ::GetWindowClass ( window , &wclass ) ; - if ( wclass == kFloatingWindowClass ) - { - // if it is a floater we activate/deactivate the front non-floating window instead - window = ::FrontNonFloatingWindow() ; - } - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacActivate( ev->when , activate ) ; - } -} - -void wxApp::MacHandleUpdateEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - WindowRef window = (WindowRef) ev->message ; - wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ; - if ( win ) - { - if ( !wxPendingDelete.Member(win) ) - win->MacUpdate( ev->when ) ; - } - else - { - // since there is no way of telling this foreign window to update itself - // we have to invalidate the update region otherwise we keep getting the same - // event over and over again - BeginUpdate( window ) ; - EndUpdate( window ) ; - } -} - -void wxApp::MacHandleDiskEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - if ( HiWord( ev->message ) != noErr ) - { - OSErr err ; - Point point ; - SetPt( &point , 100 , 100 ) ; - - err = DIBadMount( point , ev->message ) ; - wxASSERT( err == noErr ) ; - } -} - -void wxApp::MacHandleOSEvent( WXEVENTREF evr ) -{ - EventRecord* ev = (EventRecord*) evr ; - switch( ( ev->message & osEvtMessageMask ) >> 24 ) - { - case suspendResumeMessage : - { - bool isResuming = ev->message & resumeFlag ; - bool convertClipboard = ev->message & convertClipboardFlag ; - - bool doesActivate = UMAGetProcessModeDoesActivateOnFGSwitch() ; - if ( isResuming ) - { - WindowRef oldFrontWindow = NULL ; - WindowRef newFrontWindow = NULL ; - - // in case we don't take care of activating ourselves, we have to synchronize - // our idea of the active window with the process manager's - which it already activated - - if ( !doesActivate ) - oldFrontWindow = ::FrontNonFloatingWindow() ; - - MacResume( convertClipboard ) ; - - newFrontWindow = ::FrontNonFloatingWindow() ; - - if ( oldFrontWindow ) - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ; - if ( win ) - win->MacActivate( ev->when , false ) ; - } - if ( newFrontWindow ) - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( newFrontWindow ) ; - if ( win ) - win->MacActivate( ev->when , true ) ; - } - } - else - { - MacSuspend( convertClipboard ) ; - } - } - break ; - case mouseMovedMessage : - { - WindowRef window; - - wxWindow* currentMouseWindow = NULL ; - - if (s_captureWindow ) - { - currentMouseWindow = s_captureWindow ; - } - else - { - wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , - ¤tMouseWindow ) ; - } - - if ( currentMouseWindow != wxWindow::s_lastMouseWindow ) - { - wxMouseEvent event ; - - bool isDown = !(ev->modifiers & btnState) ; // 1 is for up - bool controlDown = ev->modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - event.m_shiftDown = ev->modifiers & shiftKey; - event.m_controlDown = ev->modifiers & controlKey; - event.m_altDown = ev->modifiers & optionKey; - event.m_metaDown = ev->modifiers & cmdKey; - event.m_x = ev->where.h; - event.m_y = ev->where.v; - event.m_timeStamp = ev->when; - event.SetEventObject(this); - - if ( wxWindow::s_lastMouseWindow ) - { - wxMouseEvent eventleave(event); - eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); - wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); - eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; - - wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); - } - if ( currentMouseWindow ) - { - wxMouseEvent evententer(event); - evententer.SetEventType( wxEVT_ENTER_WINDOW ); - currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y ); - evententer.SetEventObject( currentMouseWindow ) ; - currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); - } - wxWindow::s_lastMouseWindow = currentMouseWindow ; - } - - short windowPart = inNoWindow ; - - if ( s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - windowPart = ::FindWindow(ev->where, &window); - } - - switch (windowPart) - { - case inContent : - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacMouseMoved( ev , windowPart ) ; - else - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - } - break; - default : - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - break ; - } - } - break ; - - } -} -#else - -void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp) -{ - WindowRef window; - - wxWindow* currentMouseWindow = NULL ; - - if (s_captureWindow ) - { - currentMouseWindow = s_captureWindow ; - } - else - { - wxWindow::MacGetWindowFromPoint( wxPoint( x, y ) , ¤tMouseWindow ) ; - } - - if ( currentMouseWindow != wxWindow::s_lastMouseWindow ) - { - wxMouseEvent event ; - - bool isDown = !(modifiers & btnState) ; // 1 is for up - bool controlDown = modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - event.m_x = x; - event.m_y = y; - event.m_timeStamp = timestamp; - - if ( wxWindow::s_lastMouseWindow ) - { - wxMouseEvent eventleave(event); - eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); - wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); - eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; - -#if wxUSE_TOOLTIPS - wxToolTip::RelayEvent( wxWindow::s_lastMouseWindow , eventleave); -#endif // wxUSE_TOOLTIPS - wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); - } - if ( currentMouseWindow ) - { - wxMouseEvent evententer(event); - evententer.SetEventType( wxEVT_ENTER_WINDOW ); - currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y ); - evententer.SetEventObject( currentMouseWindow ) ; -#if wxUSE_TOOLTIPS - wxToolTip::RelayEvent( currentMouseWindow , evententer); -#endif // wxUSE_TOOLTIPS - currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); - } - wxWindow::s_lastMouseWindow = currentMouseWindow ; - } - - short windowPart = inNoWindow ; - - if ( s_captureWindow ) - { - window = (WindowRef) s_captureWindow->MacGetRootWindow() ; - windowPart = inContent ; - } - else - { - Point pt= { y , x } ; - windowPart = ::FindWindow(pt , &window); - } - - switch (windowPart) - { - case inContent : - { - wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - win->MacFireMouseEvent( nullEvent , x , y , modifiers , timestamp ) ; - else - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - } - break; - default : - { - if ( wxIsBusy() ) - { - } - else - UMAShowArrowCursor(); - } - break ; - } -} -#endif - -void wxApp::MacHandleMenuCommand( wxUint32 id ) -{ - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; - wxFrame* frame = mbar->GetFrame(); - wxCHECK_RET( mbar != NULL && frame != NULL, wxT("error in menu item callback") ); - if ( frame ) - { - frame->ProcessCommand(id); - } -} - -#if !TARGET_CARBON -void wxApp::MacHandleMenuSelect( int macMenuId , int macMenuItemNum ) -{ - if (macMenuId == 0) - return; // no menu item selected - - if (macMenuId == kwxMacAppleMenuId && macMenuItemNum > 1) - { - #if ! TARGET_CARBON - Str255 deskAccessoryName ; - GrafPtr savedPort ; - - GetMenuItemText(GetMenuHandle(kwxMacAppleMenuId), macMenuItemNum, deskAccessoryName); - GetPort(&savedPort); - OpenDeskAcc(deskAccessoryName); - SetPort(savedPort); - #endif - } - else - { - MenuCommand id ; - GetMenuItemCommandID( GetMenuHandle(macMenuId) , macMenuItemNum , &id ) ; - MacHandleMenuCommand( id ) ; - } - HiliteMenu(0); -} -#endif diff --git a/src/mac/classic/apprsrc.h b/src/mac/classic/apprsrc.h deleted file mode 100644 index c887ac2d5b..0000000000 --- a/src/mac/classic/apprsrc.h +++ /dev/null @@ -1,6 +0,0 @@ -#define kMacSTRWrongMachine 1 -#define kMacSTRSmallSize 2 -#define kMacSTRNoMemory 3 -#define kMacSTROldSystem 4 -#define kMacSTRGenericAbout 5 -#define kMacSTRNoPre8Yet 6 diff --git a/src/mac/classic/apprsrc.r b/src/mac/classic/apprsrc.r deleted file mode 100644 index 020b34f73a..0000000000 --- a/src/mac/classic/apprsrc.r +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef __UNIX__ -# include -#else -# include -#endif -#include "apprsrc.h" - -resource 'STR#' ( 128 , "Simple Alert Messages" ) -{ - { - "This application needs at least a MacPlus" , - "This application needs more memory" , - "This application is out of memory" , - "This application needs at least System 8.6" , - "About this wxWindows Application" , - "This application needs Appearance extension (built in with System 8) - this restriction will be relieved in the final release" - } -} ; - -resource 'MENU' (1, preload) -{ - 1, textMenuProc, 0b11111111111111111111111111111110 , enabled, apple , - { - "AboutÉ" , noicon, nokey,nomark,plain , - "-" , noicon, nokey,nomark,plain - } -} ; - -resource 'MBAR' (1,preload) -{ - { 1 } ; -} ; diff --git a/src/mac/classic/bitmap.cpp b/src/mac/classic/bitmap.cpp deleted file mode 100644 index 6cbaa9d9b7..0000000000 --- a/src/mac/classic/bitmap.cpp +++ /dev/null @@ -1,1436 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp -// Purpose: wxBitmap -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "bitmap.h" -#endif - -#include "wx/defs.h" - -#include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/log.h" -#include "wx/image.h" -#include "wx/xpmdecod.h" - -#include "wx/rawbmp.h" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject ) - -#ifdef __DARWIN__ - #include -#else - #include -#endif - -#include "wx/mac/uma.h" - -CTabHandle wxMacCreateColorTable( int numColors ) -{ - CTabHandle newColors; /* Handle to the new color table */ - - /* Allocate memory for the color table */ - newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) + - sizeof (ColorSpec) * (numColors - 1) ); - if (newColors != nil) - { - /* Initialize the fields */ - (**newColors).ctSeed = GetCTSeed(); - (**newColors).ctFlags = 0; - (**newColors).ctSize = numColors - 1; - /* Initialize the table of colors */ - } - return newColors ; -} - -void wxMacDestroyColorTable( CTabHandle colors ) -{ - DisposeHandle( (Handle) colors ) ; -} - -void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) -{ - (**newColors).ctTable[index].value = index; - (**newColors).ctTable[index].rgb.red = red ; // someRedValue; - (**newColors).ctTable[index].rgb.green = green ; // someGreenValue; - (**newColors).ctTable[index].rgb.blue = blue ; // someBlueValue; -} - -GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) -{ - OSErr err = noErr ; - GWorldPtr port ; - Rect rect = { 0 , 0 , height , width } ; - - if ( depth < 0 ) - { - depth = wxDisplayDepth() ; - } - - err = NewGWorld( &port , depth , &rect , NULL , NULL , 0 ) ; - if ( err == noErr ) - { - return port ; - } - return NULL ; -} - -void wxMacDestroyGWorld( GWorldPtr gw ) -{ - if ( gw ) - DisposeGWorld( gw ) ; -} - -#define kDefaultRes 0x00480000 /* Default resolution is 72 DPI; Fixed type */ - -OSErr SetupCIconHandlePixMap( CIconHandle icon , short depth , Rect *bounds , CTabHandle colors ) -{ - CTabHandle newColors; /* Color table used for the off-screen PixMap */ - Ptr offBaseAddr; /* Pointer to the off-screen pixel image */ - OSErr error; /* Returns error code */ - short bytesPerRow; /* Number of bytes per row in the PixMap */ - - - error = noErr; - newColors = nil; - offBaseAddr = nil; - - bytesPerRow = ((depth * (bounds->right - bounds->left) + 31) / 32) * 4; - - /* Clone the clut if indexed color; allocate a dummy clut if direct color*/ - if (depth <= 8) - { - newColors = colors; - error = HandToHand((Handle *) &newColors); - } - else - { - newColors = (CTabHandle) NewHandle(sizeof(ColorTable) - - sizeof(CSpecArray)); - error = MemError(); - } - if (error == noErr) - { - /* Allocate pixel image; long integer multiplication avoids overflow */ - (**icon).iconData = NewHandle((unsigned long) bytesPerRow * (bounds->bottom - - bounds->top)); - if ((**icon).iconData != nil) - { - /* Initialize fields common to indexed and direct PixMaps */ - (**icon).iconPMap.baseAddr = 0; /* Point to image */ - (**icon).iconPMap.rowBytes = bytesPerRow | /* MSB set for PixMap */ - 0x8000; - (**icon).iconPMap.bounds = *bounds; /* Use given bounds */ - (**icon).iconPMap.pmVersion = 0; /* No special stuff */ - (**icon).iconPMap.packType = 0; /* Default PICT pack */ - (**icon).iconPMap.packSize = 0; /* Always zero in mem */ - (**icon).iconPMap.hRes = kDefaultRes; /* 72 DPI default res */ - (**icon).iconPMap.vRes = kDefaultRes; /* 72 DPI default res */ - (**icon).iconPMap.pixelSize = depth; /* Set # bits/pixel */ - - /* Initialize fields specific to indexed and direct PixMaps */ - if (depth <= 8) - { - /* PixMap is indexed */ - (**icon).iconPMap.pixelType = 0; /* Indicates indexed */ - (**icon).iconPMap.cmpCount = 1; /* Have 1 component */ - (**icon).iconPMap.cmpSize = depth; /* Component size=depth */ - (**icon).iconPMap.pmTable = newColors; /* Handle to CLUT */ - } - else - { - /* PixMap is direct */ - (**icon).iconPMap.pixelType = RGBDirect; /* Indicates direct */ - (**icon).iconPMap.cmpCount = 3; /* Have 3 components */ - if (depth == 16) - (**icon).iconPMap.cmpSize = 5; /* 5 bits/component */ - else - (**icon).iconPMap.cmpSize = 8; /* 8 bits/component */ - (**newColors).ctSeed = 3 * (**icon).iconPMap.cmpSize; - (**newColors).ctFlags = 0; - (**newColors).ctSize = 0; - (**icon).iconPMap.pmTable = newColors; - } - } - else - error = MemError(); - } - else - newColors = nil; - - /* If no errors occured, return a handle to the new off-screen PixMap */ - if (error != noErr) - { - if (newColors != nil) - DisposeCTable(newColors); - } - - /* Return the error code */ - return error; -} - -CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) -{ - GWorldPtr saveWorld; - GDHandle saveHandle; - - GetGWorld(&saveWorld,&saveHandle); // save Graphics env state - SetGWorld(image,nil); - - Rect frame = { 0 , 0 , iconSize , iconSize } ; - Rect imageBounds = frame ; - GetPortBounds( image , &imageBounds ) ; - - int bwSize = iconSize / 8 * iconSize ; - CIconHandle icon = (CIconHandle) NewHandleClear( sizeof ( CIcon ) + 2 * bwSize) ; - HLock((Handle)icon) ; - SetupCIconHandlePixMap( icon , dstDepth , &frame,GetCTable(dstDepth)) ; - HLock( (**icon).iconData ) ; - (**icon).iconPMap.baseAddr = *(**icon).iconData ; - - LockPixels(GetGWorldPixMap(image)); - - CopyBits(GetPortBitMapForCopyBits(image), - (BitMapPtr)&((**icon).iconPMap), - &imageBounds, - &imageBounds, - srcCopy | ditherCopy, nil); - - - UnlockPixels(GetGWorldPixMap(image)); - HUnlock( (**icon).iconData ) ; - - (**icon).iconMask.rowBytes = iconSize / 8 ; - (**icon).iconMask.bounds = frame ; - - (**icon).iconBMap.rowBytes = iconSize / 8 ; - (**icon).iconBMap.bounds = frame ; - (**icon).iconMask.baseAddr = (char*) &(**icon).iconMaskData ; - (**icon).iconBMap.baseAddr = (char*) &(**icon).iconMaskData + bwSize ; - - if ( mask ) - { - Rect r ; - GetPortBounds( image , &r ) ; - LockPixels(GetGWorldPixMap(mask) ) ; - CopyBits(GetPortBitMapForCopyBits(mask) , - &(**icon).iconBMap , &r , &r, srcCopy , nil ) ; - CopyBits(GetPortBitMapForCopyBits(mask) , - &(**icon).iconMask , &r , &r, srcCopy , nil ) ; - UnlockPixels(GetGWorldPixMap( mask ) ) ; - } - else - { - Rect r ; - GetPortBounds( image , &r ) ; - LockPixels(GetGWorldPixMap(image)); - CopyBits(GetPortBitMapForCopyBits(image) , - &(**icon).iconBMap , &r , &r, srcCopy , nil ) ; - CopyBits(GetPortBitMapForCopyBits(image) , - &(**icon).iconMask , &r , &r, srcCopy , nil ) ; - UnlockPixels(GetGWorldPixMap(image)); - } - - (**icon).iconMask.baseAddr = NULL ; - (**icon).iconBMap.baseAddr = NULL ; - (**icon).iconPMap.baseAddr = NULL ; - HUnlock((Handle)icon) ; - SetGWorld(saveWorld,saveHandle); - - return icon; -} - -PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask) -{ - CGrafPtr origPort ; - GDHandle origDev ; - - PicHandle pict; - - RGBColor white = { 0xffff ,0xffff , 0xffff } ; - RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ; - - GetGWorld( &origPort , &origDev ) ; - - RgnHandle clipRgn = NULL ; - - if ( mask ) - { - clipRgn = NewRgn() ; - LockPixels( GetGWorldPixMap( mask ) ) ; - BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( mask ) ) ; - UnlockPixels( GetGWorldPixMap( mask ) ) ; - } - - SetGWorld( wp , NULL ) ; - Rect portRect ; - if ( clipRgn ) - GetRegionBounds( clipRgn , &portRect ) ; - else - GetPortBounds( wp , &portRect ) ; - pict = OpenPicture(&portRect); - if(pict) - { - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - - if ( clipRgn ) - SetClip( clipRgn ) ; - - LockPixels( GetGWorldPixMap( wp ) ) ; - CopyBits(GetPortBitMapForCopyBits(wp), - GetPortBitMapForCopyBits(wp), - &portRect, - &portRect, - srcCopy,clipRgn); - UnlockPixels( GetGWorldPixMap( wp ) ) ; - ClosePicture(); - } - SetGWorld( origPort , origDev ) ; - if ( clipRgn ) - DisposeRgn( clipRgn ) ; - return pict; -} - -void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType ) -{ - memset( info , 0 , sizeof(ControlButtonContentInfo) ) ; - if ( bitmap.Ok() ) - { - wxBitmapRefData * bmap = (wxBitmapRefData*) ( bitmap.GetRefData()) ; - if ( bmap == NULL ) - return ; - - if ( bmap->m_bitmapType == kMacBitmapTypePict ) - { - info->contentType = kControlContentPictHandle ; - info->u.picture = MAC_WXHMETAFILE(bmap->m_hPict) ; - } - else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld ) - { - if ( (forceType == kControlContentCIconHandle || ( bmap->m_width == bmap->m_height && forceType != kControlContentPictHandle ) ) && ((bmap->m_width & 0x3) == 0) ) - { - info->contentType = kControlContentCIconHandle ; - if ( bitmap.GetMask() ) - { - info->u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , MAC_WXHBITMAP(bitmap.GetMask()->GetMaskBitmap()) , - 8 , bmap->m_width ) ; - } - else - { - info->u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , NULL , - 8 , bmap->m_width ) ; - } - } - else - { - info->contentType = kControlContentPictHandle ; - if ( bitmap.GetMask() ) - { - info->u.picture = wxMacCreatePict( MAC_WXHBITMAP(bmap->m_hBitmap) , MAC_WXHBITMAP(bitmap.GetMask()->GetMaskBitmap() ) ) ; - } - else - { - info->u.picture = wxMacCreatePict( MAC_WXHBITMAP(bmap->m_hBitmap) , NULL ) ; - } - } - } - else if ( bmap->m_bitmapType == kMacBitmapTypeIcon ) - { - info->contentType = kControlContentCIconHandle ; - info->u.cIconHandle = MAC_WXHICON(bmap->m_hIcon) ; - } - } -} - -wxBitmapRefData::wxBitmapRefData() - : m_width(0) - , m_height(0) - , m_depth(0) - , m_ok(FALSE) - , m_numColors(0) - , m_quality(0) -{ - m_bitmapMask = NULL; - m_hBitmap = NULL ; - m_hPict = NULL ; - m_hIcon = NULL ; - m_bitmapType = kMacBitmapTypeUnknownType ; - m_hasAlpha = false; -} - -// TODO move this to a public function of Bitmap Ref -static void DisposeBitmapRefData(wxBitmapRefData *data) -{ - if ( !data ) - return ; - - switch (data->m_bitmapType) - { - case kMacBitmapTypePict : - { - if ( data->m_hPict ) - { - KillPicture( MAC_WXHMETAFILE( data->m_hPict ) ) ; - data->m_hPict = NULL ; - } - } - break ; - case kMacBitmapTypeGrafWorld : - { - if ( data->m_hBitmap ) - { - wxMacDestroyGWorld( MAC_WXHBITMAP(data->m_hBitmap) ) ; - data->m_hBitmap = NULL ; - } - } - break ; - case kMacBitmapTypeIcon : - if ( data->m_hIcon ) - { - DisposeCIcon( MAC_WXHICON(data->m_hIcon) ) ; - data->m_hIcon = NULL ; - } - - default : - // unkown type ? - break ; - } - - if (data->m_bitmapMask) - { - delete data->m_bitmapMask; - data->m_bitmapMask = NULL; - } -} - -wxBitmapRefData::~wxBitmapRefData() -{ - DisposeBitmapRefData( this ) ; -} - -bool wxBitmap::CopyFromIcon(const wxIcon& icon) -{ - Ref(icon) ; - return true; -} - -wxBitmap::wxBitmap() -{ - m_refData = NULL; -} - -wxBitmap::~wxBitmap() -{ -} - -wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits) -{ - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = the_width ; - M_BITMAPDATA->m_height = the_height ; - M_BITMAPDATA->m_depth = no_bits ; - M_BITMAPDATA->m_numColors = 0; - if ( no_bits == 1 ) - { - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ; - M_BITMAPDATA->m_ok = (MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) != NULL ) ; - - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , NULL ) ; - LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) ) ) ; - - // bits is a char array - - unsigned char* linestart = (unsigned char*) bits ; - int linesize = ( the_width / (sizeof(unsigned char) * 8)) ; - if ( the_width % (sizeof(unsigned char) * 8) ) { - linesize += sizeof(unsigned char); - } - - RGBColor colors[2] = { - { 0xFFFF , 0xFFFF , 0xFFFF } , - { 0, 0 , 0 } - } ; - - for ( int y = 0 ; y < the_height ; ++y , linestart += linesize ) - { - for ( int x = 0 ; x < the_width ; ++x ) - { - int index = x / 8 ; - int bit = x % 8 ; - int mask = 1 << bit ; - if ( linestart[index] & mask ) - { - SetCPixel( x , y , &colors[1] ) ; - } - else - { - SetCPixel( x , y , &colors[0] ) ; - } - } - } - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) ) ) ; - - SetGWorld( origPort , origDevice ) ; - } - else - { - wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented")); - } -} - -wxBitmap::wxBitmap(int w, int h, int d) -{ - (void)Create(w, h, d); -} - -wxBitmap::wxBitmap(void *data, wxBitmapType type, int width, int height, int depth) -{ - (void) Create(data, type, width, height, depth); -} - -wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) -{ - LoadFile(filename, type); -} - -bool wxBitmap::CreateFromXpm(const char **bits) -{ - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) - wxXPMDecoder decoder; - wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ) - *this = wxBitmap(img); - return TRUE; -} - -wxBitmap::wxBitmap(const char **bits) -{ - (void) CreateFromXpm(bits); -} - -wxBitmap::wxBitmap(char **bits) -{ - (void) CreateFromXpm((const char **)bits); -} - -wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const -{ - wxCHECK_MSG( Ok() && - (rect.x >= 0) && (rect.y >= 0) && - (rect.x+rect.width <= GetWidth()) && - (rect.y+rect.height <= GetHeight()), - wxNullBitmap, wxT("invalid bitmap or bitmap region") ); - - - wxBitmap ret( rect.width, rect.height, GetDepth() ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); - - GWorldPtr origPort; - GDHandle origDevice; - - GetGWorld( &origPort, &origDevice ); - - // Update the subbitmaps reference data - wxBitmapRefData *ref = (wxBitmapRefData *)ret.GetRefData(); - - ref->m_numColors = M_BITMAPDATA->m_numColors; -#if wxUSE_PALETTE - ref->m_bitmapPalette = M_BITMAPDATA->m_bitmapPalette; -#endif // wxUSE_PALETTE - ref->m_bitmapType = M_BITMAPDATA->m_bitmapType; - - // Copy sub region of this bitmap - if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypePict) - { - printf("GetSubBitmap: Copy a region of a Pict structure - TODO\n"); - } - else if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypeGrafWorld) - { - // Copy mask - if(GetMask()) - { - GWorldPtr submask, mask; - RGBColor color; - - mask = (GWorldPtr) GetMask()->GetMaskBitmap(); - submask = wxMacCreateGWorld(rect.width, rect.height, GetMask()->GetDepth() ); - LockPixels(GetGWorldPixMap(mask)); - LockPixels(GetGWorldPixMap(submask)); - - for(int yy = 0; yy < rect.height; yy++) - { - for(int xx = 0; xx < rect.width; xx++) - { - SetGWorld(mask, NULL); - GetCPixel(rect.x + xx, rect.y + yy, &color); - SetGWorld(submask, NULL); - SetCPixel(xx,yy, &color); - } - } - UnlockPixels(GetGWorldPixMap(mask)); - UnlockPixels(GetGWorldPixMap(submask)); - ref->m_bitmapMask = new wxMask; - ref->m_bitmapMask->SetMaskBitmap(submask); - } - - // Copy bitmap - if(GetHBITMAP()) - { - GWorldPtr subbitmap, bitmap; - RGBColor color; - - bitmap = (GWorldPtr) GetHBITMAP(); - subbitmap = (GWorldPtr) ref->m_hBitmap ; - LockPixels(GetGWorldPixMap(bitmap)); - LockPixels(GetGWorldPixMap(subbitmap)); - - for(int yy = 0; yy < rect.height; yy++) - { - for(int xx = 0; xx < rect.width; xx++) - { - SetGWorld(bitmap, NULL); - GetCPixel(rect.x + xx, rect.y + yy, &color); - SetGWorld(subbitmap, NULL); - SetCPixel(xx, yy, &color); - } - } - UnlockPixels(GetGWorldPixMap(bitmap)); - UnlockPixels(GetGWorldPixMap(subbitmap)); - } - } - SetGWorld( origPort, origDevice ); - - return ret; -} - -bool wxBitmap::Create(int w, int h, int d) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = w; - M_BITMAPDATA->m_height = h; - M_BITMAPDATA->m_depth = d; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( w , h , d ) ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hBitmap != NULL ) ; - return M_BITMAPDATA->m_ok; -} - -int wxBitmap::GetBitmapType() const -{ - wxCHECK_MSG( Ok(), kMacBitmapTypeUnknownType, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_bitmapType; -} - -void wxBitmap::SetHBITMAP(WXHBITMAP bmp) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ; - M_BITMAPDATA->m_hBitmap = bmp ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hBitmap != NULL ) ; -} - -void wxBitmap::SetHICON(WXHICON ico) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypeIcon ; - M_BITMAPDATA->m_hIcon = ico ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hIcon != NULL ) ; -} - -void wxBitmap::SetPict(WXHMETAFILE pict) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - else - DisposeBitmapRefData( M_BITMAPDATA ) ; - - M_BITMAPDATA->m_bitmapType = kMacBitmapTypePict ; - M_BITMAPDATA->m_hPict = pict ; - M_BITMAPDATA->m_ok = ( M_BITMAPDATA->m_hPict != NULL ) ; -} - -bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) -{ - UnRef(); - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - { - m_refData = new wxBitmapRefData; - - return handler->LoadFile(this, filename, type, -1, -1); - } - else - { - wxImage loadimage(filename, type); - if (loadimage.Ok()) { - *this = loadimage; - return true; - } - } - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - return false; -} - -bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler == NULL ) { - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - - return FALSE; - } - - return handler->Create(this, data, type, width, height, depth); -} - -wxBitmap::wxBitmap(const wxImage& image, int depth) -{ - wxCHECK_RET( image.Ok(), wxT("invalid image") ) - wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ) - - m_refData = new wxBitmapRefData(); - - // width and height of the device-dependent bitmap - int width = image.GetWidth(); - int height = image.GetHeight(); - - // Create picture - - Create( width , height , 32 ) ; - - CGrafPtr origPort ; - GDHandle origDevice ; - - PixMapHandle pixMap = GetGWorldPixMap((GWorldPtr)GetHBITMAP()) ; - LockPixels( pixMap ); - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( (GWorldPtr) GetHBITMAP() , NULL ) ; - - // Render image - register unsigned char* data = image.GetData(); - char* destinationBase = GetPixBaseAddr( pixMap ); - register unsigned char* destination = (unsigned char*) destinationBase ; - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - *destination++ = 0 ; - *destination++ = *data++ ; - *destination++ = *data++ ; - *destination++ = *data++ ; - } - destinationBase += ((**pixMap).rowBytes & 0x7fff); - destination = (unsigned char*) destinationBase ; - } - if ( image.HasAlpha() ) - { - unsigned char *alpha = image.GetAlpha(); - - wxColour maskcolor(image.GetMaskRed(), image.GetMaskGreen(), image.GetMaskBlue()); - RGBColor color ; - wxBitmap maskBitmap ; - - maskBitmap.Create( width, height, 24); - LockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - SetGWorld( (GWorldPtr) maskBitmap.GetHBITMAP(), NULL); - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - memset( &color , 255 - *alpha , sizeof( color ) ); - SetCPixel(x,y, &color); - - alpha += 1 ; - } - } // for height - SetGWorld( (GWorldPtr) GetHBITMAP(), NULL); - SetMask(new wxMask( maskBitmap )); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - } - else if ( image.HasMask() ) - { - data = image.GetData(); - - wxColour maskcolor(image.GetMaskRed(), image.GetMaskGreen(), image.GetMaskBlue()); - RGBColor white = { 0xffff, 0xffff, 0xffff }; - RGBColor black = { 0 , 0 , 0 }; - wxBitmap maskBitmap ; - - maskBitmap.Create( width, height, 1); - LockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - SetGWorld( (GWorldPtr) maskBitmap.GetHBITMAP(), NULL); - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - if ( data[0] == image.GetMaskRed() && data[1] == image.GetMaskGreen() && data[2] == image.GetMaskBlue() ) - { - SetCPixel(x,y, &white); - } - else { - SetCPixel(x,y, &black); - } - data += 3 ; - } - } // for height - SetGWorld( (GWorldPtr) GetHBITMAP(), NULL); - SetMask(new wxMask( maskBitmap )); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) maskBitmap.GetHBITMAP()) ); - } - - UnlockPixels( GetGWorldPixMap( (GWorldPtr) GetHBITMAP()) ); - SetGWorld( origPort, origDevice ); -} - -wxImage wxBitmap::ConvertToImage() const -{ - wxImage image; - - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); - - // create an wxImage object - int width = GetWidth(); - int height = GetHeight(); - image.Create( width, height ); - - unsigned char *data = image.GetData(); - - wxCHECK_MSG( data, wxNullImage, wxT("Could not allocate data for image") ); - - GWorldPtr origPort; - GDHandle origDevice; - RgnHandle maskRgn = NULL ; - GWorldPtr tempPort = NULL ; - int index; - RGBColor color; - // background color set to RGB(16,16,16) in consistent with wxGTK - unsigned char mask_r=16, mask_g=16, mask_b=16; - SInt16 r,g,b; - wxMask *mask = GetMask(); - - GetGWorld( &origPort, &origDevice ); - if ( GetBitmapType() != kMacBitmapTypeGrafWorld ) - { - tempPort = wxMacCreateGWorld( width , height , -1) ; - } - else - { - tempPort = (GWorldPtr) GetHBITMAP() ; - } - LockPixels(GetGWorldPixMap(tempPort)); - SetGWorld( tempPort, NULL); - if ( GetBitmapType() == kMacBitmapTypePict || GetBitmapType() == kMacBitmapTypeIcon ) - { - Rect bitmaprect = { 0 , 0 , height, width }; - if ( GetBitmapType() == kMacBitmapTypeIcon ) - { - ::PlotCIconHandle( &bitmaprect , atNone , ttNone , MAC_WXHICON(GetHICON()) ) ; - maskRgn = NewRgn() ; - BitMapToRegion( maskRgn , &(**(MAC_WXHICON(GetHICON()))).iconMask ) ; - } - else - ::DrawPicture( (PicHandle) GetPict(), &bitmaprect ) ; - } - // Copy data into image - index = 0; - for (int yy = 0; yy < height; yy++) - { - for (int xx = 0; xx < width; xx++) - { - GetCPixel(xx,yy, &color); - r = ((color.red ) >> 8); - g = ((color.green ) >> 8); - b = ((color.blue ) >> 8); - data[index ] = r; - data[index + 1] = g; - data[index + 2] = b; - if ( maskRgn ) - { - Point pt ; - pt.h = xx ; - pt.v = yy ; - if ( !PtInRgn( pt , maskRgn ) ) - { - data[index ] = mask_r; - data[index + 1] = mask_g; - data[index + 2] = mask_b; - } - } - else - { - if (mask) - { - if (mask->PointMasked(xx,yy)) - { - data[index ] = mask_r; - data[index + 1] = mask_g; - data[index + 2] = mask_b; - } - } - } - index += 3; - } - } - if (mask || maskRgn ) - { - image.SetMaskColour( mask_r, mask_g, mask_b ); - image.SetMask( true ); - } - - // Free resources - UnlockPixels(GetGWorldPixMap( tempPort )); - SetGWorld(origPort, origDevice); - if ( GetBitmapType() != kMacBitmapTypeGrafWorld ) - { - wxMacDestroyGWorld( tempPort ) ; - } - if ( maskRgn ) - { - DisposeRgn( maskRgn ) ; - } - - return image; -} - - -bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, - const wxPalette *palette) const -{ - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - { - return handler->SaveFile(this, filename, type, palette); - } - else - { - wxImage image = ConvertToImage(); - - return image.SaveFile(filename, type); - } - - wxLogWarning(wxT("no bitmap handler for type %d defined."), type); - return false; -} - -bool wxBitmap::Ok() const -{ - return (M_BITMAPDATA && M_BITMAPDATA->m_ok); -} - -int wxBitmap::GetHeight() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_height; -} - -int wxBitmap::GetWidth() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_width; -} - -int wxBitmap::GetDepth() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_depth; -} - -int wxBitmap::GetQuality() const -{ - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_quality; -} - -wxMask *wxBitmap::GetMask() const -{ - wxCHECK_MSG( Ok(), (wxMask *) NULL, wxT("invalid bitmap") ); - - return M_BITMAPDATA->m_bitmapMask; -} - -void wxBitmap::SetWidth(int w) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_width = w; -} - -void wxBitmap::SetHeight(int h) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_height = h; -} - -void wxBitmap::SetDepth(int d) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_depth = d; -} - -void wxBitmap::SetQuality(int q) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_quality = q; -} - -void wxBitmap::SetOk(bool isOk) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_ok = isOk; -} - -#if wxUSE_PALETTE -wxPalette *wxBitmap::GetPalette() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("Invalid bitmap GetPalette()") ); - - return &M_BITMAPDATA->m_bitmapPalette; -} - -void wxBitmap::SetPalette(const wxPalette& palette) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - M_BITMAPDATA->m_bitmapPalette = palette ; -} -#endif // wxUSE_PALETTE - -void wxBitmap::SetMask(wxMask *mask) -{ - if (!M_BITMAPDATA) - m_refData = new wxBitmapRefData; - - // Remove existing mask if there is one. - delete M_BITMAPDATA->m_bitmapMask; - - M_BITMAPDATA->m_bitmapMask = mask ; -} - -WXHBITMAP wxBitmap::GetHBITMAP() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); - - return MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); -} - -WXHMETAFILE wxBitmap::GetPict( bool *created ) const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); - - PicHandle picture = NULL ; // This is the returned picture - if ( created ) - (*created) = false ; - // If bitmap already in Pict format return pointer - if(M_BITMAPDATA->m_bitmapType == kMacBitmapTypePict) { - return M_BITMAPDATA->m_hPict; - } - else if(M_BITMAPDATA->m_bitmapType != kMacBitmapTypeGrafWorld) { - // Invalid bitmap - return NULL; - } - else - { - if ( GetMask() ) - { - picture = wxMacCreatePict( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , MAC_WXHBITMAP(GetMask()->GetMaskBitmap() ) ) ; - } - else - { - picture = wxMacCreatePict( MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap) , NULL ) ; - } - if ( created && picture ) - (*created) = true ; - } - return picture ; -} - -/* - * wxMask - */ - -wxMask::wxMask() - : m_maskBitmap(NULL) -{ -} - -// Construct a mask from a bitmap and a colour indicating -// the transparent area -wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour) - : m_maskBitmap(NULL) -{ - Create(bitmap, colour); -} - -// Construct a mask from a bitmap and a palette index indicating -// the transparent area -wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex) - : m_maskBitmap(NULL) -{ - Create(bitmap, paletteIndex); -} - -// Construct a mask from a mono bitmap (copies the bitmap). -wxMask::wxMask(const wxBitmap& bitmap) - : m_maskBitmap(NULL) -{ - Create(bitmap); -} - -wxMask::~wxMask() -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } -} - -// Create a mask from a mono bitmap (copies the bitmap). -bool wxMask::Create(const wxBitmap& bitmap) -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } - wxCHECK_MSG( bitmap.GetBitmapType() == kMacBitmapTypeGrafWorld, false, - wxT("Cannot create mask from this bitmap type (TODO)")); - // other types would require a temporary bitmap. not yet implemented - - wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap")); - - m_depth = bitmap.GetDepth() ; - m_maskBitmap = wxMacCreateGWorld(bitmap.GetWidth(), bitmap.GetHeight(), bitmap.GetDepth() ); - Rect rect = { 0,0, bitmap.GetHeight(), bitmap.GetWidth() }; - - LockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap) ); - LockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP()) ); - CopyBits(GetPortBitMapForCopyBits( (GWorldPtr) bitmap.GetHBITMAP()), - GetPortBitMapForCopyBits( (GWorldPtr) m_maskBitmap), - &rect, &rect, srcCopy, 0); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap) ); - UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP()) ); - - return FALSE; -} - -// Create a mask from a bitmap and a palette index indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) -{ - // TODO - wxCHECK_MSG( 0, false, wxT("wxMask::Create not yet implemented")); - return FALSE; -} - -// Create a mask from a bitmap and a colour indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) -{ - if ( m_maskBitmap ) - { - wxMacDestroyGWorld( (GWorldPtr) m_maskBitmap ) ; - m_maskBitmap = NULL ; - } - wxCHECK_MSG( bitmap.GetBitmapType() == kMacBitmapTypeGrafWorld, false, - wxT("Cannot create mask from this bitmap type (TODO)")); - // other types would require a temporary bitmap. not yet implemented - - wxCHECK_MSG( bitmap.Ok(), false, wxT("Illigal bitmap")); - - m_maskBitmap = wxMacCreateGWorld( bitmap.GetWidth() , bitmap.GetHeight() , 1 ); - m_depth = 1 ; - LockPixels( GetGWorldPixMap( (GWorldPtr) m_maskBitmap ) ); - LockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP() ) ); - RGBColor maskColor = MAC_WXCOLORREF(colour.GetPixel()); - - // this is not very efficient, but I can't think - // of a better way of doing it - CGrafPtr origPort ; - GDHandle origDevice ; - RGBColor col; - RGBColor colors[2] = { - { 0xFFFF, 0xFFFF, 0xFFFF }, - { 0, 0, 0 }}; - - GetGWorld( &origPort , &origDevice ) ; - for (int w = 0; w < bitmap.GetWidth(); w++) - { - for (int h = 0; h < bitmap.GetHeight(); h++) - { - SetGWorld( (GWorldPtr) bitmap.GetHBITMAP(), NULL ) ; - GetCPixel( w , h , &col ) ; - SetGWorld( (GWorldPtr) m_maskBitmap , NULL ) ; - if (col.red == maskColor.red && col.green == maskColor.green && col.blue == maskColor.blue) - { - SetCPixel( w , h , &colors[0] ) ; - } - else - { - SetCPixel( w , h , &colors[1] ) ; - } - } - } - UnlockPixels( GetGWorldPixMap( (CGrafPtr) m_maskBitmap ) ) ; - UnlockPixels( GetGWorldPixMap( (GWorldPtr) bitmap.GetHBITMAP() ) ) ; - SetGWorld( origPort , origDevice ) ; - - return TRUE; -} - -bool wxMask::PointMasked(int x, int y) -{ - GWorldPtr origPort; - GDHandle origDevice; - RGBColor color; - bool masked = true; - - GetGWorld( &origPort, &origDevice); - - //Set port to mask and see if it masked (1) or not ( 0 ) - SetGWorld( (GWorldPtr) m_maskBitmap, NULL); - LockPixels(GetGWorldPixMap( (GWorldPtr) m_maskBitmap)); - GetCPixel(x,y, &color); - masked = !(color.red == 0 && color.green == 0 && color.blue == 0); - UnlockPixels(GetGWorldPixMap( (GWorldPtr) m_maskBitmap)); - - SetGWorld( origPort, origDevice); - - return masked; -} - -/* - * wxBitmapHandler - */ - -wxBitmapHandler::~wxBitmapHandler() -{ -} - -bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth) -{ - return FALSE; -} - -bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - return FALSE; -} - -bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette) -{ - return FALSE; -} - -/* - * Standard handlers - */ - -class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxPICTResourceHandler) -public: - inline wxPICTResourceHandler() - { - m_name = wxT("Macintosh Pict resource"); - m_extension = wxEmptyString; - m_type = wxBITMAP_TYPE_PICT_RESOURCE; - }; - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); -}; -IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) - -bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - Str255 theName ; - wxMacStringToPascal( name , theName ) ; - - PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ; - if ( thePict ) - { - PictInfo theInfo ; - - GetPictInfo( thePict , &theInfo , 0 , 0 , systemMethod , 0 ) ; - DetachResource( (Handle) thePict ) ; - M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypePict ; - M_BITMAPHANDLERDATA->m_hPict = thePict ; - M_BITMAPHANDLERDATA->m_width = theInfo.sourceRect.right - theInfo.sourceRect.left ; - M_BITMAPHANDLERDATA->m_height = theInfo.sourceRect.bottom - theInfo.sourceRect.top ; - - M_BITMAPHANDLERDATA->m_depth = theInfo.depth ; - M_BITMAPHANDLERDATA->m_ok = true ; - M_BITMAPHANDLERDATA->m_numColors = theInfo.uniqueColors ; -// M_BITMAPHANDLERDATA->m_bitmapPalette; -// M_BITMAPHANDLERDATA->m_quality; - return TRUE ; - } - return FALSE ; -} - -void wxBitmap::InitStandardHandlers() -{ - AddHandler(new wxPICTResourceHandler) ; - AddHandler(new wxICONResourceHandler) ; -} - -// ---------------------------------------------------------------------------- -// raw bitmap access support -// ---------------------------------------------------------------------------- - -void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) -{ - if ( !Ok() ) - { - // no bitmap, no data (raw or otherwise) - return NULL; - } - - if ( M_BITMAPDATA->m_bitmapType != kMacBitmapTypeGrafWorld ) - { - wxFAIL_MSG( _T("GetRawData() only supported for GWorlds") ); - - return NULL; - } - - GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); - PixMapHandle hPixMap = GetGWorldPixMap(gworld); - wxCHECK_MSG( hPixMap && *hPixMap, NULL, - _T("GetRawData(): failed to get PixMap from GWorld?") ); - - wxCHECK_MSG( (*hPixMap)->pixelSize == bpp, NULL, - _T("GetRawData(): pixel format mismatch") ); - - if ( !LockPixels(hPixMap) ) - { - wxFAIL_MSG( _T("failed to lock PixMap in GetRawData()") ); - - return NULL; - } - - data.m_width = GetWidth(); - data.m_height = GetHeight(); - data.m_stride = (*hPixMap)->rowBytes & 0x7fff; - - M_BITMAPDATA->m_hasAlpha = false; - - return GetPixBaseAddr(hPixMap); -} - -void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) -{ - if ( !Ok() ) - return; - - if ( M_BITMAPDATA->m_hasAlpha ) - { - wxAlphaPixelData& data = (wxAlphaPixelData&)dataBase; - - int w = data.GetWidth(), - h = data.GetHeight(); - - wxBitmap bmpMask(GetWidth(), GetHeight(), 32); - wxAlphaPixelData dataMask(bmpMask, data.GetOrigin(), wxSize(w, h)); - wxAlphaPixelData::Iterator pMask(dataMask), - p(data); - for ( int y = 0; y < h; y++ ) - { - wxAlphaPixelData::Iterator rowStartMask = pMask, - rowStart = p; - - for ( int x = 0; x < w; x++ ) - { - const wxAlphaPixelData::Iterator::ChannelType - alpha = p.Alpha(); - - pMask.Red() = alpha; - pMask.Green() = alpha; - pMask.Blue() = alpha; - - ++p; - ++pMask; - } - - p = rowStart; - p.OffsetY(data, 1); - - pMask = rowStartMask; - pMask.OffsetY(dataMask, 1); - } - - SetMask(new wxMask(bmpMask)); - } - - GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap); - PixMapHandle hPixMap = GetGWorldPixMap(gworld); - if ( hPixMap ) - { - UnlockPixels(hPixMap); - } -} - -void wxBitmap::UseAlpha() -{ - // remember that we are using alpha channel, we'll need to create a proper - // mask in UngetRawData() - M_BITMAPDATA->m_hasAlpha = true; -} - diff --git a/src/mac/classic/bmpbuttn.cpp b/src/mac/classic/bmpbuttn.cpp deleted file mode 100644 index f6ce4dd00c..0000000000 --- a/src/mac/classic/bmpbuttn.cpp +++ /dev/null @@ -1,113 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.cpp -// Purpose: wxBitmapButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "bmpbuttn.h" -#endif - -#include "wx/window.h" -#include "wx/bmpbuttn.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) -#endif - -#include "wx/mac/uma.h" -#include "wx/bitmap.h" - -bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - // since bitmapbuttonbase is subclass of button calling wxBitmapButtonBase::Create - // essentially creates an additional button - if ( !wxControl::Create(parent, id, pos, size, - style, validator, name) ) - return false; - - m_bmpNormal = bitmap; - - if (style & wxBU_AUTODRAW) - { - m_marginX = wxDEFAULT_BUTTON_MARGIN; - m_marginY = wxDEFAULT_BUTTON_MARGIN; - } - else - { - m_marginX = 0; - m_marginY = 0; - } - - int width = size.x; - int height = size.y; - - if ( bitmap.Ok() ) - { - wxSize newSize = DoGetBestSize(); - if ( width == -1 ) - width = newSize.x; - if ( height == -1 ) - height = newSize.y; - } - - Rect bounds ; - Str255 title ; - m_bmpNormal = bitmap; - wxBitmapRefData * bmap = NULL ; - - if ( m_bmpNormal.Ok() ) - bmap = (wxBitmapRefData*) ( m_bmpNormal.GetRefData()) ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , - kControlBehaviorOffsetContents + - ( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ? - kControlContentCIconHandle : kControlContentPictHandle ) , 0, - (( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bmpNormal ) ; - if ( info.contentType != kControlNoContent ) - { - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } - MacPostControlCreate() ; - - return TRUE; -} - -void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap) -{ - m_bmpNormal = bitmap; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bmpNormal ) ; - if ( info.contentType != kControlNoContent ) - { - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } -} - - -wxSize wxBitmapButton::DoGetBestSize() const -{ - wxSize best; - if (m_bmpNormal.Ok()) - { - best.x = m_bmpNormal.GetWidth() + 2*m_marginX; - best.y = m_bmpNormal.GetHeight() + 2*m_marginY; - } - return best; -} diff --git a/src/mac/classic/brush.cpp b/src/mac/classic/brush.cpp deleted file mode 100644 index d484314a2c..0000000000 --- a/src/mac/classic/brush.cpp +++ /dev/null @@ -1,229 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp -// Purpose: wxBrush -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "brush.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/brush.h" - -#include "wx/mac/private.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) -#endif - -class WXDLLEXPORT wxBrushRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxBrush; -public: - wxBrushRefData(); - wxBrushRefData(const wxBrushRefData& data); - ~wxBrushRefData(); - -protected: - wxMacBrushKind m_macBrushKind ; - int m_style; - wxBitmap m_stipple ; - wxColour m_colour; - - ThemeBrush m_macThemeBrush ; - - ThemeBackgroundKind m_macThemeBackground ; - Rect m_macThemeBackgroundExtent ; -}; - -#define M_BRUSHDATA ((wxBrushRefData *)m_refData) - -wxBrushRefData::wxBrushRefData() - : m_style(wxSOLID) -{ - m_macBrushKind = kwxMacBrushColour ; -} - -wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) - : wxGDIRefData() - , m_style(data.m_style) -{ - m_stipple = data.m_stipple; - m_colour = data.m_colour; - m_macBrushKind = data.m_macBrushKind ; - m_macThemeBrush = data.m_macThemeBrush ; - m_macThemeBackground = data.m_macThemeBackground ; - m_macThemeBackgroundExtent = data.m_macThemeBackgroundExtent ; -} - -wxBrushRefData::~wxBrushRefData() -{ -} - -// Brushes -wxBrush::wxBrush() -{ -} - -wxBrush::~wxBrush() -{ -} - -wxBrush::wxBrush(const wxColour& col, int Style) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_colour = col; - M_BRUSHDATA->m_style = Style; - - RealizeResource(); -} - -wxBrush::wxBrush(const wxBitmap& stipple) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_colour = *wxBLACK; - M_BRUSHDATA->m_stipple = stipple; - - if (M_BRUSHDATA->m_stipple.GetMask()) - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; - else - M_BRUSHDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -wxBrush::wxBrush(ThemeBrush macThemeBrush ) -{ - m_refData = new wxBrushRefData; - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme; - M_BRUSHDATA->m_macThemeBrush = macThemeBrush; - - RealizeResource(); -} -void wxBrush::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxBrushRefData(); - } - else - { - wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxBrush::SetColour(const wxColour& col) -{ - Unshare(); - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_colour = col; - - RealizeResource(); -} - -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxBrush::SetStyle(int Style) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_style = Style; - - RealizeResource(); -} - -void wxBrush::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushColour; - M_BRUSHDATA->m_stipple = Stipple; - - RealizeResource(); -} - -void wxBrush::SetMacTheme(ThemeBrush macThemeBrush) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme; - M_BRUSHDATA->m_macThemeBrush = macThemeBrush; - - RealizeResource(); -} - -void wxBrush::SetMacThemeBackground(unsigned long macThemeBackground, const WXRECTPTR extent) -{ - Unshare(); - - M_BRUSHDATA->m_macBrushKind = kwxMacBrushThemeBackground; - M_BRUSHDATA->m_macThemeBackground = macThemeBackground; - M_BRUSHDATA->m_macThemeBackgroundExtent = *(Rect*)extent ; - RealizeResource(); -} - -bool wxBrush::RealizeResource() -{ - return TRUE; -} - -unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const -{ - if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) - { - if ( extent ) - *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; - return M_BRUSHDATA->m_macThemeBackground ; - } - else - { - return 0 ; - } -} - -short wxBrush::GetMacTheme() const -{ - return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); -} - -wxColour& wxBrush::GetColour() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); -} - -int wxBrush::GetStyle() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); -} - -wxBitmap *wxBrush::GetStipple() const -{ - return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); -} - -wxMacBrushKind wxBrush::MacGetBrushKind() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); -} \ No newline at end of file diff --git a/src/mac/classic/button.cpp b/src/mac/classic/button.cpp deleted file mode 100644 index 82e4e34c5f..0000000000 --- a/src/mac/classic/button.cpp +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp -// Purpose: wxButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "button.h" -#endif - -#include "wx/defs.h" - -#include "wx/button.h" -#include "wx/panel.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) -#endif - -#include "wx/mac/uma.h" -// Button - -static const int kMacOSXHorizontalBorder = 2 ; -static const int kMacOSXVerticalBorder = 4 ; - -bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - if ( UMAHasAquaLayout() ) - { - m_macHorizontalBorder = kMacOSXHorizontalBorder; - m_macVerticalBorder = kMacOSXVerticalBorder; - } - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlPushButtonProc , (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxButton::SetDefault() -{ - wxWindow *parent = GetParent(); - wxButton *btnOldDefault = NULL; - if ( parent ) - { - btnOldDefault = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - parent->SetDefaultItem(this); - } - - Boolean inData; - if ( btnOldDefault && btnOldDefault->m_macControl ) - { - inData = 0; - ::SetControlData( (ControlHandle) btnOldDefault->m_macControl , kControlButtonPart , - kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ; - } - if ( (ControlHandle) m_macControl ) - { - inData = 1; - ::SetControlData( (ControlHandle) m_macControl , kControlButtonPart , - kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ; - } -} - -wxSize wxButton::DoGetBestSize() const -{ - wxSize sz = GetDefaultSize() ; - - int wBtn = m_label.Length() * 8 + 12 + 2 * kMacOSXHorizontalBorder ; - - if (wBtn > sz.x) sz.x = wBtn; - - return sz ; -} - -wxSize wxButton::GetDefaultSize() -{ - int wBtn = 70 ; - int hBtn = 20 ; - - if ( UMAHasAquaLayout() ) - { - wBtn += 2 * kMacOSXHorizontalBorder ; - hBtn += 2 * kMacOSXVerticalBorder ; - } - - return wxSize(wBtn, hBtn); -} - -void wxButton::Command (wxCommandEvent & event) -{ - if ( (ControlHandle) m_macControl ) - { - HiliteControl( (ControlHandle) m_macControl , kControlButtonPart ) ; - unsigned long finalTicks ; - Delay( 8 , &finalTicks ) ; - HiliteControl( (ControlHandle) m_macControl , 0 ) ; - } - ProcessCommand (event); -} - -void wxButton::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 controlpart , bool WXUNUSED(mouseStillDown) ) -{ - if ( controlpart != kControlNoPart ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId ); - event.SetEventObject(this); - ProcessCommand(event); - } -} - diff --git a/src/mac/classic/carbrsrc.r b/src/mac/classic/carbrsrc.r deleted file mode 100644 index 9326cc3b56..0000000000 --- a/src/mac/classic/carbrsrc.r +++ /dev/null @@ -1,7 +0,0 @@ -// carbon for 9 -data 'carb' (0) { - $"0000" /* .. */ -}; - -// the plist resource should only be included in the application -// since it contains the bundle information and should not be duplicated diff --git a/src/mac/classic/checkbox.cpp b/src/mac/classic/checkbox.cpp deleted file mode 100644 index 6e6aa299b2..0000000000 --- a/src/mac/classic/checkbox.cpp +++ /dev/null @@ -1,179 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.cpp -// Purpose: wxCheckBox -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "checkbox.h" -#endif - -#include "wx/defs.h" - -#include "wx/checkbox.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) -#endif - -#include "wx/mac/uma.h" - -// Single check box item -bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - SInt16 maxValue = 1 /* kControlCheckboxCheckedValue */; - if (style & wxCHK_3STATE) - { - maxValue = 2 /* kControlCheckboxMixedValue */; - } - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue, - kControlCheckBoxProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxCheckBox::SetValue(bool val) -{ - if (val) - { - Set3StateValue(wxCHK_CHECKED); - } - else - { - Set3StateValue(wxCHK_UNCHECKED); - } -} - -bool wxCheckBox::GetValue() const -{ - return (DoGet3StateValue() != 0); -} - -void wxCheckBox::Command (wxCommandEvent & event) -{ - int state = event.GetInt(); - - wxCHECK_RET( (state == wxCHK_UNCHECKED) || (state == wxCHK_CHECKED) - || (state == wxCHK_UNDETERMINED), - wxT("event.GetInt() returned an invalid checkbox state") ); - - Set3StateValue((wxCheckBoxState) state); - - ProcessCommand(event); -} - -wxCheckBoxState wxCheckBox::DoGet3StateValue() const -{ - return (wxCheckBoxState) ::GetControl32BitValue( (ControlHandle) m_macControl ); -} - -void wxCheckBox::DoSet3StateValue(wxCheckBoxState val) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , (int) val) ; - MacRedrawControl() ; -} - -void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) , bool WXUNUSED(mouseStillDown) ) -{ - wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); - wxCheckBoxState state = Get3StateValue(); - - if (state == wxCHK_UNCHECKED) - { - state = wxCHK_CHECKED; - } - else if (state == wxCHK_CHECKED) - { - // If the style flag to allow the user setting the undetermined state - // is set, then set the state to undetermined. Otherwise set state to - // unchecked. - if ( Is3rdStateAllowedForUser() ) - { - state = wxCHK_UNDETERMINED; - } - else - { - state = wxCHK_UNCHECKED; - } - } - else if (state == wxCHK_UNDETERMINED) - { - state = wxCHK_UNCHECKED; - } - Set3StateValue(state); - - event.SetInt(state); - event.SetEventObject(this); - ProcessCommand(event); -} - -// Bitmap checkbox -bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = NewControlId(); - else - m_windowId = id; - - // TODO: Create the bitmap checkbox - - return FALSE; -} - -void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap) -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::SetLabel() not yet implemented")); -} - -void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - wxControl::SetSize( x , y , width , height , sizeFlags ) ; -} - -void wxBitmapCheckBox::SetValue(bool val) -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::SetValue() not yet implemented")); -} - -bool wxBitmapCheckBox::GetValue() const -{ - // TODO - wxFAIL_MSG(wxT("wxBitmapCheckBox::GetValue() not yet implemented")); - return FALSE; -} - - diff --git a/src/mac/classic/checklst.cpp b/src/mac/classic/checklst.cpp deleted file mode 100644 index c442bbdfcb..0000000000 --- a/src/mac/classic/checklst.cpp +++ /dev/null @@ -1,453 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: checklst.cpp -// Purpose: implementation of wxCheckListBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers & declarations -// ============================================================================ - -#ifdef __GNUG__ -#pragma implementation "checklst.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_CHECKLISTBOX - -#include "wx/checklst.h" -#include "wx/arrstr.h" - -#include "wx/mac/uma.h" -#include - -// ============================================================================ -// implementation of wxCheckListBox -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) - -const short kwxMacListWithVerticalScrollbar = 128 ; -const short kwxMacListItemHeight = 14 ; -const short kwxMacListCheckboxWidth = 14 ; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} ldefRec, *ldefPtr, **ldefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -extern "C" -{ -static pascal void wxMacCheckListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) ; -} - -static pascal void wxMacCheckListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) -{ - wxCheckListBox* list; - list = (wxCheckListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); - if ( list == NULL ) - return ; - - GrafPtr savePort; - GrafPtr grafPtr; - RgnHandle savedClipRegion; - SInt32 savedPenMode; - GetPort(&savePort); - SetPort((**listHandle).port); - grafPtr = (**listHandle).port ; - // typecast our refCon - - // Calculate the cell rect. - - switch( message ) { - case lInitMsg: - break; - - case lCloseMsg: - break; - - case lDrawMsg: - { - const wxString text = list->m_stringArray[cell.v] ; - int checked = list->m_checks[cell.v] ; - - // Save the current clip region, and set the clip region to the area we are about - // to draw. - - savedClipRegion = NewRgn(); - GetClip( savedClipRegion ); - - ClipRect( drawRect ); - EraseRect( drawRect ); - - const wxFont& font = list->GetFont(); - if ( font.Ok() ) - { - ::TextFont( font.GetMacFontNum() ) ; - ::TextSize( font.GetMacFontSize()) ; - ::TextFace( font.GetMacFontStyle() ) ; - } - - ThemeButtonDrawInfo info ; - info.state = kThemeStateActive ; - info.value = checked ? kThemeButtonOn : kThemeButtonOff ; - info.adornment = kThemeAdornmentNone ; - Rect checkRect = *drawRect ; - - - checkRect.left +=0 ; - checkRect.top +=0 ; - checkRect.right = checkRect.left + list->m_checkBoxWidth ; - checkRect.bottom = checkRect.top + list->m_checkBoxHeight ; - DrawThemeButton(&checkRect,kThemeCheckBox, - &info,NULL,NULL, NULL,0); - - MoveTo(drawRect->left + 2 + list->m_checkBoxWidth+2, drawRect->top + list->m_TextBaseLineOffset ); - - DrawText(text, 0 , text.Length()); - // If the cell is hilited, do the hilite now. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - if( isSelected ) { - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr) grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr) grafPtr, savedPenMode ); - } - - // Restore the saved clip region. - - SetClip( savedClipRegion ); - DisposeRgn( savedClipRegion ); - } - break; - case lHiliteMsg: - - // Hilite or unhilite the cell. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - GetPort( &grafPtr ); - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr) grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr) grafPtr, savedPenMode ); - break; - default : - break ; - } - SetPort(savePort); -} - -extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ; - -static ListDefUPP macCheckListDefUPP = NULL ; - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Init() -{ -} - -bool wxCheckListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString &name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxCheckListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - int n, - const wxString choices[], - long style, - const wxValidator& validator, - const wxString &name) -{ - if ( !wxCheckListBoxBase::Create(parent, id, pos, size, - n, choices, style, validator, name) ) - return false; - - m_noItems = 0 ; // this will be increased by our append command - m_selected = 0; - - m_checkBoxWidth = 12; - m_checkBoxHeight= 10; - - long h = m_checkBoxHeight ; -#if TARGET_CARBON - GetThemeMetric(kThemeMetricCheckBoxWidth,(long *)&m_checkBoxWidth); - GetThemeMetric(kThemeMetricCheckBoxHeight,&h); -#endif - - const wxFont& font = GetFont(); - - FontInfo finfo; - FetchFontInfo(font.GetMacFontNum(),font.GetMacFontSize(),font.GetMacFontStyle(),&finfo); - - m_TextBaseLineOffset= finfo.leading+finfo.ascent; - m_checkBoxHeight= finfo.leading+finfo.ascent+finfo.descent; - - if (m_checkBoxHeightMacGetRootWindow()), &bounds, false, 0, 1, false, true, - m_checkBoxHeight+2, 14, false, &listDef, (ControlRef *)&m_macControl ); - - GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, - sizeof(ListHandle), (Ptr) &m_macList, &asize); - - SetControlReference( (ControlHandle) m_macControl, (long) this); - SetControlVisibility( (ControlHandle) m_macControl, false, false); - -#else - - long result ; - - wxStAppResource resload ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , - kwxMacListWithVerticalScrollbar , 0 , 0, - kControlListBoxProc , (long) this ) ; - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , - sizeof( ListHandle ) , (char*) &m_macList , &result ) ; - - HLock( (Handle) m_macList ) ; - ldefHandle ldef ; - ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ; - if ( (**(ListHandle)m_macList).listDefProc != NULL ) - { - (**ldef).instruction = 0x4EF9; /* JMP instruction */ - (**ldef).function = (void(*)()) listDef.u.userProc; - (**(ListHandle)m_macList).listDefProc = (Handle) ldef ; - } - - Point pt = (**(ListHandle)m_macList).cellSize ; - pt.v = 14 ; - LCellSize( pt , (ListHandle)m_macList ) ; - LAddColumn( 1 , 0 , (ListHandle)m_macList ) ; -#endif - OptionBits options = 0; - if ( style & wxLB_MULTIPLE ) - { - options += lNoExtend ; - } - else if ( style & wxLB_EXTENDED ) - { - options += lExtendDrag ; - } - else - { - options = (OptionBits) lOnlyOne ; - } - SetListSelectionFlags((ListHandle)m_macList, options); - - MacPostControlCreate() ; - - for ( int i = 0 ; i < n ; i++ ) - { - Append( choices[i] ) ; - } - - LSetDrawingMode( true , (ListHandle) m_macList ) ; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxCheckListBox functions -// ---------------------------------------------------------------------------- - -bool wxCheckListBox::IsChecked(size_t item) const -{ - wxCHECK_MSG( item < m_checks.GetCount(), FALSE, - _T("invalid index in wxCheckListBox::IsChecked") ); - - return m_checks[item] != 0; -} - -void wxCheckListBox::Check(size_t item, bool check) -{ - wxCHECK_RET( item < m_checks.GetCount(), - _T("invalid index in wxCheckListBox::Check") ); - - // intermediate var is needed to avoid compiler warning with VC++ - bool isChecked = m_checks[item] != 0; - if ( check != isChecked ) - { - m_checks[item] = check; - - MacRedrawControl() ; - } -} - -// ---------------------------------------------------------------------------- -// methods forwarded to wxListBox -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Delete(int n) -{ - wxCHECK_RET( n < GetCount(), _T("invalid index in wxListBox::Delete") ); - - wxListBox::Delete(n); - - m_checks.RemoveAt(n); -} - -int wxCheckListBox::DoAppend(const wxString& item) -{ - LSetDrawingMode( false , (ListHandle) m_macList ) ; - int pos = wxListBox::DoAppend(item); - - // the item is initially unchecked - m_checks.Insert(FALSE, pos); - LSetDrawingMode( true , (ListHandle) m_macList ) ; - - return pos; -} - -void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos) -{ - wxListBox::DoInsertItems(items, pos); - - size_t count = items.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - m_checks.Insert(FALSE, pos + n); - } -} - -void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData) -{ - // call it first as it does DoClear() - wxListBox::DoSetItems(items, clientData); - - size_t count = items.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - m_checks.Add(FALSE); - } -} - -void wxCheckListBox::DoClear() -{ - m_checks.Empty(); -} - -BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox) - EVT_CHAR(wxCheckListBox::OnChar) - EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick) -END_EVENT_TABLE() - -// this will only work as soon as - -void wxCheckListBox::OnChar(wxKeyEvent& event) -{ - if ( event.GetKeyCode() == WXK_SPACE ) - { - int index = GetSelection() ; - if ( index >= 0 ) - { - Check(index, !IsChecked(index) ) ; - wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId()); - event.SetInt(index); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - else - event.Skip(); -} - -void wxCheckListBox::OnLeftClick(wxMouseEvent& event) -{ - // clicking on the item selects it, clicking on the checkmark toggles - if ( event.GetX() <= 20 /*check width*/ ) { - int lineheight ; - int topcell ; -#if TARGET_CARBON - Point pt ; - GetListCellSize( (ListHandle)m_macList , &pt ) ; - lineheight = pt.v ; - ListBounds visible ; - GetListVisibleCells( (ListHandle)m_macList , &visible ) ; - topcell = visible.top ; -#else - lineheight = (**(ListHandle)m_macList).cellSize.v ; - topcell = (**(ListHandle)m_macList).visible.top ; -#endif - size_t nItem = ((size_t)event.GetY()) / lineheight + topcell ; - - if ( nItem < (size_t)m_noItems ) - { - Check(nItem, !IsChecked(nItem) ) ; - wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId()); - event.SetInt(nItem); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - //else: it's not an error, just click outside of client zone - } - else { - // implement default behaviour: clicking on the item selects it - event.Skip(); - } -} - -#endif // wxUSE_CHECKLISTBOX diff --git a/src/mac/classic/choice.cpp b/src/mac/classic/choice.cpp deleted file mode 100644 index 9f8494db9a..0000000000 --- a/src/mac/classic/choice.cpp +++ /dev/null @@ -1,300 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: choice.cpp -// Purpose: wxChoice -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "choice.h" -#endif - -#include "wx/defs.h" -#include "wx/choice.h" -#include "wx/menu.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) -#endif - -extern MenuHandle NewUniqueMenu() ; - -wxChoice::~wxChoice() -{ - if ( HasClientObjectData() ) - { - size_t i, max = GetCount(); - - for ( i = 0; i < max; ++i ) - delete GetClientObject(i); - } - - // DeleteMenu( m_macPopUpMenuId ) ; - // DisposeMenu( m_macPopUpMenuHandle ) ; -} - -bool wxChoice::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxChoice::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 , - kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; - - m_macPopUpMenuHandle = NewUniqueMenu() ; - SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; - SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ; - if ( n > 0 ) - SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ; - MacPostControlCreate() ; - // TODO wxCB_SORT - for ( int i = 0; i < n; i++ ) - { - Append(choices[i]); - } - return TRUE; -} - -// ---------------------------------------------------------------------------- -// adding/deleting items to/from the list -// ---------------------------------------------------------------------------- -int wxChoice::DoAppend(const wxString& item) -{ - UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() ); - m_strings.Add( item ) ; - m_datas.Add( NULL ) ; - int index = m_strings.GetCount() - 1 ; - DoSetItemClientData( index , NULL ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ; - return index ; -} - -int wxChoice::DoInsert(const wxString& item, int pos) -{ - wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); - - if (pos == GetCount()) - return DoAppend(item); - - UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() ); - m_strings.Insert( item, pos ) ; - m_datas.Insert( NULL, pos ) ; - DoSetItemClientData( pos , NULL ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , pos) ; - return pos ; -} - -void wxChoice::Delete(int n) -{ - wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") ); - if ( HasClientObjectData() ) - { - delete GetClientObject(n); - } - ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ; - m_strings.RemoveAt( n ) ; - m_datas.RemoveAt( n ) ; - SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ; -} - -void wxChoice::Clear() -{ - FreeData(); - for ( int i = 0 ; i < GetCount() ; i++ ) - { - ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ; - } - m_strings.Empty() ; - m_datas.Empty() ; - SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ; -} - -void wxChoice::FreeData() -{ - if ( HasClientObjectData() ) - { - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - delete GetClientObject(n); - } - } -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- -int wxChoice::GetSelection() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ; -} - -void wxChoice::SetSelection(int n) -{ - SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ; -} - -// ---------------------------------------------------------------------------- -// string list functions -// ---------------------------------------------------------------------------- - -int wxChoice::GetCount() const -{ - return m_strings.GetCount() ; -} - -int wxChoice::FindString(const wxString& s) const -{ - for( int i = 0 ; i < GetCount() ; i++ ) - { - if ( GetString( i ).IsSameAs(s, FALSE) ) - return i ; - } - return wxNOT_FOUND ; -} - -void wxChoice::SetString(int n, const wxString& s) -{ - wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented")); -#if 0 // should do this, but no Insert() so far - Delete(n); - Insert(n + 1, s); -#endif -} - -wxString wxChoice::GetString(int n) const -{ - wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""), - _T("wxChoice::GetString(): invalid index") ); - - return m_strings[n] ; -} - -// ---------------------------------------------------------------------------- -// client data -// ---------------------------------------------------------------------------- -void wxChoice::DoSetItemClientData( int n, void* clientData ) -{ - wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(), - wxT("invalid index in wxChoice::SetClientData") ); - - m_datas[n] = (char*) clientData ; -} - -void *wxChoice::DoGetItemClientData(int n) const -{ - wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL, - wxT("invalid index in wxChoice::GetClientData") ); - return (void *)m_datas[n]; -} - -void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) -{ - DoSetItemClientData(n, clientData); -} - -wxClientData* wxChoice::DoGetItemClientObject( int n ) const -{ - return (wxClientData *)DoGetItemClientData(n); -} - -void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); - int n = GetSelection(); - // actually n should be made sure by the os to be a valid selection, but ... - if ( n > -1 ) - { - event.SetInt( n ); - event.SetString(GetStringSelection()); - event.SetEventObject(this); - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - ProcessCommand(event); - } -} - -wxSize wxChoice::DoGetBestSize() const -{ - int lbWidth = GetCount() > 0 ? 20 : 100; // some defaults - int lbHeight = 20; - int wLine; -#if TARGET_CARBON - long metric ; - GetThemeMetric(kThemeMetricPopupButtonHeight , &metric ); - lbHeight = metric ; -#endif - { - wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( m_font.GetMacFontSize() ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - // Find the widest line - for(int i = 0; i < GetCount(); i++) { - wxString str(GetString(i)); - #if wxUSE_UNICODE - Point bounds={0,0} ; - SInt16 baseline ; - ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) , - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - wLine = bounds.h ; - #else - wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ; - #endif - lbWidth = wxMax(lbWidth, wLine); - } - // Add room for the popup arrow - lbWidth += 2 * lbHeight ; - // And just a bit more - int cx = ::TextWidth( "X" , 0 , 1 ) ; - lbWidth += cx ; - - } - return wxSize(lbWidth, lbHeight); -} diff --git a/src/mac/classic/clipbrd.cpp b/src/mac/classic/clipbrd.cpp deleted file mode 100644 index e331d80f8e..0000000000 --- a/src/mac/classic/clipbrd.cpp +++ /dev/null @@ -1,406 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: clipbrd.cpp -// Purpose: Clipboard functionality -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "clipbrd.h" -#endif - -#include "wx/app.h" -#include "wx/frame.h" -#include "wx/bitmap.h" -#include "wx/utils.h" -#include "wx/metafile.h" -#include "wx/clipbrd.h" -#include "wx/intl.h" -#include "wx/log.h" - -#ifndef __DARWIN__ -#include -#endif -#include "wx/mac/uma.h" - -#define wxUSE_DATAOBJ 1 - -#include - -// the trace mask we use with wxLogTrace() - call -// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here -// (there will be a *lot* of them!) -static const wxChar *TRACE_CLIPBOARD = _T("clipboard"); - -void *wxGetClipboardData(wxDataFormat dataFormat, long *len) -{ -#if !TARGET_CARBON - OSErr err = noErr ; -#else - OSStatus err = noErr ; -#endif - void * data = NULL ; - Size byteCount; - - switch (dataFormat.GetType()) - { - case wxDF_OEMTEXT: - dataFormat = wxDF_TEXT; - // fall through - - case wxDF_TEXT: - break; - case wxDF_UNICODETEXT: - break; - case wxDF_BITMAP : - case wxDF_METAFILE : - break ; - default: - { - wxLogError(_("Unsupported clipboard format.")); - return NULL; - } - } - -#if TARGET_CARBON - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - - if (( err = GetScrapFlavorFlags( scrapRef, dataFormat.GetFormatId(), &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) - { - Size allocSize = byteCount ; - if ( dataFormat.GetType() == wxDF_TEXT ) - allocSize += 1 ; - else if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - allocSize += 2 ; - - data = new char[ allocSize ] ; - - if (( err = GetScrapFlavorData( scrapRef, dataFormat.GetFormatId(), &byteCount , data )) == noErr ) - { - *len = allocSize ; - if ( dataFormat.GetType() == wxDF_TEXT ) - ((char*)data)[byteCount] = 0 ; - if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - ((wxChar*)data)[byteCount/2] = 0 ; - } - else - { - delete[] ((char *)data) ; - data = NULL ; - } - } - } - } - -#else - long offset ; - Handle datahandle = NewHandle(0) ; - HLock( datahandle ) ; - GetScrap( datahandle , dataFormat.GetFormatId() , &offset ) ; - HUnlock( datahandle ) ; - if ( GetHandleSize( datahandle ) > 0 ) - { - byteCount = GetHandleSize( datahandle ) ; - Size allocSize = byteCount ; - if ( dataFormat.GetType() == wxDF_TEXT ) - allocSize += 1 ; - else if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - allocSize += 2 ; - - data = new char[ allocSize ] ; - - memcpy( (char*) data , (char*) *datahandle , byteCount ) ; - if ( dataFormat.GetType() == wxDF_TEXT ) - ((char*)data)[byteCount] = 0 ; - if ( dataFormat.GetType() == wxDF_UNICODETEXT ) - ((wxChar*)data)[byteCount/2] = 0 ; - *len = byteCount ; - } - DisposeHandle( datahandle ) ; -#endif - if ( err ) - { - wxLogSysError(_("Failed to get clipboard data.")); - - return NULL ; - } - - if ( dataFormat.GetType() == wxDF_TEXT ) - { - wxMacConvertNewlines10To13( (char*) data ) ; - } - - return data; -} - - -/* - * Generalized clipboard implementation by Matthew Flatt - */ - -IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) - -wxClipboard::wxClipboard() -{ - m_open = false ; - m_data = NULL ; -} - -wxClipboard::~wxClipboard() -{ - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } -} - -void wxClipboard::Clear() -{ - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } -#if TARGET_CARBON - OSStatus err ; - err = ClearCurrentScrap( ); -#else - OSErr err ; - err = ZeroScrap( ); -#endif - if ( err ) - { - wxLogSysError(_("Failed to empty the clipboard.")); - } -} - -bool wxClipboard::Flush() -{ - return FALSE; -} - -bool wxClipboard::Open() -{ - wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") ); - m_open = true ; - return true ; -} - -bool wxClipboard::IsOpened() const -{ - return m_open; -} - -bool wxClipboard::SetData( wxDataObject *data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - - Clear(); - // as we can only store one wxDataObject, this is the same in this - // implementation - return AddData( data ); -} - -bool wxClipboard::AddData( wxDataObject *data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); - - /* we can only store one wxDataObject */ - Clear(); - - m_data = data; - - /* get formats from wxDataObjects */ - wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ]; - m_data->GetAllFormats( array ); - - for (size_t i = 0; i < m_data->GetFormatCount(); i++) - { - wxLogTrace( TRACE_CLIPBOARD, - wxT("wxClipboard now supports atom %s"), - array[i].GetId().c_str() ); - -#if !TARGET_CARBON - OSErr err = noErr ; -#else - OSStatus err = noErr ; -#endif - size_t sz = data->GetDataSize( array[i] ) ; - void* buf = malloc( sz + 1 ) ; - if ( buf ) - { - data->GetDataHere( array[i] , buf ) ; - OSType mactype = 0 ; - switch ( array[i].GetType() ) - { - case wxDF_TEXT: - case wxDF_OEMTEXT: - mactype = kScrapFlavorTypeText ; - break ; - #if wxUSE_UNICODE - case wxDF_UNICODETEXT : - mactype = kScrapFlavorTypeUnicode ; - break ; - #endif - #if wxUSE_DRAG_AND_DROP - case wxDF_METAFILE: - mactype = kScrapFlavorTypePicture ; - break ; - #endif - case wxDF_BITMAP: - case wxDF_DIB: - mactype = kScrapFlavorTypePicture ; - break ; - default: - break ; - } - UMAPutScrap( sz , mactype , buf ) ; - free( buf ) ; - } - } - - delete[] array; - - return true ; -} - -void wxClipboard::Close() -{ - wxCHECK_RET( m_open, wxT("clipboard not open") ); - - m_open = false ; - - // Get rid of cached object. If this is not done copying from another application will - // only work once - if (m_data) - { - delete m_data; - m_data = (wxDataObject*) NULL; - } - -} - -bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) -{ - if ( m_data ) - { - return m_data->IsSupported( dataFormat ) ; - } -#if TARGET_CARBON - OSStatus err = noErr; - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - Size byteCount; - - if (( err = GetScrapFlavorFlags( scrapRef, dataFormat.GetFormatId(), &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr) - { - return TRUE ; - } - } - } - return FALSE; - -#else - long offset ; - Handle datahandle = NewHandle(0) ; - HLock( datahandle ) ; - GetScrap( datahandle , dataFormat.GetFormatId() , &offset ) ; - HUnlock( datahandle ) ; - bool hasData = GetHandleSize( datahandle ) > 0 ; - DisposeHandle( datahandle ) ; - return hasData ; -#endif -} - -bool wxClipboard::GetData( wxDataObject& data ) -{ - wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") ); - - size_t formatcount = data.GetFormatCount() + 1 ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - array[0] = data.GetPreferredFormat(); - data.GetAllFormats( &array[1] ); - - bool transferred = false ; - - if ( m_data ) - { - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_data->IsSupported( format ) ) - { - int size = m_data->GetDataSize( format ); - transferred = true ; - - if (size == 0) - { - data.SetData(format , 0 , 0 ) ; - } - else - { - char *d = new char[size]; - m_data->GetDataHere( format , (void*) d ); - data.SetData( format , size , d ) ; - delete[] d ; - } - } - } - } - /* get formats from wxDataObjects */ - if ( !transferred ) - { - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - - switch ( format.GetType() ) - { - case wxDF_TEXT : - case wxDF_OEMTEXT : - case wxDF_BITMAP : - case wxDF_METAFILE : - { - long len ; - char* s = (char*)wxGetClipboardData(format, &len ); - if ( s ) - { - data.SetData( format , len , s ) ; - delete [] s; - - transferred = true ; - } - } - break ; - - default : - break ; - } - } - } - - delete[] array ; - return transferred ; -} diff --git a/src/mac/classic/colordlg.cpp b/src/mac/classic/colordlg.cpp deleted file mode 100644 index 3c8411319b..0000000000 --- a/src/mac/classic/colordlg.cpp +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colordlg.cpp -// Purpose: wxColourDialog class. NOTE: you can use the generic class -// if you wish, instead of implementing this. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "colordlg.h" -#endif - -#include "wx/mac/colordlg.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) -#endif - -#include "wx/mac/private.h" -#ifndef __DARWIN__ -#include -#endif - -/* - * wxColourDialog - */ - -wxColourDialog::wxColourDialog() -{ - m_dialogParent = NULL; -} - -wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data) -{ - Create(parent, data); -} - -bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) -{ - m_dialogParent = parent; - - if (data) - m_colourData = *data; - return TRUE; -} - -int wxColourDialog::ShowModal() -{ - Point where ; - RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ; - - where.h = where.v = -1; - - if (GetColor( where, "\pSelect a new palette color.", ¤tColor, &newColor )) - { - m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ; - return wxID_OK; - } - else - { - return wxID_CANCEL; - } - - return wxID_CANCEL; -} - diff --git a/src/mac/classic/colour.cpp b/src/mac/classic/colour.cpp deleted file mode 100644 index 86487f7a35..0000000000 --- a/src/mac/classic/colour.cpp +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: colour.cpp -// Purpose: wxColour class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "colour.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/colour.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) -#endif - -// Colour - -#include "wx/mac/private.h" - -static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green ) ; -static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green ) -{ - RGBColor* col = (RGBColor*) color ; - col->red = (red << 8) + red; - col->blue = (blue << 8) + blue; - col->green = (green << 8) + green; -} - -void wxColour::Init() -{ - m_isInit = false; - m_red = - m_blue = - m_green = 0; - - wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ; -} - -wxColour::wxColour (const wxColour& col) - : wxObject() -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel , &col.m_pixel , 6 ) ; -} - -wxColour::wxColour (const wxColour* col) -{ - m_red = col->m_red; - m_green = col->m_green; - m_blue = col->m_blue; - m_isInit = col->m_isInit; - - memcpy( &m_pixel , &col->m_pixel , 6 ) ; -} - -wxColour& wxColour::operator =(const wxColour& col) -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel , &col.m_pixel , 6 ) ; - - return *this; -} - -void wxColour::InitFromName(const wxString& name) -{ - if ( wxTheColourDatabase ) - { - wxColour col = wxTheColourDatabase->Find(name); - if ( col.Ok() ) - { - *this = col; - return; - } - } - - // leave invalid - Init(); -} - -wxColour::~wxColour () -{ -} - -void wxColour::Set (unsigned char r, unsigned char g, unsigned char b) -{ - m_red = r; - m_green = g; - m_blue = b; - m_isInit = true; - - wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ; -} - -void wxColour::Set( const WXCOLORREF* color ) -{ - RGBColor* col = (RGBColor*) color ; - memcpy( &m_pixel , color , 6 ) ; - m_red = col->red>>8 ; - m_blue = col->blue>>8 ; - m_green = col->green>>8 ; -} diff --git a/src/mac/classic/combobox.cpp b/src/mac/classic/combobox.cpp deleted file mode 100644 index 27aa1a58de..0000000000 --- a/src/mac/classic/combobox.cpp +++ /dev/null @@ -1,540 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: combobox.cpp -// Purpose: wxComboBox class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "combobox.h" -#endif - -#include "wx/combobox.h" -#include "wx/button.h" -#include "wx/menu.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) -#endif - -// composite combobox implementation by Dan "Bud" Keith bud@otsys.com - - -static int nextPopUpMenuId = 1000 ; -MenuHandle NewUniqueMenu() -{ - MenuHandle handle = NewMenu( nextPopUpMenuId , "\pMenu" ) ; - nextPopUpMenuId++ ; - return handle ; -} - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the text control and the choice -static const wxCoord MARGIN = 2; -static const int POPUPWIDTH = 18; -static const int POPUPHEIGHT = 23; - - -// ---------------------------------------------------------------------------- -// wxComboBoxText: text control forwards events to combobox -// ---------------------------------------------------------------------------- - -class wxComboBoxText : public wxTextCtrl -{ -public: - wxComboBoxText( wxComboBox * cb ) - : wxTextCtrl( cb , 1 ) - { - m_cb = cb; - } - -protected: - void OnChar( wxKeyEvent& event ) - { - if ( event.GetKeyCode() == WXK_RETURN ) - { - wxString value = GetValue(); - - if ( m_cb->GetCount() == 0 ) - { - // make Enter generate "selected" event if there is only one item - // in the combobox - without it, it's impossible to select it at - // all! - wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event.SetInt( 0 ); - event.SetString( value ); - event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); - } - else - { - // add the item to the list if it's not there yet - if ( m_cb->FindString(value) == wxNOT_FOUND ) - { - m_cb->Append(value); - m_cb->SetStringSelection(value); - - // and generate the selected event for it - wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event.SetInt( m_cb->GetCount() - 1 ); - event.SetString( value ); - event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); - } - - // This will invoke the dialog default action, such - // as the clicking the default button. - - wxWindow *parent = GetParent(); - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) { - parent = parent->GetParent() ; - } - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - - return; - } - } - - event.Skip(); - } - -private: - wxComboBox *m_cb; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxComboBoxText, wxTextCtrl) - EVT_CHAR( wxComboBoxText::OnChar) -END_EVENT_TABLE() - -class wxComboBoxChoice : public wxChoice -{ -public: - wxComboBoxChoice(wxComboBox *cb, int style) - : wxChoice( cb , 1 ) - { - m_cb = cb; - } - -protected: - void OnChoice( wxCommandEvent& e ) - { - wxString s = e.GetString(); - - m_cb->DelegateChoice( s ); - wxCommandEvent event2(wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() ); - event2.SetInt(m_cb->GetSelection()); - event2.SetEventObject(m_cb); - event2.SetString(m_cb->GetStringSelection()); - m_cb->ProcessCommand(event2); - } - -private: - wxComboBox *m_cb; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice) - EVT_CHOICE(-1, wxComboBoxChoice::OnChoice) -END_EVENT_TABLE() - -wxComboBox::~wxComboBox() -{ - // delete client objects - FreeData(); - - // delete the controls now, don't leave them alive even though they would - // still be eventually deleted by our parent - but it will be too late, the - // user code expects them to be gone now - if (m_text != NULL) { - delete m_text; - m_text = NULL; - } - if (m_choice != NULL) { - delete m_choice; - m_choice = NULL; - } -} - - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxComboBox::DoGetBestSize() const -{ - wxSize size = m_choice->GetBestSize(); - - if ( m_text != NULL ) - { - wxSize sizeText = m_text->GetBestSize(); - - size.x = POPUPWIDTH + sizeText.x + MARGIN; - } - - return size; -} - -void wxComboBox::DoMoveWindow(int x, int y, int width, int height) { - height = POPUPHEIGHT; - - wxControl::DoMoveWindow(x, y, width, height); - - if ( m_text == NULL ) - { - m_choice->SetSize(0, 0 , width, -1); - } - else - { - wxCoord wText = width - POPUPWIDTH - MARGIN; - m_text->SetSize(0, 0, wText, height); - m_choice->SetSize(0 + wText + MARGIN, 0, POPUPWIDTH, -1); - } -} - - - -// ---------------------------------------------------------------------------- -// operations forwarded to the subcontrols -// ---------------------------------------------------------------------------- - -bool wxComboBox::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return FALSE; - - return TRUE; -} - -bool wxComboBox::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return FALSE; - - return TRUE; -} - -void wxComboBox::SetFocus() -{ - if ( m_text != NULL) { - m_text->SetFocus(); - } -} - - -void wxComboBox::DelegateTextChanged( const wxString& value ) -{ - SetStringSelection( value ); -} - - -void wxComboBox::DelegateChoice( const wxString& value ) -{ - SetStringSelection( value ); -} - - -bool wxComboBox::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs( choices ); - - return Create( parent, id, value, pos, size, chs.GetCount(), - chs.GetStrings(), style, validator, name ); -} - - -bool wxComboBox::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style , - wxDefaultValidator, name) ) - { - return FALSE; - } - - m_choice = new wxComboBoxChoice(this, style ); - - wxSize csize = size; - if ( style & wxCB_READONLY ) - { - m_text = NULL; - } - else - { - m_text = new wxComboBoxText(this); - if ( size.y == -1 ) { - csize.y = m_text->GetSize().y ; - } - } - - DoSetSize(pos.x, pos.y, csize.x, csize.y); - - for ( int i = 0 ; i < n ; i++ ) - { - m_choice->DoAppend( choices[ i ] ); - } - - return TRUE; -} - -wxString wxComboBox::GetValue() const -{ - wxString result; - - if ( m_text == NULL ) - { - result = m_choice->GetString( m_choice->GetSelection() ); - } - else - { - result = m_text->GetValue(); - } - - return result; -} - -void wxComboBox::SetValue(const wxString& value) -{ - int s = FindString (value); - if (s == wxNOT_FOUND && !HasFlag(wxCB_READONLY) ) - { - m_choice->Append(value) ; - } - SetStringSelection( value ) ; -} - -// Clipboard operations -void wxComboBox::Copy() -{ - if ( m_text != NULL ) - { - m_text->Copy(); - } -} - -void wxComboBox::Cut() -{ - if ( m_text != NULL ) - { - m_text->Cut(); - } -} - -void wxComboBox::Paste() -{ - if ( m_text != NULL ) - { - m_text->Paste(); - } -} - -void wxComboBox::SetEditable(bool editable) -{ - if ( ( m_text == NULL ) && editable ) - { - m_text = new wxComboBoxText( this ); - } - else if ( ( m_text != NULL ) && !editable ) - { - delete m_text; - m_text = NULL; - } - - int currentX, currentY; - GetPosition( ¤tX, ¤tY ); - - int currentW, currentH; - GetSize( ¤tW, ¤tH ); - - DoMoveWindow( currentX, currentY, currentW, currentH ); -} - -void wxComboBox::SetInsertionPoint(long pos) -{ - // TODO -} - -void wxComboBox::SetInsertionPointEnd() -{ - // TODO -} - -long wxComboBox::GetInsertionPoint() const -{ - // TODO - return 0; -} - -long wxComboBox::GetLastPosition() const -{ - // TODO - return 0; -} - -void wxComboBox::Replace(long from, long to, const wxString& value) -{ - // TODO -} - -void wxComboBox::Remove(long from, long to) -{ - // TODO -} - -void wxComboBox::SetSelection(long from, long to) -{ - // TODO -} - -int wxComboBox::DoAppend(const wxString& item) -{ - return m_choice->DoAppend( item ) ; -} - -int wxComboBox::DoInsert(const wxString& item, int pos) -{ - return m_choice->DoInsert( item , pos ) ; -} - -void wxComboBox::DoSetItemClientData(int n, void* clientData) -{ - return m_choice->DoSetItemClientData( n , clientData ) ; -} - -void* wxComboBox::DoGetItemClientData(int n) const -{ - return m_choice->DoGetItemClientData( n ) ; -} - -void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData) -{ - return m_choice->DoSetItemClientObject( n , clientData ) ; -} - -wxClientData* wxComboBox::DoGetItemClientObject(int n) const -{ - return m_choice->DoGetItemClientObject( n ) ; -} - -void wxComboBox::FreeData() -{ - if ( HasClientObjectData() ) - { - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - SetClientObject( n, NULL ); - } - } -} - -void wxComboBox::Delete(int n) -{ - // force client object deletion - if( HasClientObjectData() ) - SetClientObject( n, NULL ); - m_choice->Delete( n ); -} - -void wxComboBox::Clear() -{ - FreeData(); - m_choice->Clear(); -} - -int wxComboBox::GetSelection() const -{ - return m_choice->GetSelection(); -} - -void wxComboBox::SetSelection(int n) -{ - m_choice->SetSelection( n ); - - if ( m_text != NULL ) - { - m_text->SetValue( GetString( n ) ); - } -} - -int wxComboBox::FindString(const wxString& s) const -{ - return m_choice->FindString( s ); -} - -wxString wxComboBox::GetString(int n) const -{ - return m_choice->GetString( n ); -} - -wxString wxComboBox::GetStringSelection() const -{ - int sel = GetSelection (); - if (sel > -1) - return wxString(this->GetString (sel)); - else - return wxEmptyString; -} - -bool wxComboBox::SetStringSelection(const wxString& sel) -{ - int s = FindString (sel); - if (s > -1) - { - SetSelection (s); - return TRUE; - } - else - return FALSE; -} - -void wxComboBox::SetString(int n, const wxString& s) -{ - m_choice->SetString( n , s ) ; -} - - -void wxComboBox::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 WXUNUSED(controlpart) , bool WXUNUSED(mouseStillDown)) -{ - wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId ); - event.SetInt(GetSelection()); - event.SetEventObject(this); - event.SetString(GetStringSelection()); - ProcessCommand(event); -} - diff --git a/src/mac/classic/control.cpp b/src/mac/classic/control.cpp deleted file mode 100644 index 473bdec9fd..0000000000 --- a/src/mac/classic/control.cpp +++ /dev/null @@ -1,814 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: control.cpp -// Purpose: wxControl class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "control.h" -#endif - -#include "wx/defs.h" - -#include "wx/control.h" -#include "wx/panel.h" -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/radiobox.h" -#include "wx/spinbutt.h" -#include "wx/scrolbar.h" -#include "wx/button.h" -#include "wx/dialog.h" -#include "wx/statbox.h" -#include "wx/sizer.h" -#include "wx/stattext.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) - -BEGIN_EVENT_TABLE(wxControl, wxWindow) - EVT_MOUSE_EVENTS( wxControl::OnMouseEvent ) - EVT_PAINT( wxControl::OnPaint ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" -#include "wx/mac/private.h" - -// Item members - - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} cdefRec, *cdefPtr, **cdefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -ControlActionUPP wxMacLiveScrollbarActionUPP = NULL ; -wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ; - -pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode ) ; -pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode ) -{ - if ( partCode != 0) - { - wxControl* wx = (wxControl*) GetControlReference( control ) ; - if ( wx ) - { - wx->MacHandleControlClick( control , partCode , true /* stillDown */ ) ; - } - } -} - -ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ; -ControlDefUPP wxMacControlActionUPP = NULL ; - -pascal SInt32 wxMacControlDefinition(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param) -{ - - wxControl* wx = (wxControl*) wxFindControlFromMacControl( theControl ) ; - if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) ) - { - if( message == drawCntl ) - { - wxMacWindowClipper clip( wx ) ; - return InvokeControlDefUPP( varCode , theControl , message , param , (ControlDefUPP) wx->MacGetControlAction() ) ; - } - else - return InvokeControlDefUPP( varCode , theControl , message , param , (ControlDefUPP) wx->MacGetControlAction() ) ; - } - return NULL ; -} - -pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor ) -{ - OSStatus status = noErr ; - switch( iMessage ) - { - case kControlMsgSetUpBackground : - { - wxControl* wx = (wxControl*) GetControlReference( iControl ) ; - if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) ) - { - wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ; -#if TARGET_CARBON - // under classic this would lead to partial redraws - RgnHandle clip = NewRgn() ; - int x = 0 , y = 0; - - wx->MacWindowToRootWindow( &x,&y ) ; - CopyRgn( (RgnHandle) wx->MacGetVisibleRegion(false).GetWXHRGN() , clip ) ; - OffsetRgn( clip , x , y ) ; - SetClip( clip ) ; - DisposeRgn( clip ) ; -#endif - } - else - { - status = paramErr ; - } - } - break ; - default : - status = paramErr ; - break ; - } - return status ; -} - -wxControl::wxControl() -{ - m_macControl = NULL ; - m_macControlAction = NULL ; - m_macHorizontalBorder = 0 ; // additional pixels around the real control - m_macVerticalBorder = 0 ; - m_backgroundColour = *wxWHITE; - m_foregroundColour = *wxBLACK; - - if ( wxMacLiveScrollbarActionUPP == NULL ) - { -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc ); -#else - wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ; -#endif - } -} - -bool wxControl::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_macControl = NULL ; - m_macHorizontalBorder = 0 ; // additional pixels around the real control - m_macVerticalBorder = 0 ; - - bool rval = wxWindow::Create(parent, id, pos, size, style, name); - if ( parent ) - { - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - } - if (rval) { -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif - } - return rval; -} - -wxControl::~wxControl() -{ - m_isBeingDeleted = TRUE; - wxRemoveMacControlAssociation( this ) ; - // If we delete an item, we should initialize the parent panel, - // because it could now be invalid. - wxWindow *parent = GetParent() ; - if ( parent ) - { - if (parent->GetDefaultItem() == (wxButton*) this) - parent->SetDefaultItem(NULL); - } - if ( (ControlHandle) m_macControl ) - { - // in case the callback might be called during destruction - ::SetControlColorProc( (ControlHandle) m_macControl , NULL ) ; - ::DisposeControl( (ControlHandle) m_macControl ) ; - m_macControl = NULL ; - } -} - -void wxControl::SetLabel(const wxString& title) -{ - m_label = wxStripMenuCodes(title) ; - - if ( m_macControl ) - { - UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ; - } - Refresh() ; -} - -wxSize wxControl::DoGetBestSize() const -{ - if ( (ControlHandle) m_macControl == NULL ) - return wxWindow::DoGetBestSize() ; - - Rect bestsize = { 0 , 0 , 0 , 0 } ; - short baselineoffset ; - int bestWidth, bestHeight ; - ::GetBestControlRect( (ControlHandle) m_macControl , &bestsize , &baselineoffset ) ; - - if ( EmptyRect( &bestsize ) ) - { - baselineoffset = 0; - bestsize.left = bestsize.top = 0 ; - bestsize.right = 16 ; - bestsize.bottom = 16 ; - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - bestsize.bottom = 16 ; - } - else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) ) - { - bestsize.bottom = 24 ; - } - } - - bestWidth = bestsize.right - bestsize.left ; - - bestWidth += 2 * m_macHorizontalBorder ; - - bestHeight = bestsize.bottom - bestsize.top ; - if ( bestHeight < 10 ) - bestHeight = 13 ; - - bestHeight += 2 * m_macVerticalBorder; - - - return wxSize(bestWidth, bestHeight); -} - -bool wxControl::ProcessCommand (wxCommandEvent & event) -{ - // Tries: - // 1) OnCommand, starting at this window and working up parent hierarchy - // 2) OnCommand then calls ProcessEvent to search the event tables. - return GetEventHandler()->ProcessEvent(event); -} - -// ------------------------ -wxList *wxWinMacControlList = NULL; -wxControl *wxFindControlFromMacControl(ControlHandle inControl ) -{ - wxNode *node = wxWinMacControlList->Find((long)inControl); - if (!node) - return NULL; - return (wxControl *)node->GetData(); -} - -void wxAssociateControlWithMacControl(ControlHandle inControl, wxControl *control) -{ - // adding NULL WindowRef is (first) surely a result of an error and - // (secondly) breaks menu command processing - wxCHECK_RET( inControl != (ControlHandle) NULL, wxT("attempt to add a NULL WindowRef to window list") ); - - if ( !wxWinMacControlList->Find((long)inControl) ) - wxWinMacControlList->Append((long)inControl, control); -} - -void wxRemoveMacControlAssociation(wxControl *control) -{ - if ( wxWinMacControlList ) - wxWinMacControlList->DeleteObject(control); -} - -void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label , - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) -{ - m_label = label ; - - // These sizes will be adjusted in MacPostControlCreate - m_width = size.x ; - m_height = size.y ; - m_x = pos.x ; - m_y = pos.y ; - - ((Rect*)outBounds)->top = -10; - ((Rect*)outBounds)->left = -10; - ((Rect*)outBounds)->bottom = 0; - ((Rect*)outBounds)->right = 0; - - wxMacStringToPascal( wxStripMenuCodes(label) , maclabel ) ; -} - -void wxControl::MacPostControlCreate() -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - DoSetWindowVariant( m_windowVariant ) ; - /* - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - // no font - } - else if ( !UMAHasAquaLayout() && (IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) ) ) - { - ControlFontStyleRec controlstyle ; - controlstyle.flags = kControlUseFontMask ; - controlstyle.font = kControlFontSmallBoldSystemFont ; - - ::SetControlFontStyle( (ControlHandle) m_macControl , &controlstyle ) ; - } - else - { - ControlFontStyleRec controlstyle ; - controlstyle.flags = kControlUseFontMask ; - - if (IsKindOf( CLASSINFO( wxButton ) ) ) - controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ; - else - controlstyle.font = kControlFontSmallSystemFont ; - - ::SetControlFontStyle( (ControlHandle) m_macControl , &controlstyle ) ; - } - */ - ControlHandle container = (ControlHandle) GetParent()->MacGetContainerForEmbedding() ; - wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; - ::EmbedControl( (ControlHandle) m_macControl , container ) ; - m_macControlIsShown = MacIsReallyShown() ; - - wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ; - if ( wxMacSetupControlBackgroundUPP == NULL ) - { - wxMacSetupControlBackgroundUPP = NewControlColorUPP( wxMacSetupControlBackground ) ; - } - if ( wxMacControlActionUPP == NULL ) - { - wxMacControlActionUPP = NewControlDefUPP( wxMacControlDefinition ) ; - } - // The following block of code is responsible for crashes when switching - // back to windows, which can be seen in the dialogs sample. - // It is disabled until a proper solution can be found. -#if 0 -#if TARGET_CARBON -/* - only working under classic carbon - m_macControlAction = *(**(ControlHandle)m_macControl).contrlDefProc ; - (**(ControlHandle)m_macControl).contrlDefProc = (Handle) &wxMacControlActionUPP ; -*/ -#else - m_macControlAction = *(**(ControlHandle)m_macControl).contrlDefProc ; - - cdefHandle cdef ; - cdef = (cdefHandle) NewHandle( sizeof(cdefRec) ) ; - if ( (**(ControlHandle)m_macControl).contrlDefProc != NULL ) - { - (**cdef).instruction = 0x4EF9; /* JMP instruction */ - (**cdef).function = (void(*)()) wxMacControlActionUPP; - (**(ControlHandle)m_macControl).contrlDefProc = (Handle) cdef ; - } -#endif -#endif - SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ; - - // Adjust the controls size and position - wxPoint pos(m_x, m_y); - wxSize best_size( DoGetBestSize() ); - wxSize new_size( m_width, m_height ); - - m_x = m_y = m_width = m_height = -1; // Forces SetSize to move/size the control - - if (new_size.x == -1) { - new_size.x = best_size.x; - } - if (new_size.y == -1) { - new_size.y = best_size.y; - } - - SetSize(pos.x, pos.y, new_size.x, new_size.y); - -#if wxUSE_UNICODE - UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ; -#endif - - if ( m_macControlIsShown ) - UMAShowControl( (ControlHandle) m_macControl ) ; - - SetCursor( *wxSTANDARD_CURSOR ) ; - - Refresh() ; -} - -void wxControl::MacAdjustControlRect() -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - if ( m_width == -1 || m_height == -1 ) - { - Rect bestsize = { 0 , 0 , 0 , 0 } ; - short baselineoffset ; - - ::GetBestControlRect( (ControlHandle) m_macControl , &bestsize , &baselineoffset ) ; - - if ( EmptyRect( &bestsize ) ) - { - baselineoffset = 0; - bestsize.left = bestsize.top = 0 ; - bestsize.right = 16 ; - bestsize.bottom = 16 ; - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - { - bestsize.bottom = 16 ; - } - else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) ) - { - bestsize.bottom = 24 ; - } - } - - if ( m_width == -1 ) - { - if ( IsKindOf( CLASSINFO( wxButton ) ) ) - { - m_width = m_label.Length() * 8 + 12 ; - if ( m_width < 70 ) - m_width = 70 ; - } - else if ( IsKindOf( CLASSINFO( wxStaticText ) ) ) - { - m_width = m_label.Length() * 8 ; - } - else - m_width = bestsize.right - bestsize.left ; - - m_width += 2 * m_macHorizontalBorder + MacGetLeftBorderSize() + MacGetRightBorderSize() ; - } - if ( m_height == -1 ) - { - m_height = bestsize.bottom - bestsize.top ; - if ( m_height < 10 ) - m_height = 13 ; - - m_height += 2 * m_macVerticalBorder + MacGetTopBorderSize() + MacGetBottomBorderSize() ; - } - MacUpdateDimensions() ; - } -} - -WXWidget wxControl::MacGetContainerForEmbedding() -{ - if ( m_macControl ) - return m_macControl ; - - return wxWindow::MacGetContainerForEmbedding() ; -} - -void wxControl::MacUpdateDimensions() -{ - // actually in the current systems this should never be possible, but later reparenting - // may become a reality - - if ( (ControlHandle) m_macControl == NULL ) - return ; - - if ( GetParent() == NULL ) - return ; - - WindowRef rootwindow = (WindowRef) MacGetRootWindow() ; - if ( rootwindow == NULL ) - return ; - - Rect oldBounds ; - GetControlBounds( (ControlHandle) m_macControl , &oldBounds ) ; - - int new_x = m_x + MacGetLeftBorderSize() + m_macHorizontalBorder ; - int new_y = m_y + MacGetTopBorderSize() + m_macVerticalBorder ; - int new_width = m_width - MacGetLeftBorderSize() - MacGetRightBorderSize() - 2 * m_macHorizontalBorder ; - int new_height = m_height - MacGetTopBorderSize() - MacGetBottomBorderSize() - 2 * m_macVerticalBorder ; - - GetParent()->MacWindowToRootWindow( & new_x , & new_y ) ; - bool doMove = new_x != oldBounds.left || new_y != oldBounds.top ; - bool doResize = ( oldBounds.right - oldBounds.left ) != new_width || (oldBounds.bottom - oldBounds.top ) != new_height ; - if ( doMove || doResize ) - { - InvalWindowRect( rootwindow, &oldBounds ) ; - if ( doMove ) - { - UMAMoveControl( (ControlHandle) m_macControl , new_x , new_y ) ; - } - if ( doResize ) - { - UMASizeControl( (ControlHandle) m_macControl , new_width , new_height ) ; - } - } -} - -void wxControl::MacSuperChangedPosition() -{ - MacUpdateDimensions() ; - wxWindow::MacSuperChangedPosition() ; -} - -void wxControl::MacSuperEnabled( bool enabled ) -{ - Refresh(FALSE) ; - wxWindow::MacSuperEnabled( enabled ) ; -} - -void wxControl::MacSuperShown( bool show ) -{ - if ( (ControlHandle) m_macControl ) - { - if ( !show ) - { - if ( m_macControlIsShown ) - { - ::UMAHideControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = false ; - } - } - else - { - if ( MacIsReallyShown() && !m_macControlIsShown ) - { - ::UMAShowControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = true ; - } - } - } - - wxWindow::MacSuperShown( show ) ; -} - -void wxControl::DoSetSize(int x, int y, - int width, int height, - int sizeFlags ) -{ - wxWindow::DoSetSize( x , y ,width , height ,sizeFlags ) ; -#if 0 - { - Rect meta , control ; - GetControlBounds( (ControlHandle) m_macControl , &control ) ; - RgnHandle rgn = NewRgn() ; - GetControlRegion( (ControlHandle) m_macControl , kControlStructureMetaPart , rgn ) ; - GetRegionBounds( rgn , &meta ) ; - if ( !EmptyRect( &meta ) ) - { - wxASSERT( meta.left >= control.left - m_macHorizontalBorder ) ; - wxASSERT( meta.right <= control.right + m_macHorizontalBorder ) ; - wxASSERT( meta.top >= control.top - m_macVerticalBorder ) ; - wxASSERT( meta.bottom <= control.bottom + m_macVerticalBorder ) ; - } - DisposeRgn( rgn ) ; - } -#endif - return ; -} - -bool wxControl::Show(bool show) -{ - if ( !wxWindow::Show( show ) ) - return FALSE ; - - if ( (ControlHandle) m_macControl ) - { - if ( !show ) - { - if ( m_macControlIsShown ) - { - ::UMAHideControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = false ; - } - } - else - { - if ( MacIsReallyShown() && !m_macControlIsShown ) - { - ::UMAShowControl( (ControlHandle) m_macControl ) ; - m_macControlIsShown = true ; - } - } - } - return TRUE ; -} - -bool wxControl::Enable(bool enable) -{ - if ( !wxWindow::Enable(enable) ) - return FALSE; - - if ( (ControlHandle) m_macControl ) - { - if ( enable ) - UMAActivateControl( (ControlHandle) m_macControl ) ; - else - UMADeactivateControl( (ControlHandle) m_macControl ) ; - } - return TRUE ; -} - -void wxControl::Refresh(bool eraseBack, const wxRect *rect) -{ - wxWindow::Refresh( eraseBack , rect ) ; -} - -void wxControl::MacRedrawControl() -{ - if ( (ControlHandle) m_macControl && MacGetRootWindow() && m_macControlIsShown ) - { - wxClientDC dc(this) ; - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - UMADrawControl( (ControlHandle) m_macControl ) ; - } -} - -void wxControl::OnPaint(wxPaintEvent& event) -{ - if ( (ControlHandle) m_macControl ) - { - wxPaintDC dc(this) ; - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - UMADrawControl( (ControlHandle) m_macControl ) ; - } - else - { - event.Skip() ; - } -} -void wxControl::OnEraseBackground(wxEraseEvent& event) -{ - wxWindow::OnEraseBackground( event ) ; -} - -void wxControl::OnKeyDown( wxKeyEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - -#if TARGET_CARBON - - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - - GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( (EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter((EventRef) wxTheApp->MacGetCurrentEvent(), kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - - ::HandleControlKey( (ControlHandle) m_macControl , keyCode , charCode , modifiers ) ; - -#else - EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; -#endif -} - -void wxControl::OnMouseEvent( wxMouseEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - { - event.Skip() ; - return ; - } - - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - { - control = (ControlHandle) m_macControl ; - if ( control && ::IsControlActive( control ) ) - { - { - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; - wxTheApp->s_lastMouseDown = 0 ; - if ( control && controlpart != kControlNoPart ) - { - MacHandleControlClick( control , controlpart , false /* mouse not down anymore */ ) ; - } - } - } - } - } - else - { - event.Skip() ; - } -} - -bool wxControl::MacCanFocus() const -{ - if ( (ControlHandle) m_macControl == NULL ) - return true ; - else - return false ; -} - -void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; -} - -void wxControl::DoSetWindowVariant( wxWindowVariant variant ) -{ - if ( m_macControl == NULL ) - { - wxWindow::SetWindowVariant( variant ) ; - return ; - - } - m_windowVariant = variant ; - - ControlSize size ; - ControlFontStyleRec fontStyle; - fontStyle.flags = kControlUseFontMask ; - - // we will get that from the settings later - // and make this NORMAL later, but first - // we have a few calculations that we must fix - - if ( variant == wxWINDOW_VARIANT_DEFAULT ) - { - if ( IsKindOf( CLASSINFO( wxScrollBar ) ) ) - variant = wxWINDOW_VARIANT_NORMAL ; - else - variant = wxWINDOW_VARIANT_SMALL ; - } - - switch ( variant ) - { - case wxWINDOW_VARIANT_NORMAL : - size = kControlSizeNormal; - fontStyle.font = kControlFontBigSystemFont; - break ; - case wxWINDOW_VARIANT_SMALL : - size = kControlSizeSmall; - fontStyle.font = kControlFontSmallSystemFont; - break ; - case wxWINDOW_VARIANT_MINI : - if (UMAGetSystemVersion() >= 0x1030 ) - { - size = 3 ; // not always defined in the header - fontStyle.font = -5 ; // not always defined in the header - } - else - { - size = kControlSizeSmall; - fontStyle.font = kControlFontSmallSystemFont; - } - break; - break ; - case wxWINDOW_VARIANT_LARGE : - size = kControlSizeLarge; - fontStyle.font = kControlFontBigSystemFont; - break ; - default: - wxFAIL_MSG(_T("unexpected window variant")); - break ; - } - ::SetControlData( (ControlHandle) m_macControl , kControlEntireControl, kControlSizeTag, sizeof( ControlSize ), &size ); - ::SetControlFontStyle( (ControlHandle) m_macControl , &fontStyle ); -} diff --git a/src/mac/classic/corersrc.r b/src/mac/classic/corersrc.r deleted file mode 100644 index 676a4d3d2a..0000000000 --- a/src/mac/classic/corersrc.r +++ /dev/null @@ -1,159 +0,0 @@ -#ifdef __UNIX__ - #include -#else - #include - #if UNIVERSAL_INTERFACES_VERSION > 0x320 - #include - #endif -#endif - -resource 'ldes' ( 128 ) -{ - versionZero - { - 0 , - 0 , - 0 , - 0 , - hasVertScroll , - noHorizScroll , - 0 , - noGrowSpace , - } -} ; - -resource 'ldes' ( 129 ) -{ - versionZero - { - 0 , - 0 , - 0 , - 0 , - hasVertScroll , - hasHorizScroll , - 0 , - noGrowSpace , - } -} ; - -data 'CURS' (10) { - $"0000 03E0 0630 0808 1004 31C6 2362 2222" - $"2362 31C6 1004 0808 0630 03E0 0000 0000" - $"0000 03E0 07F0 0FF8 1FFC 3FFE 3FFE 3FFE" - $"3FFE 3FFE 1FFC 0FF8 07F0 03E0 0000 0000" - $"0007 0008" -}; - -data 'CURS' (11) { - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000 0000 0000 0000 0000 0000 0000" - $"0000 0000" -}; - -data 'CURS' (12) { - $"00F0 0088 0108 0190 0270 0220 0440 0440" - $"0880 0880 1100 1E00 1C00 1800 1000 0000" - $"00F0 00F8 01F8 01F0 03F0 03E0 07C0 07C0" - $"0F80 0F80 1F00 1E00 1C00 1800 1000 0000" - $"000E 0003" -}; - -data 'CURS' (13) { - $"0000 1E00 2100 4080 4080 4080 4080 2180" - $"1FC0 00E0 0070 0038 001C 000E 0006 0000" - $"3F00 7F80 FFC0 FFC0 FFC0 FFC0 FFC0 7FC0" - $"3FE0 1FF0 00F8 007C 003E 001F 000F 0007" - $"0004 0004" -}; - -data 'CURS' (14) { - $"0000 07E0 1FF0 3838 3C0C 6E0E 6706 6386" - $"61C6 60E6 7076 303C 1C1C 0FF8 07E0 0000" - $"0540 0FF0 3FF8 3C3C 7E0E FF0F 6F86 E7C7" - $"63E6 E1F7 70FE 707E 3C3C 1FFC 0FF0 0540" - $"0007 0007" -}; - -data 'CURS' (15) { - $"0000 0380 0380 0380 0380 0380 0380 0FE0" - $"1FF0 1FF0 0000 1FF0 1FF0 1550 1550 1550" - $"07C0 07C0 07C0 07C0 07C0 07C0 0FE0 1FF0" - $"3FF8 3FF8 3FF8 3FF8 3FF8 3FF8 3FF8 3FF8" - $"000B 0007" -}; - -data 'CURS' (16) { - $"00C0 0140 0640 08C0 3180 47FE 8001 8001" - $"81FE 8040 01C0 0040 03C0 C080 3F80 0000" - $"00C0 01C0 07C0 0FC0 3F80 7FFE FFFF FFFF" - $"FFFE FFC0 FFC0 FFC0 FFC0 FF80 3F80 0000" - $"0006 000F" -}; - -data 'CURS' (17) { - $"0100 0280 0260 0310 018C 7FE3 8000 8000" - $"7F80 0200 0380 0200 03C0 0107 01F8 0000" - $"0100 0380 03E0 03F0 01FC 7FFF FFFF FFFF" - $"FFFF 03FF 03FF 03FF 03FF 01FF 01F8 0000" - $"0006 0000" -}; - -data 'CURS' (18) { - $"0000 4078 60FC 71CE 7986 7C06 7E0E 7F1C" - $"7FB8 7C30 6C30 4600 0630 0330 0300 0000" - $"C078 E0FC F1FE FBFF FFCF FF8F FF1F FFBE" - $"FFFC FE78 FF78 EFF8 CFF8 87F8 07F8 0300" - $"0001 0001" -}; - -data 'CURS' (19) { - $"0000 0002 0006 000E 001E 003E 007E 00FE" - $"01FE 003E 0036 0062 0060 00C0 00C0 0000" - $"0003 0007 000F 001F 003F 007F 00FF 01FF" - $"03FF 07FF 007F 00F7 00F3 01E1 01E0 01C0" - $"0001 000E" -}; - -data 'CURS' (20) { - $"0000 0080 01C0 03E0 0080 0080 0080 1FFC" - $"1FFC 0080 0080 0080 03E0 01C0 0080 0000" - $"0080 01C0 03E0 07F0 0FF8 01C0 3FFE 3FFE" - $"3FFE 3FFE 01C0 0FF8 07F0 03E0 01C0 0080" - $"0007 0008" -}; - -data 'CURS' (21) { - $"0000 0080 01C0 03E0 0080 0888 188C 3FFE" - $"188C 0888 0080 03E0 01C0 0080 0000 0000" - $"0080 01C0 03E0 07F0 0BE8 1DDC 3FFE 7FFF" - $"3FFE 1DDC 0BE8 07F0 03E0 01C0 0080 0000" - $"0007 0008" -}; - -data 'CURS' (22) { - $"0000 001E 000E 060E 0712 03A0 01C0 00E0" - $"0170 1238 1C18 1C00 1E00 0000 0000 0000" - $"007F 003F 0E1F 0F0F 0F97 07E3 03E1 21F0" - $"31F8 3A7C 3C3C 3E1C 3F00 3F80 0000 0000" - $"0006 0009" -}; - -data 'CURS' (23) { - $"0000 7800 7000 7060 48E0 05C0 0380 0700" - $"0E80 1C48 1838 0038 0078 0000 0000 0000" - $"FE00 FC00 F870 F0F0 E9F0 C7E0 87C0 0F84" - $"1F8C 3E5C 3C3C 387C 00FC 01FC 0000 0000" - $"0006 0006" -}; - -data 'CURS' (24) { - $"0006 000E 001C 0018 0020 0040 00F8 0004" - $"1FF4 200C 2AA8 1FF0 1F80 3800 6000 8000" - $"000F 001F 003E 007C 0070 00E0 01FC 3FF6" - $"7FF6 7FFE 7FFC 7FF8 3FF0 7FC0 F800 E000" - $"000A 0006" -}; - diff --git a/src/mac/classic/cursor.cpp b/src/mac/classic/cursor.cpp deleted file mode 100644 index b780a675c9..0000000000 --- a/src/mac/classic/cursor.cpp +++ /dev/null @@ -1,505 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp -// Purpose: wxCursor class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "cursor.h" -#endif - -#include "wx/defs.h" - -#include "wx/app.h" -#include "wx/cursor.h" -#include "wx/icon.h" -#include "wx/image.h" -#include "wx/xpmdecod.h" - -#include "wx/mac/private.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) -#endif - -const short kwxCursorBullseye = 10 ; -const short kwxCursorBlank = 11 ; -const short kwxCursorPencil = 12 ; -const short kwxCursorMagnifier = 13 ; -const short kwxCursorNoEntry = 14 ; -const short kwxCursorPaintBrush = 15 ; -const short kwxCursorPointRight = 16 ; -const short kwxCursorPointLeft = 17 ; -const short kwxCursorQuestionArrow = 18 ; -const short kwxCursorRightArrow = 19 ; -const short kwxCursorSizeNS = 20 ; -const short kwxCursorSize = 21 ; -const short kwxCursorSizeNESW = 22 ; -const short kwxCursorSizeNWSE = 23 ; -const short kwxCursorRoller = 24 ; - -wxCursor gMacCurrentCursor ; - -wxCursorRefData::wxCursorRefData() -{ - m_width = 16; - m_height = 16; - m_hCursor = NULL ; - m_disposeHandle = false ; - m_releaseHandle = false ; - m_isColorCursor = false ; - m_themeCursor = -1 ; -} - -wxCursorRefData::~wxCursorRefData() -{ - if ( m_isColorCursor ) - { - ::DisposeCCursor( (CCrsrHandle) m_hCursor ) ; - } - else if ( m_disposeHandle ) - { - ::DisposeHandle( (Handle ) m_hCursor ) ; - } - else if ( m_releaseHandle ) - { - // we don't release the resource since it may already - // be in use again - } -} - -// Cursors -wxCursor::wxCursor() -{ -} - -wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height), - int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[]) -{ -} - -wxCursor::wxCursor( const wxImage &image ) -{ - CreateFromImage( image ) ; -} - -wxCursor::wxCursor(const char **bits) -{ - (void) CreateFromXpm(bits); -} - -wxCursor::wxCursor(char **bits) -{ - (void) CreateFromXpm((const char **)bits); -} - -bool wxCursor::CreateFromXpm(const char **bits) -{ - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") ) - wxXPMDecoder decoder; - wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") ) - CreateFromImage( img ) ; - return TRUE; -} - -short GetCTabIndex( CTabHandle colors , RGBColor *col ) -{ - short retval = 0 ; - unsigned long bestdiff = 0xFFFF ; - for ( int i = 0 ; i < (**colors).ctSize ; ++i ) - { - unsigned long diff = abs(col->red - (**colors).ctTable[i].rgb.red ) + - abs(col->green - (**colors).ctTable[i].rgb.green ) + - abs(col->blue - (**colors).ctTable[i].rgb.blue ) ; - if ( diff < bestdiff ) - { - bestdiff = diff ; - retval = (**colors).ctTable[i].value ; - } - } - return retval ; -} - -void wxCursor::CreateFromImage(const wxImage & image) -{ - m_refData = new wxCursorRefData; - - wxImage image16 = image.Scale(16,16) ; - unsigned char * rgbBits = image16.GetData(); - - - int w = image16.GetWidth() ; - int h = image16.GetHeight() ; - bool bHasMask = image16.HasMask() ; - - int hotSpotX = image16.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X); - int hotSpotY = image16.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y); - if (hotSpotX < 0 || hotSpotX >= w) - hotSpotX = 0; - if (hotSpotY < 0 || hotSpotY >= h) - hotSpotY = 0; - -#if 0 - // monochrome implementation - M_CURSORDATA->m_hCursor = NewHandle( sizeof( Cursor ) ) ; - M_CURSORDATA->m_disposeHandle = true ; - HLock( (Handle) M_CURSORDATA->m_hCursor ) ; - CursPtr cp = *(CursHandle)M_CURSORDATA->m_hCursor ; - memset( cp->data , 0 , sizeof( Bits16 ) ) ; - memset( cp->mask , 0 , sizeof( Bits16 ) ) ; - - unsigned char mr = image16.GetMaskRed() ; - unsigned char mg = image16.GetMaskGreen() ; - unsigned char mb = image16.GetMaskBlue() ; - for ( int y = 0 ; y < h ; ++y ) - { - short rowbits = 0 ; - short maskbits = 0 ; - - for ( int x = 0 ; x < w ; ++x ) - { - long pos = (y * w + x) * 3; - - unsigned char r = rgbBits[pos] ; - unsigned char g = rgbBits[pos+1] ; - unsigned char b = rgbBits[pos+2] ; - if ( bHasMask && r==mr && g==mg && b==mb ) - { - // masked area, does not appear anywhere - } - else - { - if ( (int)r + (int)g + (int)b < 0x0200 ) - { - rowbits |= ( 1 << (15-x) ) ; - } - maskbits |= ( 1 << (15-x) ) ; - } - } - cp->data[y] = rowbits ; - cp->mask[y] = maskbits ; - } - if ( !bHasMask ) - { - memcpy( cp->mask , cp->data , sizeof( Bits16) ) ; - } - cp->hotSpot.h = hotSpotX ; - cp->hotSpot.v = hotSpotY ; - HUnlock( (Handle) M_CURSORDATA->m_hCursor ) ; -#else - PixMapHandle pm = (PixMapHandle) NewHandleClear( sizeof (PixMap)) ; - short extent = 16 ; - short bytesPerPixel = 1 ; - short depth = 8 ; - Rect bounds = { 0 , 0 , extent , extent } ; - CCrsrHandle ch = (CCrsrHandle) NewHandleClear ( sizeof( CCrsr ) ) ; - CTabHandle newColors = GetCTable( 8 ) ; - HandToHand((Handle *) &newColors); - // set the values to the indices - for ( int i = 0 ; i < (**newColors).ctSize ; ++i ) - { - (**newColors).ctTable[i].value = i ; - } - HLock( (Handle) ch) ; - (**ch).crsrType = 0x8001 ; // color cursors - (**ch).crsrMap = pm ; - short bytesPerRow = bytesPerPixel * extent ; - - (**pm).baseAddr = 0; - (**pm).rowBytes = bytesPerRow | 0x8000; - (**pm).bounds = bounds; - (**pm).pmVersion = 0; - (**pm).packType = 0; - (**pm).packSize = 0; - (**pm).hRes = 0x00480000; /* 72 DPI default res */ - (**pm).vRes = 0x00480000; /* 72 DPI default res */ - (**pm).pixelSize = depth; - (**pm).pixelType = 0; - (**pm).cmpCount = 1; - (**pm).cmpSize = depth; - (**pm).pmTable = newColors; - - (**ch).crsrData = NewHandleClear( extent * bytesPerRow ) ; - (**ch).crsrXData = NULL ; - (**ch).crsrXValid = 0; - (**ch).crsrXHandle = NULL; - - (**ch).crsrHotSpot.h = hotSpotX ; - (**ch).crsrHotSpot.v = hotSpotY ; - (**ch).crsrXTable = NULL ; - (**ch).crsrID = GetCTSeed() ; - - memset( (**ch).crsr1Data , 0 , sizeof( Bits16 ) ) ; - memset( (**ch).crsrMask , 0 , sizeof( Bits16 ) ) ; - - unsigned char mr = image16.GetMaskRed() ; - unsigned char mg = image16.GetMaskGreen() ; - unsigned char mb = image16.GetMaskBlue() ; - for ( int y = 0 ; y < h ; ++y ) - { - short rowbits = 0 ; - short maskbits = 0 ; - - for ( int x = 0 ; x < w ; ++x ) - { - long pos = (y * w + x) * 3; - - unsigned char r = rgbBits[pos] ; - unsigned char g = rgbBits[pos+1] ; - unsigned char b = rgbBits[pos+2] ; - RGBColor col = { 0xFFFF ,0xFFFF, 0xFFFF } ; - - if ( bHasMask && r==mr && g==mg && b==mb ) - { - // masked area, does not appear anywhere - } - else - { - if ( (int)r + (int)g + (int)b < 0x0200 ) - { - rowbits |= ( 1 << (15-x) ) ; - } - maskbits |= ( 1 << (15-x) ) ; - - col = *((RGBColor*) wxColor( r , g , b ).GetPixel()) ; - } - *((*(**ch).crsrData) + y * bytesPerRow + x) = - GetCTabIndex( newColors , &col) ; - } - (**ch).crsr1Data[y] = rowbits ; - (**ch).crsrMask[y] = maskbits ; - } - if ( !bHasMask ) - { - memcpy( (**ch).crsrMask , (**ch).crsr1Data , sizeof( Bits16) ) ; - } - - HUnlock((Handle) ch) ; - M_CURSORDATA->m_hCursor = ch ; - M_CURSORDATA->m_isColorCursor = true ; -#endif -} - -wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY) -{ - m_refData = new wxCursorRefData; - if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE ) - { - Str255 theName ; - wxMacStringToPascal( cursor_file , theName ) ; - - wxStAppResource resload ; - Handle resHandle = ::GetNamedResource( 'crsr' , theName ) ; - if ( resHandle ) - { - short theId = -1 ; - OSType theType ; - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - M_CURSORDATA->m_hCursor = GetCCursor( theId ) ; - if ( M_CURSORDATA->m_hCursor ) - M_CURSORDATA->m_isColorCursor = true ; - } - else - { - Handle resHandle = ::GetNamedResource( 'CURS' , theName ) ; - if ( resHandle ) - { - short theId = -1 ; - OSType theType ; - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - M_CURSORDATA->m_hCursor = GetCursor( theId ) ; - if ( M_CURSORDATA->m_hCursor ) - M_CURSORDATA->m_releaseHandle = true ; - } - } - } - else - { - wxImage image ; - image.LoadFile( cursor_file , flags ) ; - if( image.Ok() ) - { - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,hotSpotX ) ; - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y,hotSpotY ) ; - delete m_refData ; - CreateFromImage(image) ; - } - } -} - -// Cursors by stock number -wxCursor::wxCursor(int cursor_type) -{ - m_refData = new wxCursorRefData; - - switch (cursor_type) - { - case wxCURSOR_COPY_ARROW: - M_CURSORDATA->m_themeCursor = kThemeCopyArrowCursor ; - break; - case wxCURSOR_WAIT: - M_CURSORDATA->m_themeCursor = kThemeWatchCursor ; - break; - case wxCURSOR_IBEAM: - M_CURSORDATA->m_themeCursor = kThemeIBeamCursor ; - break; - case wxCURSOR_CROSS: - M_CURSORDATA->m_themeCursor = kThemeCrossCursor; - break; - case wxCURSOR_SIZENWSE: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNWSE); - } - break; - case wxCURSOR_SIZENESW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNESW); - } - break; - case wxCURSOR_SIZEWE: - { - M_CURSORDATA->m_themeCursor = kThemeResizeLeftRightCursor; - } - break; - case wxCURSOR_SIZENS: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNS); - } - break; - case wxCURSOR_SIZING: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSize); - } - break; - case wxCURSOR_HAND: - { - M_CURSORDATA->m_themeCursor = kThemePointingHandCursor; - } - break; - case wxCURSOR_BULLSEYE: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorBullseye); - } - break; - case wxCURSOR_PENCIL: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPencil); - } - break; - case wxCURSOR_MAGNIFIER: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorMagnifier); - } - break; - case wxCURSOR_NO_ENTRY: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorNoEntry); - } - break; - case wxCURSOR_WATCH: - { - M_CURSORDATA->m_themeCursor = kThemeWatchCursor; - break; - } - case wxCURSOR_PAINT_BRUSH: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPaintBrush); - break; - } - case wxCURSOR_POINT_LEFT: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPointLeft); - break; - } - case wxCURSOR_POINT_RIGHT: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorPointRight); - break; - } - case wxCURSOR_QUESTION_ARROW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorQuestionArrow); - break; - } - case wxCURSOR_BLANK: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorBlank); - break; - } - case wxCURSOR_RIGHT_ARROW: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorRightArrow); - break; - } - case wxCURSOR_SPRAYCAN: - { - wxStAppResource resload ; - M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorRoller); - break; - } - case wxCURSOR_CHAR: - case wxCURSOR_ARROW: - case wxCURSOR_LEFT_BUTTON: - case wxCURSOR_RIGHT_BUTTON: - case wxCURSOR_MIDDLE_BUTTON: - default: - M_CURSORDATA->m_themeCursor = kThemeArrowCursor ; - break; - } - if ( M_CURSORDATA->m_themeCursor == -1 ) - M_CURSORDATA->m_releaseHandle = true ; -} - -void wxCursor::MacInstall() const -{ - gMacCurrentCursor = *this ; - if ( m_refData && M_CURSORDATA->m_themeCursor != -1 ) - { - SetThemeCursor( M_CURSORDATA->m_themeCursor ) ; - } - else if ( m_refData && M_CURSORDATA->m_hCursor ) - { - if ( M_CURSORDATA->m_isColorCursor ) - ::SetCCursor( (CCrsrHandle) M_CURSORDATA->m_hCursor ) ; - else - ::SetCursor( * (CursHandle) M_CURSORDATA->m_hCursor ) ; - } - else - { - SetThemeCursor( kThemeArrowCursor ) ; - } -} - -wxCursor::~wxCursor() -{ -} - -// Global cursor setting -void wxSetCursor(const wxCursor& cursor) -{ - cursor.MacInstall() ; -} - - diff --git a/src/mac/classic/data.cpp b/src/mac/classic/data.cpp deleted file mode 100644 index 1f0bea00d2..0000000000 --- a/src/mac/classic/data.cpp +++ /dev/null @@ -1,25 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/data.cpp -// Purpose: Various global Mac-specific data -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/event.h" - -#if wxUSE_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 -const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; } - -const wxEventTable wxEvtHandler::sm_eventTable = - { NULL, &wxEvtHandler::sm_eventTableEntries[0] }; - -const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } }; -#endif - diff --git a/src/mac/classic/dataobj.cpp b/src/mac/classic/dataobj.cpp deleted file mode 100644 index 64dc8053d0..0000000000 --- a/src/mac/classic/dataobj.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.cpp -// Purpose: implementation of wxDataObject class -// Author: Stefan Csomor -// Modified by: -// Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifndef WX_PRECOMP -#include "wx/intl.h" -#endif -#include "wx/defs.h" - -#include "wx/log.h" -#include "wx/dataobj.h" -#include "wx/mstream.h" -#include "wx/image.h" -#include "wx/mac/private.h" -#include - -// ---------------------------------------------------------------------------- -// functions -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// wxDataFormat -// ---------------------------------------------------------------------------- - -wxDataFormat::wxDataFormat() -{ - m_type = wxDF_INVALID; - m_format = 0; -} - -wxDataFormat::wxDataFormat( wxDataFormatId vType ) -{ - SetType(vType); -} - -wxDataFormat::wxDataFormat( const wxChar* zId) -{ - SetId(zId); -} - -wxDataFormat::wxDataFormat( const wxString& rId) -{ - SetId(rId); -} - -wxDataFormat::wxDataFormat( NativeFormat vFormat) -{ - SetId(vFormat); -} - -void wxDataFormat::SetType( wxDataFormatId Type ) -{ - m_type = Type; - - if (m_type == wxDF_TEXT ) - m_format = kScrapFlavorTypeText; - else if (m_type == wxDF_UNICODETEXT ) - m_format = kScrapFlavorTypeUnicode ; - else if (m_type == wxDF_BITMAP || m_type == wxDF_METAFILE ) - m_format = kScrapFlavorTypePicture; - else if (m_type == wxDF_FILENAME) - m_format = kDragFlavorTypeHFS ; - else - { - wxFAIL_MSG( wxT("invalid dataformat") ); - - // this is '????' but it can't be used in the code because ??' is - // parsed as a trigraph! - m_format = 0x3f3f3f3f; - } -} - -wxString wxDataFormat::GetId() const -{ - // note that m_format is not a pointer to string, it *is* itself a 4 - // character string - char text[5] ; - strncpy( text , (char*) &m_format , 4 ) ; - text[4] = 0 ; - - return wxString::FromAscii( text ) ; -} - -void wxDataFormat::SetId( NativeFormat format ) -{ - m_format = format; - - if (m_format == kScrapFlavorTypeText) - m_type = wxDF_TEXT; - else if (m_format == kScrapFlavorTypeUnicode ) - m_type = wxDF_UNICODETEXT; - else if (m_format == kScrapFlavorTypePicture) - m_type = wxDF_BITMAP; - else if (m_format == kDragFlavorTypeHFS ) - m_type = wxDF_FILENAME; - else - m_type = wxDF_PRIVATE; -} - -void wxDataFormat::SetId( const wxChar* zId ) -{ - m_type = wxDF_PRIVATE; - m_format = 0;// TODO: get the format gdk_atom_intern( wxMBSTRINGCAST tmp.mbc_str(), FALSE ); -} - -//------------------------------------------------------------------------- -// wxDataObject -//------------------------------------------------------------------------- - -wxDataObject::wxDataObject() -{ -} - -bool wxDataObject::IsSupportedFormat( - const wxDataFormat& rFormat -, Direction vDir -) const -{ - size_t nFormatCount = GetFormatCount(vDir); - - if (nFormatCount == 1) - { - return rFormat == GetPreferredFormat(); - } - else - { - wxDataFormat* pFormats = new wxDataFormat[nFormatCount]; - GetAllFormats( pFormats - ,vDir - ); - - size_t n; - - for (n = 0; n < nFormatCount; n++) - { - if (pFormats[n] == rFormat) - break; - } - - delete [] pFormats; - - // found? - return n < nFormatCount; - } -} - -// ---------------------------------------------------------------------------- -// wxFileDataObject -// ---------------------------------------------------------------------------- - -bool wxFileDataObject::GetDataHere( - void* pBuf -) const -{ - wxString sFilenames; - - for (size_t i = 0; i < m_filenames.GetCount(); i++) - { - sFilenames += m_filenames[i]; - sFilenames += (wxChar)0; - } - - memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1); - return TRUE; -} - -size_t wxFileDataObject::GetDataSize() const -{ - size_t nRes = 0; - - for (size_t i = 0; i < m_filenames.GetCount(); i++) - { - nRes += m_filenames[i].Len(); - nRes += 1; - } - - return nRes + 1; -} - -bool wxFileDataObject::SetData( - size_t WXUNUSED(nSize) -, const void* pBuf -) -{ - m_filenames.Empty(); - - AddFile(wxString::FromAscii((char*)pBuf)); - - return TRUE; -} - -void wxFileDataObject::AddFile( - const wxString& rFilename -) -{ - m_filenames.Add(rFilename); -} - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject -// ---------------------------------------------------------------------------- - -wxBitmapDataObject::wxBitmapDataObject() -{ - Init(); -} - -wxBitmapDataObject::wxBitmapDataObject( - const wxBitmap& rBitmap -) -: wxBitmapDataObjectBase(rBitmap) -{ - Init(); - if ( m_bitmap.Ok() ) - { - m_pictHandle = m_bitmap.GetPict( &m_pictCreated ) ; - } -} - -wxBitmapDataObject::~wxBitmapDataObject() -{ - Clear(); -} - -void wxBitmapDataObject::SetBitmap( - const wxBitmap& rBitmap -) -{ - Clear(); - wxBitmapDataObjectBase::SetBitmap(rBitmap); - if ( m_bitmap.Ok() ) - { - m_pictHandle = m_bitmap.GetPict( &m_pictCreated ) ; - } -} - -void wxBitmapDataObject::Init() -{ - m_pictHandle = NULL ; - m_pictCreated = false ; -} - -void wxBitmapDataObject::Clear() -{ - if ( m_pictCreated && m_pictHandle ) - { - KillPicture( (PicHandle) m_pictHandle ) ; - } - m_pictHandle = NULL ; -} - -bool wxBitmapDataObject::GetDataHere( - void* pBuf -) const -{ - if (!m_pictHandle) - { - wxFAIL_MSG(wxT("attempt to copy empty bitmap failed")); - return FALSE; - } - memcpy(pBuf, *(Handle)m_pictHandle, GetHandleSize((Handle)m_pictHandle)); - return TRUE; -} - -size_t wxBitmapDataObject::GetDataSize() const -{ - return GetHandleSize((Handle)m_pictHandle) ; -} - -bool wxBitmapDataObject::SetData( - size_t nSize -, const void* pBuf -) -{ - Clear(); - PicHandle picHandle = (PicHandle) NewHandle( nSize ) ; - memcpy( *picHandle , pBuf , nSize ) ; - m_pictHandle = picHandle ; - m_pictCreated = false ; - Rect frame = (**picHandle).picFrame ; - - m_bitmap.SetPict( picHandle ) ; - m_bitmap.SetWidth( frame.right - frame.left ) ; - m_bitmap.SetHeight( frame.bottom - frame.top ) ; - return m_bitmap.Ok(); -} diff --git a/src/mac/classic/dc.cpp b/src/mac/classic/dc.cpp deleted file mode 100644 index d906bac5a4..0000000000 --- a/src/mac/classic/dc.cpp +++ /dev/null @@ -1,2297 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.cpp -// Purpose: wxDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dc.h" -#endif - -#include "wx/dc.h" -#include "wx/app.h" -#include "wx/mac/uma.h" -#include "wx/dcmemory.h" -#include "wx/dcprint.h" -#include "wx/region.h" -#include "wx/image.h" -#include "wx/log.h" - -#if __MSL__ >= 0x6000 -#include "math.h" -using namespace std ; -#endif - -#include "wx/mac/private.h" -#include -#include -#include -#include -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) -#endif - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define mm2inches 0.0393700787402 -#define inches2mm 25.4 -#define mm2twips 56.6929133859 -#define twips2mm 0.0176388888889 -#define mm2pt 2.83464566929 -#define pt2mm 0.352777777778 -#if !defined( __DARWIN__ ) || defined(__MWERKS__) -#ifndef M_PI -const double M_PI = 3.14159265358979 ; -#endif -#endif -const double RAD2DEG = 180.0 / M_PI; -const short kEmulatedMode = -1 ; -const short kUnsupportedMode = -2 ; - -extern TECObjectRef s_TECNativeCToUnicode ; - -// set to 0 if problems arise -#define wxMAC_EXPERIMENTAL_DC 1 - -wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) : - m_ph( (GrafPtr) dc->m_macPort ) -{ - wxASSERT( dc->Ok() ) ; - m_dc = dc ; - dc->MacSetupPort(&m_ph) ; -} -wxMacPortSetter::~wxMacPortSetter() -{ - m_dc->MacCleanupPort(&m_ph) ; -} - -#if wxMAC_EXPERIMENTAL_DC -class wxMacFastPortSetter -{ -public : - wxMacFastPortSetter( const wxDC *dc ) - { - wxASSERT( dc->Ok() ) ; - GetPort( &m_oldPort ) ; - SetPort( (GrafPtr) dc->m_macPort ) ; - m_clipRgn = NewRgn() ; - GetClip( m_clipRgn ) ; - m_dc = dc ; - dc->MacSetupPort( NULL ) ; - } - ~wxMacFastPortSetter() - { - SetPort( (GrafPtr) m_dc->m_macPort ) ; - SetClip( m_clipRgn ) ; - SetPort( m_oldPort ) ; - m_dc->MacCleanupPort( NULL ) ; - DisposeRgn( m_clipRgn ) ; - } -private : - RgnHandle m_clipRgn ; - GrafPtr m_oldPort ; - const wxDC* m_dc ; -} ; - -#else -typedef wxMacPortSetter wxMacFastPortSetter ; -#endif - -#if 0 - -// start moving to a dual implementation for QD and CGContextRef - -class wxMacGraphicsContext -{ -public : - void DrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) = 0 ; - void SetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) = 0 ; - void SetClippingRegion( const wxRegion ®ion ) = 0 ; - void DestroyClippingRegion() = 0 ; - void SetTextForeground( const wxColour &col ) = 0 ; - void SetTextBackground( const wxColour &col ) = 0 ; - void SetLogicalScale( double x , double y ) = 0 ; - void SetUserScale( double x , double y ) = 0; -} ; - -class wxMacQuickDrawContext : public wxMacGraphicsContext -{ -public : -} ; - -#endif - -wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) -{ - m_formerClip = NewRgn() ; - m_newClip = NewRgn() ; - GetClip( m_formerClip ) ; - - if ( win ) - { -#if 0 - // this clipping area was set to the parent window's drawing area, lead to problems - // with MacOSX controls drawing outside their wx' rectangle - RgnHandle insidergn = NewRgn() ; - int x = 0 , y = 0; - wxWindow *parent = win->GetParent() ; - parent->MacWindowToRootWindow( &x,&y ) ; - wxSize size = parent->GetSize() ; - SetRectRgn( insidergn , parent->MacGetLeftBorderSize() , parent->MacGetTopBorderSize() , - size.x - parent->MacGetRightBorderSize(), - size.y - parent->MacGetBottomBorderSize()) ; - CopyRgn( (RgnHandle) parent->MacGetVisibleRegion(false).GetWXHRGN() , m_newClip ) ; - SectRgn( m_newClip , insidergn , m_newClip ) ; - OffsetRgn( m_newClip , x , y ) ; - SetClip( m_newClip ) ; - DisposeRgn( insidergn ) ; -#else - int x = 0 , y = 0; - win->MacWindowToRootWindow( &x,&y ) ; - CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion().GetWXHRGN() , m_newClip ) ; - OffsetRgn( m_newClip , x , y ) ; - SetClip( m_newClip ) ; -#endif - } -} - -wxMacWindowClipper::~wxMacWindowClipper() -{ - SetClip( m_formerClip ) ; - DisposeRgn( m_newClip ) ; - DisposeRgn( m_formerClip ) ; -} - -//----------------------------------------------------------------------------- -// Local functions -//----------------------------------------------------------------------------- -static inline double dmin(double a, double b) { return a < b ? a : b; } -static inline double dmax(double a, double b) { return a > b ? a : b; } -static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } - -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- -// this function emulates all wx colour manipulations, used to verify the implementation -// by setting the mode in the blitting functions to kEmulatedMode -void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ; - -void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) -{ - switch ( logical_func ) - { - case wxAND: // src AND dst - dstColor.red = dstColor.red & srcColor.red ; - dstColor.green = dstColor.green & srcColor.green ; - dstColor.blue = dstColor.blue & srcColor.blue ; - break ; - case wxAND_INVERT: // (NOT src) AND dst - dstColor.red = dstColor.red & ~srcColor.red ; - dstColor.green = dstColor.green & ~srcColor.green ; - dstColor.blue = dstColor.blue & ~srcColor.blue ; - break ; - case wxAND_REVERSE:// src AND (NOT dst) - dstColor.red = ~dstColor.red & srcColor.red ; - dstColor.green = ~dstColor.green & srcColor.green ; - dstColor.blue = ~dstColor.blue & srcColor.blue ; - break ; - case wxCLEAR: // 0 - dstColor.red = 0 ; - dstColor.green = 0 ; - dstColor.blue = 0 ; - break ; - case wxCOPY: // src - dstColor.red = srcColor.red ; - dstColor.green = srcColor.green ; - dstColor.blue = srcColor.blue ; - break ; - case wxEQUIV: // (NOT src) XOR dst - dstColor.red = dstColor.red ^ ~srcColor.red ; - dstColor.green = dstColor.green ^ ~srcColor.green ; - dstColor.blue = dstColor.blue ^ ~srcColor.blue ; - break ; - case wxINVERT: // NOT dst - dstColor.red = ~dstColor.red ; - dstColor.green = ~dstColor.green ; - dstColor.blue = ~dstColor.blue ; - break ; - case wxNAND: // (NOT src) OR (NOT dst) - dstColor.red = ~dstColor.red | ~srcColor.red ; - dstColor.green = ~dstColor.green | ~srcColor.green ; - dstColor.blue = ~dstColor.blue | ~srcColor.blue ; - break ; - case wxNOR: // (NOT src) AND (NOT dst) - dstColor.red = ~dstColor.red & ~srcColor.red ; - dstColor.green = ~dstColor.green & ~srcColor.green ; - dstColor.blue = ~dstColor.blue & ~srcColor.blue ; - break ; - case wxNO_OP: // dst - break ; - case wxOR: // src OR dst - dstColor.red = dstColor.red | srcColor.red ; - dstColor.green = dstColor.green | srcColor.green ; - dstColor.blue = dstColor.blue | srcColor.blue ; - break ; - case wxOR_INVERT: // (NOT src) OR dst - dstColor.red = dstColor.red | ~srcColor.red ; - dstColor.green = dstColor.green | ~srcColor.green ; - dstColor.blue = dstColor.blue | ~srcColor.blue ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - dstColor.red = ~dstColor.red | srcColor.red ; - dstColor.green = ~dstColor.green | srcColor.green ; - dstColor.blue = ~dstColor.blue | srcColor.blue ; - break ; - case wxSET: // 1 - dstColor.red = 0xFFFF ; - dstColor.green = 0xFFFF ; - dstColor.blue = 0xFFFF ; - break ; - case wxSRC_INVERT: // (NOT src) - dstColor.red = ~srcColor.red ; - dstColor.green = ~srcColor.green ; - dstColor.blue = ~srcColor.blue ; - break ; - case wxXOR: // src XOR dst - dstColor.red = dstColor.red ^ srcColor.red ; - dstColor.green = dstColor.green ^ srcColor.green ; - dstColor.blue = dstColor.blue ^ srcColor.blue ; - break ; - } -} - -wxDC::wxDC() -{ - m_ok = FALSE; - m_colour = TRUE; - m_mm_to_pix_x = mm2pt; - m_mm_to_pix_y = mm2pt; - m_internalDeviceOriginX = 0; - m_internalDeviceOriginY = 0; - m_externalDeviceOriginX = 0; - m_externalDeviceOriginY = 0; - m_logicalScaleX = 1.0; - m_logicalScaleY = 1.0; - m_userScaleX = 1.0; - m_userScaleY = 1.0; - m_scaleX = 1.0; - m_scaleY = 1.0; - m_needComputeScaleX = FALSE; - m_needComputeScaleY = FALSE; - m_macPort = NULL ; - m_macMask = NULL ; - m_ok = FALSE ; - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - m_macLocalOrigin.x = m_macLocalOrigin.y = 0 ; - m_macBoundaryClipRgn = NewRgn() ; - m_macCurrentClipRgn = NewRgn() ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , -32000 , -32000 , 32000 , 32000 ) ; - SetRectRgn( (RgnHandle) m_macCurrentClipRgn , -32000 , -32000 , 32000 , 32000 ) ; - m_pen = *wxBLACK_PEN; - m_font = *wxNORMAL_FONT; - m_brush = *wxWHITE_BRUSH; -#ifdef __WXDEBUG__ - // needed to debug possible errors with two active drawing methods at the same time on - // the same DC - m_macCurrentPortStateHelper = NULL ; -#endif - m_macATSUIStyle = NULL ; - m_macAliasWasEnabled = false; - m_macForegroundPixMap = NULL ; - m_macBackgroundPixMap = NULL ; -} - -wxDC::~wxDC(void) -{ - DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ; - DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ; -} - -void wxDC::MacSetupPort(wxMacPortStateHelper* help) const -{ -#ifdef __WXDEBUG__ - wxASSERT( m_macCurrentPortStateHelper == NULL ) ; - m_macCurrentPortStateHelper = help ; -#endif - SetClip( (RgnHandle) m_macCurrentClipRgn); -#if ! wxMAC_EXPERIMENTAL_DC - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; -#endif -} -void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const -{ -#ifdef __WXDEBUG__ - wxASSERT( m_macCurrentPortStateHelper == help ) ; - m_macCurrentPortStateHelper = NULL ; -#endif - if( m_macATSUIStyle ) - { - ::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle); - m_macATSUIStyle = NULL ; - } - if ( m_macAliasWasEnabled ) - { - SetAntiAliasedTextEnabled(m_macFormerAliasState, m_macFormerAliasSize); - m_macAliasWasEnabled = false ; - } - if ( m_macForegroundPixMap ) - { - Pattern blackColor ; - ::PenPat(GetQDGlobalsBlack(&blackColor)); - DisposePixPat( (PixPatHandle) m_macForegroundPixMap ) ; - m_macForegroundPixMap = NULL ; - } - if ( m_macBackgroundPixMap ) - { - Pattern whiteColor ; - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - DisposePixPat( (PixPatHandle) m_macBackgroundPixMap ) ; - m_macBackgroundPixMap = NULL ; - } -} - -void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord w = bmp.GetWidth(); - wxCoord h = bmp.GetHeight(); - wxCoord ww = XLOG2DEVREL(w); - wxCoord hh = YLOG2DEVREL(h); - // Set up drawing mode - short mode = (m_logicalFunction == wxCOPY ? srcCopy : - //m_logicalFunction == wxCLEAR ? WHITENESS : - //m_logicalFunction == wxSET ? BLACKNESS : - m_logicalFunction == wxINVERT ? hilite : - //m_logicalFunction == wxAND ? MERGECOPY : - m_logicalFunction == wxOR ? srcOr : - m_logicalFunction == wxSRC_INVERT ? notSrcCopy : - m_logicalFunction == wxXOR ? srcXor : - m_logicalFunction == wxOR_REVERSE ? notSrcOr : - //m_logicalFunction == wxAND_REVERSE ? SRCERASE : - //m_logicalFunction == wxSRC_OR ? srcOr : - //m_logicalFunction == wxSRC_AND ? SRCAND : - srcCopy ); - if ( bmp.GetBitmapType() == kMacBitmapTypePict ) { - Rect bitmaprect = { 0 , 0 , hh, ww }; - ::OffsetRect( &bitmaprect, xx, yy ) ; - ::DrawPicture( (PicHandle) bmp.GetPict(), &bitmaprect ) ; - } - else if ( bmp.GetBitmapType() == kMacBitmapTypeGrafWorld ) - { - GWorldPtr bmapworld = MAC_WXHBITMAP( bmp.GetHBITMAP() ); - PixMapHandle bmappixels ; - // Set foreground and background colours (for bitmaps depth = 1) - if(bmp.GetDepth() == 1) - { - RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel()); - RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()); - RGBForeColor(&fore); - RGBBackColor(&back); - } - else - { - RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ; - RGBColor black = { 0,0,0} ; - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - } - bmappixels = GetGWorldPixMap( bmapworld ) ; - wxCHECK_RET(LockPixels(bmappixels), - wxT("DoDrawBitmap: Unable to lock pixels")); - Rect source = { 0, 0, h, w }; - Rect dest = { yy, xx, yy + hh, xx + ww }; - if ( useMask && bmp.GetMask() ) - { - if( LockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap())))) - { - CopyDeepMask - ( - GetPortBitMapForCopyBits(bmapworld), - GetPortBitMapForCopyBits(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap())), - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ), - &source, &source, &dest, mode, NULL - ); - UnlockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap()))); - } - } - else { - CopyBits( GetPortBitMapForCopyBits( bmapworld ), - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ), - &source, &dest, mode, NULL ) ; - } - UnlockPixels( bmappixels ) ; - } - else if ( bmp.GetBitmapType() == kMacBitmapTypeIcon ) - { - Rect bitmaprect = { 0 , 0 , bmp.GetHeight(), bmp.GetWidth() } ; - OffsetRect( &bitmaprect, xx, yy ) ; - PlotCIconHandle( &bitmaprect , atNone , ttNone , MAC_WXHICON(bmp.GetHICON()) ) ; - } - m_macPenInstalled = false ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; -} - -void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) -{ - wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon")); - wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon")); - DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ; -} - -void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC")); - wxCoord xx, yy, ww, hh; - xx = XLOG2DEVMAC(x); - yy = YLOG2DEVMAC(y); - ww = XLOG2DEVREL(width); - hh = YLOG2DEVREL(height); - SetRectRgn( (RgnHandle) m_macCurrentClipRgn , xx , yy , xx + ww , yy + hh ) ; - SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - if( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1 , xx ); - m_clipY1 = wxMax( m_clipY1 , yy ); - m_clipX2 = wxMin( m_clipX2, (xx + ww)); - m_clipY2 = wxMin( m_clipY2, (yy + hh)); - } - else - { - m_clipping = TRUE; - m_clipX1 = xx; - m_clipY1 = yy; - m_clipX2 = xx + ww; - m_clipY2 = yy + hh; - } -} - -void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ) ; - if (region.Empty()) - { - DestroyClippingRegion(); - return; - } - wxMacFastPortSetter helper(this) ; - wxCoord x, y, w, h; - region.GetBox( x, y, w, h ); - wxCoord xx, yy, ww, hh; - xx = XLOG2DEVMAC(x); - yy = YLOG2DEVMAC(y); - ww = XLOG2DEVREL(w); - hh = YLOG2DEVREL(h); - // if we have a scaling that we cannot map onto native regions - // we must use the box - if ( ww != w || hh != h ) - { - wxDC::DoSetClippingRegion( x, y, w, h ); - } - else - { - CopyRgn( (RgnHandle) region.GetWXHRGN() , (RgnHandle) m_macCurrentClipRgn ) ; - if ( xx != x || yy != y ) - { - OffsetRgn( (RgnHandle) m_macCurrentClipRgn , xx - x , yy - y ) ; - } - SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - if( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1 , xx ); - m_clipY1 = wxMax( m_clipY1 , yy ); - m_clipX2 = wxMin( m_clipX2, (xx + ww)); - m_clipY2 = wxMin( m_clipY2, (yy + hh)); - } - else - { - m_clipping = TRUE; - m_clipX1 = xx; - m_clipY1 = yy; - m_clipX2 = xx + ww; - m_clipY2 = yy + hh; - } - } -} - -void wxDC::DestroyClippingRegion() -{ - wxMacFastPortSetter helper(this) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_clipping = FALSE; -} - -void wxDC::DoGetSizeMM( int* width, int* height ) const -{ - int w = 0; - int h = 0; - GetSize( &w, &h ); - *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) ); - *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) ); -} - -void wxDC::SetTextForeground( const wxColour &col ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - m_textForegroundColour = col; - m_macFontInstalled = false ; -} - -void wxDC::SetTextBackground( const wxColour &col ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - m_textBackgroundColour = col; - m_macFontInstalled = false ; -} - -void wxDC::SetMapMode( int mode ) -{ - switch (mode) - { - case wxMM_TWIPS: - SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y ); - break; - case wxMM_POINTS: - SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y ); - break; - case wxMM_METRIC: - SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y ); - break; - case wxMM_LOMETRIC: - SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 ); - break; - default: - case wxMM_TEXT: - SetLogicalScale( 1.0, 1.0 ); - break; - } - if (mode != wxMM_TEXT) - { - m_needComputeScaleX = TRUE; - m_needComputeScaleY = TRUE; - } -} - -void wxDC::SetUserScale( double x, double y ) -{ - // allow negative ? -> no - m_userScaleX = x; - m_userScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxDC::SetLogicalScale( double x, double y ) -{ - // allow negative ? - m_logicalScaleX = x; - m_logicalScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y ) -{ - m_logicalOriginX = x * m_signX; // is this still correct ? - m_logicalOriginY = y * m_signY; - ComputeScaleAndOrigin(); -} - -void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y ) -{ - m_externalDeviceOriginX = x; - m_externalDeviceOriginY = y; - ComputeScaleAndOrigin(); -} - -#if 0 -void wxDC::SetInternalDeviceOrigin( long x, long y ) -{ - m_internalDeviceOriginX = x; - m_internalDeviceOriginY = y; - ComputeScaleAndOrigin(); -} -void wxDC::GetInternalDeviceOrigin( long *x, long *y ) -{ - if (x) *x = m_internalDeviceOriginX; - if (y) *y = m_internalDeviceOriginY; -} -#endif - -void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) -{ - m_signX = (xLeftRight ? 1 : -1); - m_signY = (yBottomUp ? -1 : 1); - ComputeScaleAndOrigin(); -} - -wxSize wxDC::GetPPI() const -{ - return wxSize(72, 72); -} - -int wxDC::GetDepth() const -{ - if ( IsPortColor( (CGrafPtr) m_macPort ) ) - { - return ( (**GetPortPixMap( (CGrafPtr) m_macPort)).pixelSize ) ; - } - return 1 ; -} - -void wxDC::ComputeScaleAndOrigin() -{ - // CMB: copy scale to see if it changes - double origScaleX = m_scaleX; - double origScaleY = m_scaleY; - m_scaleX = m_logicalScaleX * m_userScaleX; - m_scaleY = m_logicalScaleY * m_userScaleY; - m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX; - m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY; - // CMB: if scale has changed call SetPen to recalulate the line width - if (m_scaleX != origScaleX || m_scaleY != origScaleY) - { - // this is a bit artificial, but we need to force wxDC to think - // the pen has changed - wxPen* pen = & GetPen(); - wxPen tempPen; - m_pen = tempPen; - SetPen(* pen); - } -} - -void wxDC::SetPalette( const wxPalette& palette ) -{ -} - -void wxDC::SetBackgroundMode( int mode ) -{ - m_backgroundMode = mode ; -} - -void wxDC::SetFont( const wxFont &font ) -{ - m_font = font; - m_macFontInstalled = false ; -} - -void wxDC::SetPen( const wxPen &pen ) -{ - if ( m_pen == pen ) - return ; - m_pen = pen; - m_macPenInstalled = false ; -} - -void wxDC::SetBrush( const wxBrush &brush ) -{ - if (m_brush == brush) - return; - m_brush = brush; - m_macBrushInstalled = false ; -} - -void wxDC::SetBackground( const wxBrush &brush ) -{ - if (m_backgroundBrush == brush) - return; - m_backgroundBrush = brush; - if (!m_backgroundBrush.Ok()) - return; - m_macBrushInstalled = false ; -} - -void wxDC::SetLogicalFunction( int function ) -{ - if (m_logicalFunction == function) - return; - m_logicalFunction = function ; - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; -} - -extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); - -bool wxDC::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) -{ - return wxDoFloodFill(this, x, y, col, style); -} - -bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const -{ - wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") ); - wxMacFastPortSetter helper(this) ; - RGBColor colour; - GetCPixel( XLOG2DEVMAC(x), YLOG2DEVMAC(y), &colour ); - // Convert from Mac colour to wx - col->Set( colour.red >> 8, - colour.green >> 8, - colour.blue >> 8); - return true ; -} - -void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 : - m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2; - wxCoord xx1 = XLOG2DEVMAC(x1) - offset; - wxCoord yy1 = YLOG2DEVMAC(y1) - offset; - wxCoord xx2 = XLOG2DEVMAC(x2) - offset; - wxCoord yy2 = YLOG2DEVMAC(y2) - offset; - if ((m_pen.GetCap() == wxCAP_ROUND) && - (m_pen.GetWidth() <= 1)) - { - // Implement LAST_NOT for MAC at least for - // orthogonal lines. RR. - if (xx1 == xx2) - { - if (yy1 < yy2) - yy2--; - if (yy1 > yy2) - yy2++; - } - if (yy1 == yy2) - { - if (xx1 < xx2) - xx2--; - if (xx1 > xx2) - xx2++; - } - } - ::MoveTo(xx1, yy1); - ::LineTo(xx2, yy2); - } -} - -void wxDC::DoCrossHair( wxCoord x, wxCoord y ) -{ - wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") ); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - int w = 0; - int h = 0; - GetSize( &w, &h ); - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - MacInstallPen(); - ::MoveTo( XLOG2DEVMAC(0), yy ); - ::LineTo( XLOG2DEVMAC(w), yy ); - ::MoveTo( xx, YLOG2DEVMAC(0) ); - ::LineTo( xx, YLOG2DEVMAC(h) ); - CalcBoundingBox(x, y); - CalcBoundingBox(x+w, y+h); - } -} - -/* -* To draw arcs properly the angles need to be converted from the WX style: -* Angles start on the +ve X axis and go anti-clockwise (As you would draw on -* a normal axis on paper). -* TO -* the Mac style: -* Angles start on the +ve y axis and go clockwise. -*/ - -static double wxConvertWXangleToMACangle(double angle) -{ - double newAngle = 90 - angle ; - if ( newAngle < 0 ) - newAngle += 360 ; - return newAngle ; -} - -void wxDC::DoDrawArc( wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawArc Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx1 = XLOG2DEVMAC(x1); - wxCoord yy1 = YLOG2DEVMAC(y1); - wxCoord xx2 = XLOG2DEVMAC(x2); - wxCoord yy2 = YLOG2DEVMAC(y2); - wxCoord xxc = XLOG2DEVMAC(xc); - wxCoord yyc = YLOG2DEVMAC(yc); - double dx = xx1 - xxc; - double dy = yy1 - yyc; - double radius = sqrt((double)(dx*dx+dy*dy)); - wxCoord rad = (wxCoord)radius; - double radius1, radius2; - if (xx1 == xx2 && yy1 == yy2) - { - radius1 = 0.0; - radius2 = 360.0; - } - else if (radius == 0.0) - { - radius1 = radius2 = 0.0; - } - else - { - radius1 = (xx1 - xxc == 0) ? - (yy1 - yyc < 0) ? 90.0 : -90.0 : - -atan2(double(yy1-yyc), double(xx1-xxc)) * RAD2DEG; - radius2 = (xx2 - xxc == 0) ? - (yy2 - yyc < 0) ? 90.0 : -90.0 : - -atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG; - } - wxCoord alpha2 = wxCoord(radius2 - radius1); - wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1)); - if( (xx1 > xx2) || (yy1 > yy2) ) { - alpha2 *= -1; - } - Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad }; - if(m_brush.GetStyle() != wxTRANSPARENT) { - MacInstallBrush(); - PaintArc(&r, alpha1, alpha2); - } - if(m_pen.GetStyle() != wxTRANSPARENT) { - MacInstallPen(); - FrameArc(&r, alpha1, alpha2); - } -} - -void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea ) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawEllepticArc Invalid DC")); - wxMacFastPortSetter helper(this) ; - Rect r; - double angle = sa - ea; // Order important Mac in opposite direction to wx - // we have to make sure that the filling is always counter-clockwise - if ( angle > 0 ) - angle -= 360 ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(w); - wxCoord hh = m_signY * YLOG2DEVREL(h); - // handle -ve width and/or height - if (ww < 0) { ww = -ww; xx = xx - ww; } - if (hh < 0) { hh = -hh; yy = yy - hh; } - sa = wxConvertWXangleToMACangle(sa); - r.top = yy; - r.left = xx; - r.bottom = yy + hh; - r.right = xx + ww; - if(m_brush.GetStyle() != wxTRANSPARENT) { - MacInstallBrush(); - PaintArc(&r, (short)sa, (short)angle); - } - if(m_pen.GetStyle() != wxTRANSPARENT) { - MacInstallPen(); - FrameArc(&r, (short)sa, (short)angle); - } -} - -void wxDC::DoDrawPoint( wxCoord x, wxCoord y ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() != wxTRANSPARENT) - { - wxCoord xx1 = XLOG2DEVMAC(x); - wxCoord yy1 = YLOG2DEVMAC(y); - RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel()); - ::SetCPixel( xx1,yy1,&pencolor) ; - CalcBoundingBox(x, y); - } -} - -void wxDC::DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (m_pen.GetStyle() == wxTRANSPARENT) - return; - MacInstallPen() ; - wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 : - m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2 ; - wxCoord x1, x2 , y1 , y2 ; - x1 = XLOG2DEVMAC(points[0].x + xoffset); - y1 = YLOG2DEVMAC(points[0].y + yoffset); - ::MoveTo(x1 - offset, y1 - offset ); - for (int i = 0; i < n-1; i++) - { - x2 = XLOG2DEVMAC(points[i+1].x + xoffset); - y2 = YLOG2DEVMAC(points[i+1].y + yoffset); - ::LineTo( x2 - offset, y2 - offset ); - } -} - -void wxDC::DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord x1, x2 , y1 , y2 ; - if ( m_brush.GetStyle() == wxTRANSPARENT && m_pen.GetStyle() == wxTRANSPARENT ) - return ; - PolyHandle polygon = OpenPoly(); - x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset); - y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset); - ::MoveTo(x1,y1); - for (int i = 1; i < n; i++) - { - x2 = XLOG2DEVMAC(points[i].x + xoffset); - y2 = YLOG2DEVMAC(points[i].y + yoffset); - ::LineTo(x2, y2); - } - // close the polyline if necessary - if ( x1 != x2 || y1 != y2 ) - { - ::LineTo(x1,y1 ) ; - } - ClosePoly(); - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush(); - ::PaintPoly( polygon ); - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FramePoly( polygon ) ; - } - KillPoly( polygon ); -} - -void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintRect( &rect ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameRect( &rect ) ; - } -} - -void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double radius) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - if (radius < 0.0) - radius = - radius * ((width < height) ? width : height); - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ; - } -} - -void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxCoord xx = XLOG2DEVMAC(x); - wxCoord yy = YLOG2DEVMAC(y); - wxCoord ww = m_signX * XLOG2DEVREL(width); - wxCoord hh = m_signY * YLOG2DEVREL(height); - // CMB: draw nothing if transformed w or h is 0 - if (ww == 0 || hh == 0) - return; - // CMB: handle -ve width and/or height - if (ww < 0) - { - ww = -ww; - xx = xx - ww; - } - if (hh < 0) - { - hh = -hh; - yy = yy - hh; - } - Rect rect = { yy , xx , yy + hh , xx + ww } ; - if (m_brush.GetStyle() != wxTRANSPARENT) - { - MacInstallBrush() ; - ::PaintOval( &rect ) ; - } - if (m_pen.GetStyle() != wxTRANSPARENT) - { - MacInstallPen() ; - ::FrameOval( &rect ) ; - } -} - -bool wxDC::CanDrawBitmap(void) const -{ - return true ; -} - -bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask, - wxCoord xsrcMask, wxCoord ysrcMask ) -{ - wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit Illegal dc")); - wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC")); - if ( logical_func == wxNO_OP ) - return TRUE ; - if (xsrcMask == -1 && ysrcMask == -1) - { - xsrcMask = xsrc; ysrcMask = ysrc; - } - // correct the parameter in case this dc does not have a mask at all - if ( useMask && !source->m_macMask ) - useMask = false ; - Rect srcrect , dstrect ; - srcrect.top = source->YLOG2DEVMAC(ysrc) ; - srcrect.left = source->XLOG2DEVMAC(xsrc) ; - srcrect.right = source->XLOG2DEVMAC(xsrc + width ) ; - srcrect.bottom = source->YLOG2DEVMAC(ysrc + height) ; - dstrect.top = YLOG2DEVMAC(ydest) ; - dstrect.left = XLOG2DEVMAC(xdest) ; - dstrect.bottom = YLOG2DEVMAC(ydest + height ) ; - dstrect.right = XLOG2DEVMAC(xdest + width ) ; - short mode = kUnsupportedMode ; - bool invertDestinationFirst = false ; - switch ( logical_func ) - { - case wxAND: // src AND dst - mode = adMin ; // ok - break ; - case wxAND_INVERT: // (NOT src) AND dst - mode = notSrcOr ; // ok - break ; - case wxAND_REVERSE:// src AND (NOT dst) - invertDestinationFirst = true ; - mode = srcOr ; - break ; - case wxCLEAR: // 0 - mode = kEmulatedMode ; - break ; - case wxCOPY: // src - mode = srcCopy ; // ok - break ; - case wxEQUIV: // (NOT src) XOR dst - mode = srcXor ; // ok - break ; - case wxINVERT: // NOT dst - mode = kEmulatedMode ; //or hilite ; - break ; - case wxNAND: // (NOT src) OR (NOT dst) - invertDestinationFirst = true ; - mode = srcBic ; - break ; - case wxNOR: // (NOT src) AND (NOT dst) - invertDestinationFirst = true ; - mode = notSrcOr ; - break ; - case wxNO_OP: // dst - mode = kEmulatedMode ; // this has already been handled upon entry - break ; - case wxOR: // src OR dst - mode = notSrcBic ; - break ; - case wxOR_INVERT: // (NOT src) OR dst - mode = srcBic ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - invertDestinationFirst = true ; - mode = notSrcBic ; - break ; - case wxSET: // 1 - mode = kEmulatedMode ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notSrcCopy ; // ok - break ; - case wxXOR: // src XOR dst - mode = notSrcXor ; // ok - break ; - default : - break ; - } - if ( mode == kUnsupportedMode ) - { - wxFAIL_MSG(wxT("unsupported blitting mode" )); - return FALSE ; - } - CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ; - PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ; - if ( LockPixels(bmappixels) ) - { - wxMacFastPortSetter helper(this) ; - if ( source->GetDepth() == 1 ) - { - RGBForeColor( &MAC_WXCOLORREF(m_textForegroundColour.GetPixel()) ) ; - RGBBackColor( &MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()) ) ; - } - else - { - // the modes need this, otherwise we'll end up having really nice colors... - RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ; - RGBColor black = { 0,0,0} ; - RGBForeColor( &black ) ; - RGBBackColor( &white ) ; - } - if ( useMask && source->m_macMask ) - { - if ( mode == srcCopy ) - { - if ( LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ) - { - CopyMask( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(source->m_macMask) ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &srcrect , &dstrect ) ; - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - } - } - else - { - RgnHandle clipRgn = NewRgn() ; - LockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ; - OffsetRgn( clipRgn , -srcrect.left + dstrect.left, -srcrect.top + dstrect.top ) ; - if ( mode == kEmulatedMode ) - { - Pattern pat ; - ::PenPat(GetQDGlobalsBlack(&pat)); - if ( logical_func == wxSET ) - { - RGBColor col= { 0xFFFF, 0xFFFF, 0xFFFF } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxCLEAR ) - { - RGBColor col= { 0x0000, 0x0000, 0x0000 } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxINVERT ) - { - MacInvertRgn( clipRgn ) ; - } - else - { - for ( int y = 0 ; y < srcrect.right - srcrect.left ; ++y ) - { - for ( int x = 0 ; x < srcrect.bottom - srcrect.top ; ++x ) - { - Point dstPoint = { dstrect.top + y , dstrect.left + x } ; - Point srcPoint = { srcrect.top + y , srcrect.left + x } ; - if ( PtInRgn( dstPoint , clipRgn ) ) - { - RGBColor srcColor ; - RGBColor dstColor ; - SetPort( (GrafPtr) sourcePort ) ; - GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ; - SetPort( (GrafPtr) m_macPort ) ; - GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - wxMacCalculateColour( logical_func , srcColor , dstColor ) ; - SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - } - } - } - } - } - else - { - if ( invertDestinationFirst ) - { - MacInvertRgn( clipRgn ) ; - } - CopyBits( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &dstrect, mode, clipRgn ) ; - } - DisposeRgn( clipRgn ) ; - } - } - else - { - RgnHandle clipRgn = NewRgn() ; - SetRectRgn( clipRgn , dstrect.left , dstrect.top , dstrect.right , dstrect.bottom ) ; - if ( mode == kEmulatedMode ) - { - Pattern pat ; - ::PenPat(GetQDGlobalsBlack(&pat)); - if ( logical_func == wxSET ) - { - RGBColor col= { 0xFFFF, 0xFFFF, 0xFFFF } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxCLEAR ) - { - RGBColor col= { 0x0000, 0x0000, 0x0000 } ; - ::RGBForeColor( &col ) ; - ::PaintRgn( clipRgn ) ; - } - else if ( logical_func == wxINVERT ) - { - MacInvertRgn( clipRgn ) ; - } - else - { - for ( int y = 0 ; y < srcrect.right - srcrect.left ; ++y ) - { - for ( int x = 0 ; x < srcrect.bottom - srcrect.top ; ++x ) - { - Point dstPoint = { dstrect.top + y , dstrect.left + x } ; - Point srcPoint = { srcrect.top + y , srcrect.left + x } ; - { - RGBColor srcColor ; - RGBColor dstColor ; - SetPort( (GrafPtr) sourcePort ) ; - GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ; - SetPort( (GrafPtr) m_macPort ) ; - GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - wxMacCalculateColour( logical_func , srcColor , dstColor ) ; - SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ; - } - } - } - } - } - else - { - if ( invertDestinationFirst ) - { - MacInvertRgn( clipRgn ) ; - } - CopyBits( GetPortBitMapForCopyBits( sourcePort ) , - GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) , - &srcrect, &dstrect, mode, NULL ) ; - } - DisposeRgn( clipRgn ) ; - } - UnlockPixels( bmappixels ) ; - } - m_macPenInstalled = false ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; - return TRUE; -} - -#ifndef FixedToInt -// as macro in FixMath.h for 10.3 -inline Fixed IntToFixed( int inInt ) -{ - return (((SInt32) inInt) << 16); -} - -inline int FixedToInt( Fixed inFixed ) -{ - return (((SInt32) inFixed) >> 16); -} -#endif - -void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, - double angle) -{ - wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") ); - - if (angle == 0.0 ) - { - DrawText(str, x, y); - return; - } - - if ( str.Length() == 0 ) - return ; - - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; - - if ( 0 ) - { - m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * m_font.GetMacFontSize())); - m_macAliasWasEnabled = true ; - } - OSStatus status = noErr ; - ATSUTextLayout atsuLayout ; - UniCharCount chars = str.Length() ; -#if wxUSE_UNICODE - status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) (const wxChar*) str , 0 , str.Length() , str.Length() , 1 , - &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; -#else - wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ; - int wlen = wxWcslen( wchar.data() ) ; - status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) wchar.data() , 0 , wlen , wlen , 1 , - &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; -#endif - wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") ); - int iAngle = int( angle ); - int drawX = XLOG2DEVMAC(x) ; - int drawY = YLOG2DEVMAC(y) ; - - ATSUTextMeasurement textBefore ; - ATSUTextMeasurement textAfter ; - ATSUTextMeasurement ascent ; - ATSUTextMeasurement descent ; - - - if ( abs(iAngle) > 0 ) - { - Fixed atsuAngle = IntToFixed( iAngle ) ; - ATSUAttributeTag atsuTags[] = - { - kATSULineRotationTag , - } ; - ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - sizeof( Fixed ) , - } ; - ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - &atsuAngle , - } ; - status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags)/sizeof(ATSUAttributeTag), - atsuTags, atsuSizes, atsuValues ) ; - } - status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - &textBefore , &textAfter, &ascent , &descent ); - - drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent)); - drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent)); - status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - IntToFixed(drawX) , IntToFixed(drawY) ); - wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") ); - Rect rect ; - status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd, - IntToFixed(drawX) , IntToFixed(drawY) , &rect ); - wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") ); - OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ; - CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) ); - CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) ); - ::ATSUDisposeTextLayout(atsuLayout); -} - -void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) -{ - wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC")); - - wxMacFastPortSetter helper(this) ; - long xx = XLOG2DEVMAC(x); - long yy = YLOG2DEVMAC(y); -#if TARGET_CARBON - bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() ) - useDrawThemeText = false ; -#endif - MacInstallFont() ; - if ( 0 ) - { - m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, 8); - m_macAliasWasEnabled = true ; - } - FontInfo fi ; - ::GetFontInfo( &fi ) ; -#if TARGET_CARBON - if ( !useDrawThemeText ) -#endif - yy += fi.ascent ; - ::MoveTo( xx , yy ); - if ( m_backgroundMode == wxTRANSPARENT ) - { - ::TextMode( srcOr) ; - } - else - { - ::TextMode( srcCopy ) ; - } - int length = strtext.Length() ; - - int laststop = 0 ; - int i = 0 ; - int line = 0 ; - { -#if 0 // we don't have to do all that here - while( i < length ) - { - if( strtext[i] == 13 || strtext[i] == 10) - { - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#if TARGET_CARBON - if ( useDrawThemeText ) - { - Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - line++ ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - ::DrawText( text , 0 , strlen(text) ) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - line++ ; - ::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) ); - } - laststop = i+1 ; - } - i++ ; - } - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#endif // 0 - wxString linetext = strtext ; -#if TARGET_CARBON - if ( useDrawThemeText ) - { - Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ; - - if ( m_backgroundMode != wxTRANSPARENT ) - { - Point bounds={0,0} ; - Rect background = frame ; - SInt16 baseline ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - background.right = background.left + bounds.h ; - background.bottom = background.top + bounds.v ; - ::EraseRect( &background ) ; - } - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Rect frame = { yy - fi.ascent + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy - fi.ascent + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - short width = ::TextWidth( text , 0 , strlen(text) ) ; - frame.right = frame.left + width ; - - ::EraseRect( &frame ) ; - } - ::DrawText( text , 0 , strlen(text) ) ; - } - } - ::TextMode( srcOr ) ; -} - -bool wxDC::CanGetTextExtent() const -{ - wxCHECK_MSG(Ok(), false, wxT("Invalid DC")); - return true ; -} - -void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height, - wxCoord *descent, wxCoord *externalLeading , - wxFont *theFont ) const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - wxFont formerFont = m_font ; - if ( theFont ) - { - // work around the constness - *((wxFont*)(&m_font)) = *theFont ; - } - MacInstallFont() ; - FontInfo fi ; - ::GetFontInfo( &fi ) ; -#if TARGET_CARBON - bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() ) - useGetThemeText = false ; -#endif - if ( height ) - *height = YDEV2LOGREL( fi.descent + fi.ascent ) ; - if ( descent ) - *descent =YDEV2LOGREL( fi.descent ); - if ( externalLeading ) - *externalLeading = YDEV2LOGREL( fi.leading ) ; - int length = strtext.Length() ; - - int laststop = 0 ; - int i = 0 ; - int curwidth = 0 ; - if ( width ) - { - *width = 0 ; -#if 0 // apparently we don't have to do all that - while( i < length ) - { - if( strtext[i] == 13 || strtext[i] == 10) - { - wxString linetext = strtext.Mid( laststop , i - laststop ) ; - if ( height ) - *height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - curwidth = bounds.h ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - curwidth = ::TextWidth( text , 0 , strlen(text) ) ; - } - if ( curwidth > *width ) - *width = XDEV2LOGREL( curwidth ) ; - laststop = i+1 ; - } - i++ ; - } - - wxString linetext = strtext.Mid( laststop , i - laststop ) ; -#endif // 0 - wxString linetext = strtext ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - curwidth = bounds.h ; - } - else -#endif - { - wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - curwidth = ::TextWidth( text , 0 , strlen(text) ) ; - } - if ( curwidth > *width ) - *width = XDEV2LOGREL( curwidth ) ; - } - if ( theFont ) - { - // work around the constness - *((wxFont*)(&m_font)) = formerFont ; - m_macFontInstalled = false ; - } -} - - -bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const -{ - wxCHECK_MSG(Ok(), false, wxT("Invalid DC")); - - widths.Empty(); - widths.Add(0, text.Length()); - - if (text.Length() == 0) - return false; - - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; -#if TARGET_CARBON - bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ; - if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() ) - useGetThemeText = false ; - - if ( useGetThemeText ) - { - // If anybody knows how to do this more efficiently yet still handle - // the fractional glyph widths that may be present when using AA - // fonts, please change it. Currently it is measuring from the - // begining of the string for each succeding substring, which is much - // slower than this should be. - for (size_t i=0; iGetNoAntiAliasing() ) - useGetThemeText = false ; -#endif - char text[] = "g" ; -#if TARGET_CARBON - if ( useGetThemeText ) - { - Point bounds={0,0} ; - SInt16 baseline ; - CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text , 1 , CFStringGetSystemEncoding(), false ) ; - ::GetThemeTextDimensions( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - CFRelease( mString ) ; - width = bounds.h ; - } - else -#endif - { - width = ::TextWidth( text , 0 , 1 ) ; - } - return YDEV2LOGREL(width) ; -} - -wxCoord wxDC::GetCharHeight(void) const -{ - wxCHECK_MSG(Ok(), 1, wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - MacInstallFont() ; - FontInfo fi ; - ::GetFontInfo( &fi ) ; - return YDEV2LOGREL( fi.descent + fi.ascent ); -} - -void wxDC::Clear(void) -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - wxMacFastPortSetter helper(this) ; - Rect rect = { -31000 , -31000 , 31000 , 31000 } ; - if (m_backgroundBrush.GetStyle() != wxTRANSPARENT) - { - ::PenNormal() ; - //MacInstallBrush() ; - MacSetupBackgroundForCurrentPort( m_backgroundBrush ) ; - ::EraseRect( &rect ) ; - } -} - -void wxDC::MacInstallFont() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - // if ( m_macFontInstalled ) - // return ; - Pattern blackColor ; - MacSetupBackgroundForCurrentPort(m_backgroundBrush) ; - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( (short)(m_scaleY * m_font.GetMacFontSize()) ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - m_macFontInstalled = true ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - RGBColor forecolor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - } - else - { - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - ::TextFont( fontId ) ; - ::TextSize( short(m_scaleY * fontSize) ) ; - ::TextFace( fontStyle ) ; - // todo reset after spacing changes - or store the current spacing somewhere - m_macFontInstalled = true ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - RGBColor forecolor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - } - short mode = patCopy ; - // todo : - switch( m_logicalFunction ) - { - case wxCOPY: // src - mode = patCopy ; - break ; - case wxINVERT: // NOT dst - ::PenPat(GetQDGlobalsBlack(&blackColor)); - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - OSStatus status = noErr ; - Fixed atsuSize = IntToFixed( int(m_scaleY * m_font.GetMacFontSize()) ) ; - Style qdStyle = m_font.GetMacFontStyle() ; - ATSUFontID atsuFont = m_font.GetMacATSUFontID() ; - status = ::ATSUCreateStyle((ATSUStyle *)&m_macATSUIStyle) ; - wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") ) ; - ATSUAttributeTag atsuTags[] = - { - kATSUFontTag , - kATSUSizeTag , - // kATSUColorTag , - // kATSUBaselineClassTag , - kATSUVerticalCharacterTag, - kATSUQDBoldfaceTag , - kATSUQDItalicTag , - kATSUQDUnderlineTag , - kATSUQDCondensedTag , - kATSUQDExtendedTag , - } ; - ByteCount atsuSizes[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - sizeof( ATSUFontID ) , - sizeof( Fixed ) , - // sizeof( RGBColor ) , - // sizeof( BslnBaselineClass ) , - sizeof( ATSUVerticalCharacterType), - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - sizeof( Boolean ) , - } ; - Boolean kTrue = true ; - Boolean kFalse = false ; - //BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ; - ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; - ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] = - { - &atsuFont , - &atsuSize , - // &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) , - // &kBaselineDefault , - &kHorizontal, - (qdStyle & bold) ? &kTrue : &kFalse , - (qdStyle & italic) ? &kTrue : &kFalse , - (qdStyle & underline) ? &kTrue : &kFalse , - (qdStyle & condense) ? &kTrue : &kFalse , - (qdStyle & extend) ? &kTrue : &kFalse , - } ; - status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) , - atsuTags, atsuSizes, atsuValues); - wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ; -} - -Pattern gPatterns[] = -{ // hatch patterns - { { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } } , - { { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } } , - { { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } } , - { { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } } , - { { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } } , - { { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } } , - { { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } , - // dash patterns - { { 0xCC , 0x99 , 0x33 , 0x66 , 0xCC , 0x99 , 0x33 , 0x66 } } , // DOT - { { 0xFE , 0xFD , 0xFB , 0xF7 , 0xEF , 0xDF , 0xBF , 0x7F } } , // LONG_DASH - { { 0xEE , 0xDD , 0xBB , 0x77 , 0xEE , 0xDD , 0xBB , 0x77 } } , // SHORT_DASH - { { 0xDE , 0xBD , 0x7B , 0xF6 , 0xED , 0xDB , 0xB7 , 0x6F } } , // DOT_DASH -} ; - -static void wxMacGetPattern(int penStyle, Pattern *pattern) -{ - int index = 0; // solid pattern by default - switch(penStyle) - { - // hatches - case wxBDIAGONAL_HATCH: index = 1; break; - case wxFDIAGONAL_HATCH: index = 2; break; - case wxCROSS_HATCH: index = 3; break; - case wxHORIZONTAL_HATCH: index = 4; break; - case wxVERTICAL_HATCH: index = 5; break; - case wxCROSSDIAG_HATCH: index = 6; break; - // dashes - case wxDOT: index = 7; break; - case wxLONG_DASH: index = 8; break; - case wxSHORT_DASH: index = 9; break; - case wxDOT_DASH: index = 10; break; - } - *pattern = gPatterns[index]; -} - -void wxDC::MacInstallPen() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - //Pattern blackColor; - // if ( m_macPenInstalled ) - // return ; - RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel()); - RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()); - ::RGBForeColor( &forecolor ); - ::RGBBackColor( &backcolor ); - ::PenNormal() ; - int penWidth = (int) (m_pen.GetWidth() * m_scaleX) ; ; - // null means only one pixel, at whatever resolution - if ( penWidth == 0 ) - penWidth = 1 ; - ::PenSize(penWidth, penWidth); - - int penStyle = m_pen.GetStyle(); - Pattern pat; - if (penStyle == wxUSER_DASH) - { - // FIXME: there should be exactly 8 items in the dash - wxDash* dash ; - int number = m_pen.GetDashes(&dash) ; - int index = 0; - for ( int i = 0 ; i < 8 ; ++i ) - { - pat.pat[i] = dash[index] ; - if (index < number - 1) - index++; - } - } - else - { - wxMacGetPattern(penStyle, &pat); - } - ::PenPat(&pat); - - short mode = patCopy ; - // todo : - switch( m_logicalFunction ) - { - case wxCOPY: // only foreground color, leave background (thus not patCopy) - mode = patOr ; - break ; - case wxINVERT: // NOT dst - // ::PenPat(GetQDGlobalsBlack(&blackColor)); - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - m_macPenInstalled = true ; - m_macBrushInstalled = false ; - m_macFontInstalled = false ; -} - -void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background ) -{ - Pattern whiteColor ; - switch( background.MacGetBrushKind() ) - { - case kwxMacBrushTheme : - { - ::SetThemeBackground( background.GetMacTheme() , wxDisplayDepth() , true ) ; - break ; - } - case kwxMacBrushThemeBackground : - { - Rect extent ; - ThemeBackgroundKind bg = background.GetMacThemeBackground( &extent ) ; - ::ApplyThemeBackground( bg , &extent ,kThemeStateActive , wxDisplayDepth() , true ) ; - break ; - } - case kwxMacBrushColour : - { - ::RGBBackColor( &MAC_WXCOLORREF( background.GetColour().GetPixel()) ); - int brushStyle = background.GetStyle(); - if (brushStyle == wxSOLID) - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - else if (IS_HATCH(brushStyle)) - { - Pattern pat ; - wxMacGetPattern(brushStyle, &pat); - ::BackPat(&pat); - } - else - { - ::BackPat(GetQDGlobalsWhite(&whiteColor)); - } - break ; - } - } -} - -void wxDC::MacInstallBrush() const -{ - wxCHECK_RET(Ok(), wxT("Invalid DC")); - Pattern blackColor ; - // if ( m_macBrushInstalled ) - // return ; - // foreground - bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ; - ::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) ); - ::RGBBackColor( &MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) ); - int brushStyle = m_brush.GetStyle(); - if (brushStyle == wxSOLID) - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - else if (IS_HATCH(brushStyle)) - { - Pattern pat ; - wxMacGetPattern(brushStyle, &pat); - ::PenPat(&pat); - } - else if ( m_brush.GetStyle() == wxSTIPPLE || m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE ) - { - // we force this in order to be compliant with wxMSW - backgroundTransparent = false ; - // for these the text fore (and back for MASK_OPAQUE) colors are used - wxBitmap* bitmap = m_brush.GetStipple() ; - int width = bitmap->GetWidth() ; - int height = bitmap->GetHeight() ; - GWorldPtr gw = NULL ; - if ( m_brush.GetStyle() == wxSTIPPLE ) - gw = MAC_WXHBITMAP(bitmap->GetHBITMAP()) ; - else - gw = MAC_WXHBITMAP(bitmap->GetMask()->GetMaskBitmap()) ; - PixMapHandle gwpixmaphandle = GetGWorldPixMap( gw ) ; - LockPixels( gwpixmaphandle ) ; - bool isMonochrome = !IsPortColor( gw ) ; - if ( !isMonochrome ) - { - if ( (**gwpixmaphandle).pixelSize == 1 ) - isMonochrome = true ; - } - if ( isMonochrome && width == 8 && height == 8 ) - { - ::RGBForeColor( &MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ); - ::RGBForeColor( &MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ); - BitMap* gwbitmap = (BitMap*) *gwpixmaphandle ; // since the color depth is 1 it is a BitMap - UInt8 *gwbits = (UInt8*) gwbitmap->baseAddr ; - int alignment = gwbitmap->rowBytes & 0x7FFF ; - Pattern pat ; - for ( int i = 0 ; i < 8 ; ++i ) - { - pat.pat[i] = gwbits[i*alignment+0] ; - } - UnlockPixels( GetGWorldPixMap( gw ) ) ; - ::PenPat( &pat ) ; - } - else - { - // this will be the code to handle power of 2 patterns, we will have to arrive at a nice - // caching scheme before putting this into production - Handle image; - long imageSize; - PixPatHandle pixpat = NewPixPat() ; - CopyPixMap(gwpixmaphandle, (**pixpat).patMap); - imageSize = GetPixRowBytes((**pixpat).patMap) * - ((**(**pixpat).patMap).bounds.bottom - - (**(**pixpat).patMap).bounds.top); - PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize ); - (**pixpat).patData = image; - if ( isMonochrome ) - { - CTabHandle ctable = ((**((**pixpat).patMap)).pmTable) ; - ColorSpecPtr ctspec = (ColorSpecPtr) &(**ctable).ctTable ; - if ( ctspec[0].rgb.red == 0x0000 ) - { - ctspec[1].rgb = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ; - ctspec[0].rgb = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ; - } - else - { - ctspec[0].rgb = MAC_WXCOLORREF( m_textBackgroundColour.GetPixel()) ; - ctspec[1].rgb = MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) ; - } - ::CTabChanged( ctable ) ; - } - ::PenPixPat(pixpat); - m_macForegroundPixMap = pixpat ; - } - UnlockPixels( gwpixmaphandle ) ; - } - else - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - short mode = patCopy ; - switch( m_logicalFunction ) - { - case wxCOPY: // src - if ( backgroundTransparent ) - mode = patOr ; - else - mode = patCopy ; - break ; - case wxINVERT: // NOT dst - if ( !backgroundTransparent ) - { - ::PenPat(GetQDGlobalsBlack(&blackColor)); - } - mode = patXor ; - break ; - case wxXOR: // src XOR dst - mode = patXor ; - break ; - case wxOR_REVERSE: // src OR (NOT dst) - mode = notPatOr ; - break ; - case wxSRC_INVERT: // (NOT src) - mode = notPatCopy ; - break ; - case wxAND: // src AND dst - mode = adMin ; - break ; - // unsupported TODO - case wxCLEAR: // 0 - case wxAND_REVERSE:// src AND (NOT dst) - case wxAND_INVERT: // (NOT src) AND dst - case wxNO_OP: // dst - case wxNOR: // (NOT src) AND (NOT dst) - case wxEQUIV: // (NOT src) XOR dst - case wxOR_INVERT: // (NOT src) OR dst - case wxNAND: // (NOT src) OR (NOT dst) - case wxOR: // src OR dst - case wxSET: // 1 - // case wxSRC_OR: // source _bitmap_ OR destination - // case wxSRC_AND: // source _bitmap_ AND destination - break ; - } - ::PenMode( mode ) ; - m_macBrushInstalled = true ; - m_macPenInstalled = false ; - m_macFontInstalled = false ; -} - -// --------------------------------------------------------------------------- -// coordinates transformations -// --------------------------------------------------------------------------- - -wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const -{ - return ((wxDC *)this)->XDEV2LOG(x); -} - -wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const -{ - return ((wxDC *)this)->YDEV2LOG(y); -} - -wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const -{ - return ((wxDC *)this)->XDEV2LOGREL(x); -} - -wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const -{ - return ((wxDC *)this)->YDEV2LOGREL(y); -} - -wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const -{ - return ((wxDC *)this)->XLOG2DEV(x); -} - -wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const -{ - return ((wxDC *)this)->YLOG2DEV(y); -} - -wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const -{ - return ((wxDC *)this)->XLOG2DEVREL(x); -} - -wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const -{ - return ((wxDC *)this)->YLOG2DEVREL(y); -} diff --git a/src/mac/classic/dcclient.cpp b/src/mac/classic/dcclient.cpp deleted file mode 100644 index f28c6dc576..0000000000 --- a/src/mac/classic/dcclient.cpp +++ /dev/null @@ -1,175 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.cpp -// Purpose: wxClientDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcclient.h" -#endif - -#include "wx/dcclient.h" -#include "wx/dcmemory.h" -#include "wx/region.h" -#include "wx/window.h" -#include "wx/toplevel.h" -#include -#include "wx/mac/private.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define RAD2DEG 57.2957795131 - -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) -#endif - -/* - * wxWindowDC - */ - -#include "wx/mac/uma.h" - -wxWindowDC::wxWindowDC() -{ - m_window = NULL ; -} - -wxWindowDC::wxWindowDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - - int x , y ; - x = y = 0 ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - CopyRgn( (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); -} - -wxWindowDC::~wxWindowDC() -{ -} - -void wxWindowDC::DoGetSize( int* width, int* height ) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetSize(width, height); -} - -/* - * wxClientDC - */ - -wxClientDC::wxClientDC() -{ - m_window = NULL ; -} - -wxClientDC::wxClientDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - if (!rootwindow) - return; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - wxPoint origin = window->GetClientAreaOrigin() ; - wxSize size = window->GetClientSize() ; - int x , y ; - x = origin.x ; - y = origin.y ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , origin.x , origin.y , origin.x + size.x , origin.y + size.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , -origin.x , -origin.y ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); - SetFont( window->GetFont() ) ; -} - -wxClientDC::~wxClientDC() -{ -} - -void wxClientDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetClientSize( width, height ); -} - - -/* - * wxPaintDC - */ - -wxPaintDC::wxPaintDC() -{ - m_window = NULL ; -} - -wxPaintDC::wxPaintDC(wxWindow *window) -{ - m_window = window ; - wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ; - WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ; - wxPoint origin = window->GetClientAreaOrigin() ; - wxSize size = window->GetClientSize() ; - int x , y ; - x = origin.x ; - y = origin.y ; - window->MacWindowToRootWindow( &x , &y ) ; - m_macLocalOrigin.x = x ; - m_macLocalOrigin.y = y ; - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , origin.x , origin.y , origin.x + size.x , origin.y + size.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->MacGetVisibleRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , -origin.x , -origin.y ) ; - SectRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) window->GetUpdateRegion().GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - m_macPort = UMAGetWindowPort( windowref ) ; - - m_ok = TRUE ; - SetBackground(window->MacGetBackgroundBrush()); - SetFont( window->GetFont() ) ; -} - -wxPaintDC::~wxPaintDC() -{ -} - -void wxPaintDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); - - m_window->GetClientSize( width, height ); -} - - diff --git a/src/mac/classic/dcmemory.cpp b/src/mac/classic/dcmemory.cpp deleted file mode 100644 index e850a59e4d..0000000000 --- a/src/mac/classic/dcmemory.cpp +++ /dev/null @@ -1,100 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.cpp -// Purpose: wxMemoryDC class -// Author: Stefan Csomor -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcmemory.h" -#endif - -#include "wx/dcmemory.h" -#include "wx/mac/private.h" - -//----------------------------------------------------------------------------- -// wxMemoryDC -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) - -wxMemoryDC::wxMemoryDC(void) -: m_selected() -{ - m_ok = TRUE; - SetBackground(*wxWHITE_BRUSH); - SetBrush(*wxWHITE_BRUSH); - SetPen(*wxBLACK_PEN); - m_ok = FALSE; -}; - -wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) -: m_selected() -{ - m_ok = TRUE; - SetBackground(*wxWHITE_BRUSH); - SetBrush(*wxWHITE_BRUSH); - SetPen(*wxBLACK_PEN); - m_ok = FALSE; -}; - -wxMemoryDC::~wxMemoryDC() -{ - if ( m_selected.Ok() ) - { - UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) ); - } -}; - -void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) -{ - if ( m_selected.Ok() ) - { - UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) ); - } - m_selected = bitmap; - if (m_selected.Ok()) - { - if ( m_selected.GetHBITMAP() ) - { - m_macPort = (GrafPtr) m_selected.GetHBITMAP() ; - LockPixels( GetGWorldPixMap( (CGrafPtr) m_macPort ) ) ; - wxMask * mask = bitmap.GetMask() ; - if ( mask ) - { - m_macMask = mask->GetMaskBitmap() ; - } - SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; - m_ok = TRUE ; - } - else - { - m_ok = FALSE; - } - } - else - { - m_ok = FALSE; - } -} - -void wxMemoryDC::DoGetSize( int *width, int *height ) const -{ - if (m_selected.Ok()) - { - if (width) (*width) = m_selected.GetWidth(); - if (height) (*height) = m_selected.GetHeight(); - } - else - { - if (width) (*width) = 0; - if (height) (*height) = 0; - } -} - - diff --git a/src/mac/classic/dcprint.cpp b/src/mac/classic/dcprint.cpp deleted file mode 100644 index e875cb0387..0000000000 --- a/src/mac/classic/dcprint.cpp +++ /dev/null @@ -1,416 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcprint.cpp -// Purpose: wxPrinterDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcprint.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif - -#include "wx/dcprint.h" -#include "wx/msgdlg.h" -#include -#include "wx/mac/uma.h" -#include "wx/mac/private/print.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxPrinterDC, wxDC) -#endif - -class wxNativePrinterDC -{ -public : - wxNativePrinterDC() {} - virtual ~wxNativePrinterDC() {} - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) = 0; - virtual void EndDoc( wxPrinterDC* dc ) = 0; - virtual void StartPage( wxPrinterDC* dc ) = 0; - virtual void EndPage( wxPrinterDC* dc ) = 0; - virtual wxCoord GetMaxX() const = 0 ; - virtual wxCoord GetMaxY() const = 0 ; - // returns 0 in case of no Error, otherwise platform specific error codes - virtual wxUint32 GetStatus() const = 0 ; - bool Ok() { return GetStatus() == 0 ; } - - static wxNativePrinterDC* Create(wxPrintData* data) ; -} ; - -#if TARGET_CARBON - -class wxMacCarbonPrinterDC : public wxNativePrinterDC -{ -public : - wxMacCarbonPrinterDC( wxPrintData* data ) ; - ~wxMacCarbonPrinterDC() ; - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; - virtual void EndDoc( wxPrinterDC* dc ) ; - virtual void StartPage( wxPrinterDC* dc ) ; - virtual void EndPage( wxPrinterDC* dc ) ; - virtual wxCoord GetMaxX() const { return m_maxX ; } - virtual wxCoord GetMaxY() const { return m_maxY ; } - virtual wxUint32 GetStatus() const { return m_err ; } -private : - GrafPtr m_macPrintFormerPort ; - wxCoord m_maxX ; - wxCoord m_maxY ; - OSStatus m_err ; -} ; - -wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) -{ - ::GetPort( & m_macPrintFormerPort ) ; - - m_err = noErr ; - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) data->m_nativePrintData ; - - PMRect rPage; - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( m_err != noErr ) - return; - - m_maxX = wxCoord(rPage.right - rPage.left) ; - m_maxY = wxCoord(rPage.bottom - rPage.top); -} - -wxMacCarbonPrinterDC::~wxMacCarbonPrinterDC() -{ - // nothing to release from print data, as wxPrinterDC has all data in its wxPrintData member - ::SetPort( m_macPrintFormerPort ) ; -} - -wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data) -{ - return new wxMacCarbonPrinterDC(data) ; -} - -bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) ) -{ - if ( m_err ) - return false ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionBeginDocument(native->m_macPrintSession, - native->m_macPrintSettings, - native->m_macPageFormat); - if ( m_err != noErr ) - return false; - - PMRect rPage; - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( m_err != noErr ) - return false; - - m_maxX = (wxCoord)(rPage.right - rPage.left); - m_maxY = (wxCoord)(rPage.bottom - rPage.top); - return true ; -} - -void wxMacCarbonPrinterDC::EndDoc( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionEndDocument(native->m_macPrintSession); -} - -void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionBeginPage(native->m_macPrintSession, - native->m_macPageFormat, - nil); - - if ( m_err == noErr ) - { - m_err = PMSessionGetGraphicsContext(native->m_macPrintSession, - nil, - (void**) &dc->m_macPort ); - } - - if ( m_err != noErr ) - { - PMSessionEndPage(native->m_macPrintSession); - PMSessionEndDocument(native->m_macPrintSession); - } - else - { - PMRect rPage; - - m_err = PMGetAdjustedPageRect(native->m_macPageFormat, &rPage); - if ( !m_err ) - { - dc->m_macLocalOrigin.x = (int) rPage.left; - dc->m_macLocalOrigin.y = (int) rPage.top; - } - // since this is a non-critical error, we set the flag back - m_err = noErr ; - } -} - -void wxMacCarbonPrinterDC::EndPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ; - - m_err = PMSessionEndPage(native->m_macPrintSession); - if ( m_err != noErr ) - { - PMSessionEndDocument(native->m_macPrintSession); - } -} - -#else - -class wxMacClassicPrinterDC : public wxNativePrinterDC -{ -public : - wxMacClassicPrinterDC( wxPrintData* data ) ; - ~wxMacClassicPrinterDC() ; - virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; - virtual void EndDoc( wxPrinterDC* dc ) ; - virtual void StartPage( wxPrinterDC* dc ) ; - virtual void EndPage( wxPrinterDC* dc ) ; - virtual wxCoord GetMaxX() const { return m_maxX ; } - virtual wxCoord GetMaxY() const { return m_maxY ; } - virtual wxUint32 GetStatus() const { return m_err ; } -private : - GrafPtr m_macPrintFormerPort ; - TPPrPort m_macPrintingPort ; - OSErr m_err ; - long m_maxX ; - long m_maxY ; -} ; - -wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data) -{ - return new wxMacClassicPrinterDC(data) ; -} - -wxMacClassicPrinterDC::wxMacClassicPrinterDC(wxPrintData* data) -{ - ::GetPort( &m_macPrintFormerPort ) ; - m_err = noErr ; - ::UMAPrOpen() ; - m_err = PrError() ; - if ( m_err != noErr ) - return; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) data->m_nativePrintData ; - - if ( ::PrValidate( native->m_macPrintSettings ) ) - { - // the driver has changed in the mean time, should we pop up a page setup dialog ? - if ( !::PrStlDialog( native->m_macPrintSettings ) ) - { - m_err = -1 ; - return; - } - } - m_err = PrError() ; - - if ( m_err == noErr ) - { - m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ; - m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ; - } -} - -wxMacClassicPrinterDC::~wxMacClassicPrinterDC() -{ - ::UMAPrClose() ; - ::SetPort( LMGetWMgrPort() ) ; -} - -bool wxMacClassicPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) ) -{ - if ( m_err ) - return false ; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ; - m_macPrintingPort = ::PrOpenDoc( native->m_macPrintSettings , NULL , NULL ) ; - m_err = PrError() ; - if ( m_err ) - return false ; - - // sets current port - dc->m_macPort = (GrafPtr ) m_macPrintingPort ; - m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ; - m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ; - return true ; -} - -void wxMacClassicPrinterDC::EndDoc( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - PrCloseDoc( m_macPrintingPort ) ; - m_err = PrError() ; -} - -void wxMacClassicPrinterDC::StartPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ; - - PrOpenPage( m_macPrintingPort , NULL ) ; - dc->m_macLocalOrigin.x = (**native->m_macPrintSettings).rPaper.left ; - dc->m_macLocalOrigin.y = (**native->m_macPrintSettings).rPaper.top ; - // m_macPrintingPort is now the current port - Rect clip = { -32000 , -32000 , 32000 , 32000 } ; - ::ClipRect( &clip ) ; - m_err = PrError() ; - if ( m_err != noErr ) - ::PrCloseDoc( m_macPrintingPort ) ; -} - -void wxMacClassicPrinterDC::EndPage( wxPrinterDC* dc ) -{ - if ( m_err ) - return ; - - PrClosePage( m_macPrintingPort ) ; - m_err = PrError() ; - if ( m_err != noErr ) - ::PrCloseDoc( m_macPrintingPort ) ; -} - -#endif - -wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) -{ - m_ok = FALSE ; - m_printData = printdata ; - m_printData.ConvertToNative() ; - m_nativePrinterDC = wxNativePrinterDC::Create( &m_printData ) ; - if ( m_nativePrinterDC ) - { - m_ok = m_nativePrinterDC->Ok() ; - - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - } -} - -wxPrinterDC::~wxPrinterDC(void) -{ - delete m_nativePrinterDC ; -} - -bool wxPrinterDC::StartDoc( const wxString& message ) -{ - wxASSERT_MSG( Ok() , wxT("Called wxPrinterDC::StartDoc from an invalid object") ) ; - - if ( !m_ok ) - return false ; - - if ( m_nativePrinterDC->StartDoc(this, message ) ) - { - // in case we have to do additional things when successful - } - m_ok = m_nativePrinterDC->Ok() ; - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return m_ok ; -} - -void wxPrinterDC::EndDoc(void) -{ - if ( !m_ok ) - return ; - - m_nativePrinterDC->EndDoc( this ) ; - m_ok = m_nativePrinterDC->Ok() ; - - if ( !m_ok ) - { - wxString message ; - message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } -} - -void wxPrinterDC::StartPage(void) -{ - if ( !m_ok ) - return ; - - m_logicalFunction = wxCOPY; - // m_textAlignment = wxALIGN_TOP_LEFT; - m_backgroundMode = wxTRANSPARENT; - - m_textForegroundColour = *wxBLACK; - m_textBackgroundColour = *wxWHITE; - m_pen = *wxBLACK_PEN; - m_font = *wxNORMAL_FONT; - m_brush = *wxTRANSPARENT_BRUSH; - m_backgroundBrush = *wxWHITE_BRUSH; - - m_macFontInstalled = false ; - m_macBrushInstalled = false ; - m_macPenInstalled = false ; - - m_nativePrinterDC->StartPage(this) ; - m_ok = m_nativePrinterDC->Ok() ; - -} - -void wxPrinterDC::EndPage(void) -{ - if ( !m_ok ) - return ; - - m_nativePrinterDC->EndPage(this) ; - m_ok = m_nativePrinterDC->Ok() ; -} - -void wxPrinterDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") ); - - if ( width ) - * width = m_nativePrinterDC->GetMaxX() ; - if ( height ) - * height = m_nativePrinterDC->GetMaxY() ; -} - - diff --git a/src/mac/classic/dcscreen.cpp b/src/mac/classic/dcscreen.cpp deleted file mode 100644 index 03d769a05b..0000000000 --- a/src/mac/classic/dcscreen.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcscreen.cpp -// Purpose: wxScreenDC class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dcscreen.h" -#endif - -#include "wx/dcscreen.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC) -#endif - -// Create a DC representing the whole screen -wxScreenDC::wxScreenDC() -{ -#if TARGET_CARBON - m_macPort = GetQDGlobalsThePort() ; - GrafPtr port ; - GetPort( &port ) ; - SetPort( (GrafPtr) m_macPort ) ; - Point pt = { 0,0 } ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - m_macLocalOrigin.x = -pt.h ; - m_macLocalOrigin.y = -pt.v ; -#else - m_macPort = LMGetWMgrPort() ; - m_macLocalOrigin.x = 0 ; - m_macLocalOrigin.y = 0 ; -#endif - m_ok = TRUE ; - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - m_minX = screenBits.bounds.left ; - #if TARGET_CARBON - SInt16 height ; - GetThemeMenuBarHeight( &height ) ; - m_minY = screenBits.bounds.top + height ; - #else - m_minY = screenBits.bounds.top + LMGetMBarHeight() ; - #endif - m_maxX = screenBits.bounds.right ; - m_maxY = screenBits.bounds.bottom ; - MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ; - OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; -} - -wxScreenDC::~wxScreenDC() -{ - // TODO -} - diff --git a/src/mac/classic/dialog.cpp b/src/mac/classic/dialog.cpp deleted file mode 100644 index f29ed3e59e..0000000000 --- a/src/mac/classic/dialog.cpp +++ /dev/null @@ -1,268 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp -// Purpose: wxDialog class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dialog.h" -#endif - -#include "wx/dialog.h" -#include "wx/utils.h" -#include "wx/frame.h" -#include "wx/app.h" -#include "wx/settings.h" - -#include "wx/mac/uma.h" - -// Lists to keep track of windows, so we can disable/enable them -// for modal dialogs -wxList wxModalDialogs; -//wxList wxModelessWindows; // Frames and modeless dialogs -extern wxList wxPendingDelete; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) - -BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) - EVT_BUTTON(wxID_OK, wxDialog::OnOK) - EVT_BUTTON(wxID_APPLY, wxDialog::OnApply) - EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel) - - EVT_CHAR_HOOK(wxDialog::OnCharHook) - - EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged) - - EVT_CLOSE(wxDialog::OnCloseWindow) -END_EVENT_TABLE() - -#endif - -wxDialog::wxDialog() -{ - m_isShown = FALSE; - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); -} - -bool wxDialog::Create(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - - - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; - - MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) & ~(wxYES|wxOK|wxNO|wxCANCEL) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - return TRUE; -} - -void wxDialog::SetModal(bool flag) -{ - if ( flag ) - { - m_windowStyle |= wxDIALOG_MODAL; - - wxModelessWindows.DeleteObject(this); -#if TARGET_CARBON - SetWindowModality( (WindowRef) MacGetWindowRef() , kWindowModalityAppModal , NULL ) ; -#endif - } - else - { - m_windowStyle &= ~wxDIALOG_MODAL; - - wxModelessWindows.Append(this); - } -} - -wxDialog::~wxDialog() -{ - m_isBeingDeleted = TRUE; - Show(FALSE); -} - -// By default, pressing escape cancels the dialog , on mac command-stop does the same thing -void wxDialog::OnCharHook(wxKeyEvent& event) -{ - if (( event.m_keyCode == WXK_ESCAPE || - ( event.m_keyCode == '.' && event.MetaDown() ) ) - && FindWindow(wxID_CANCEL) ) - { - // 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); - cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); - - return; - } - // We didn't process this event. - event.Skip(); -} - -bool wxDialog::IsModal() const -{ - return (GetWindowStyleFlag() & wxDIALOG_MODAL) != 0; -} - - -bool wxDialog::IsModalShowing() const -{ - return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast -} - -bool wxDialog::Show(bool show) -{ - if ( !wxDialogBase::Show(show) ) - { - // nothing to do - return FALSE; - } - - if ( show ) - { - // usually will result in TransferDataToWindow() being called - InitDialog(); - } - - if ( IsModal() ) - { - if ( show ) - { - DoShowModal(); - } - else // end of modal dialog - { - // this will cause IsModalShowing() return FALSE and our local - // message loop will terminate - wxModalDialogs.DeleteObject(this); - } - } - - return TRUE; -} - -#if !TARGET_CARBON -extern bool s_macIsInModalLoop ; -#endif - -void wxDialog::DoShowModal() -{ - wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") ); - - wxModalDialogs.Append(this); - -#if TARGET_CARBON - BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; -#else - // TODO : test whether parent gets disabled - bool formerModal = s_macIsInModalLoop ; - s_macIsInModalLoop = true ; -#endif - while ( IsModalShowing() ) - { - wxTheApp->MacDoOneEvent() ; - // calls process idle itself - } - -#if TARGET_CARBON - EndAppModalStateForWindow( (WindowRef) MacGetWindowRef() ) ; -#else - // TODO probably reenable the parent window if any - s_macIsInModalLoop = formerModal ; -#endif -} - - -// Replacement for Show(TRUE) for modal dialogs - returns return code -int wxDialog::ShowModal() -{ - if ( !IsModal() ) - { - SetModal(TRUE); - } - - Show(TRUE); - return GetReturnCode(); -} - -// NB: this function (surprizingly) may be called for both modal and modeless -// dialogs and should work for both of them -void wxDialog::EndModal(int retCode) -{ - SetReturnCode(retCode); - Show(FALSE); -} - -// Standard buttons -void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ - if ( Validate() && TransferDataFromWindow() ) - { - EndModal(wxID_OK); - } -} - -void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) -{ - if (Validate()) - TransferDataFromWindow(); - // TODO probably need to disable the Apply button until things change again -} - -void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - // We'll send a Cancel message by default, - // which may close the dialog. - // Check for looping if the Cancel event handler calls Close(). - - // Note that if a cancel button and handler aren't present in the dialog, - // nothing will happen when you close the dialog via the window manager, or - // via Close(). - // We wouldn't want to destroy the dialog by default, since the dialog may have been - // created on the stack. - // However, this does mean that calling dialog->Close() won't delete the dialog - // unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be - // sure to destroy the dialog. - // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog. - - static wxList closing; - - if ( closing.Member(this) ) - return; - - closing.Append(this); - - wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); - cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog - - closing.DeleteObject(this); -} - -void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - Refresh(); -} - diff --git a/src/mac/classic/dirdlg.cpp b/src/mac/classic/dirdlg.cpp deleted file mode 100644 index 0b4c7df195..0000000000 --- a/src/mac/classic/dirdlg.cpp +++ /dev/null @@ -1,146 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.cpp -// Purpose: wxDirDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dirdlg.h" -#endif - -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/dirdlg.h" - -#include "wx/cmndata.h" - -#include "wx/mac/private.h" - -#ifdef __DARWIN__ - #include -#else - #include -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxDirDialog, wxDialog) -#endif - -wxDirDialog::wxDirDialog(wxWindow *parent, - const wxString& message, - const wxString& defaultPath, - long style, - const wxPoint& WXUNUSED(pos), - const wxSize& WXUNUSED(size), - const wxString& WXUNUSED(name)) -{ - wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ; - m_message = message; - m_dialogStyle = style; - m_parent = parent; - m_path = defaultPath; -} - -int wxDirDialog::ShowModal() -{ - NavDialogOptions mNavOptions; - NavObjectFilterUPP mNavFilterUPP = NULL; - NavPreviewUPP mNavPreviewUPP = NULL ; - NavReplyRecord mNavReply; - AEDesc* mDefaultLocation = NULL ; - bool mSelectDefault = false ; - - ::NavGetDefaultDialogOptions(&mNavOptions); - - mNavFilterUPP = nil; - mNavPreviewUPP = nil; - mSelectDefault = false; - mNavReply.validRecord = false; - mNavReply.replacing = false; - mNavReply.isStationery = false; - mNavReply.translationNeeded = false; - mNavReply.selection.descriptorType = typeNull; - mNavReply.selection.dataHandle = nil; - mNavReply.keyScript = smSystemScript; - mNavReply.fileTranslation = nil; - - // Set default location, the location - // that's displayed when the dialog - // first appears - - if ( mDefaultLocation ) { - - if (mSelectDefault) { - mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; - } else { - mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; - } - } - - OSErr err = ::NavChooseFolder( - mDefaultLocation, - &mNavReply, - &mNavOptions, - NULL, - mNavFilterUPP, - 0L); // User Data - - if ( (err != noErr) && (err != userCanceledErr) ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - - if (mNavReply.validRecord) { // User chose a folder - - FSSpec folderInfo; - FSSpec outFileSpec ; - AEDesc specDesc ; - - OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc); - if ( err != noErr ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - folderInfo = **(FSSpec**) specDesc.dataHandle; - if (specDesc.dataHandle != nil) { - ::AEDisposeDesc(&specDesc); - } - -// mNavReply.GetFileSpec(folderInfo); - - // The FSSpec from NavChooseFolder is NOT the file spec - // for the folder. The parID field is actually the DirID - // of the folder itself, not the folder's parent, and - // the name field is empty. We must call PBGetCatInfo - // to get the parent DirID and folder name - - Str255 name; - CInfoPBRec thePB; // Directory Info Parameter Block - thePB.dirInfo.ioCompletion = nil; - thePB.dirInfo.ioVRefNum = folderInfo.vRefNum; // Volume is right - thePB.dirInfo.ioDrDirID = folderInfo.parID; // Folder's DirID - thePB.dirInfo.ioNamePtr = name; - thePB.dirInfo.ioFDirIndex = -1; // Lookup using Volume and DirID - - err = ::PBGetCatInfoSync(&thePB); - if ( err != noErr ) { - m_path = wxT("") ; - return wxID_CANCEL ; - } - // Create cannonical FSSpec - ::FSMakeFSSpec(thePB.dirInfo.ioVRefNum, thePB.dirInfo.ioDrParID, - name, &outFileSpec); - - // outFolderDirID = thePB.dirInfo.ioDrDirID; - m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ; - return wxID_OK ; - } - return wxID_CANCEL; -} - diff --git a/src/mac/classic/dirmac.cpp b/src/mac/classic/dirmac.cpp deleted file mode 100644 index 0afc3b5cb3..0000000000 --- a/src/mac/classic/dirmac.cpp +++ /dev/null @@ -1,322 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/dir.cpp -// Purpose: wxDir implementation for Mac -// Author: Stefan Csomor -// Modified by: -// Created: 08.12.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "dir.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif // PCH - -#include "wx/dir.h" -#include "wx/filefn.h" // for wxPathExists() - -#ifndef __DARWIN__ - #include -#endif - -#include "wx/mac/private.h" - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifndef MAX_PATH - #define MAX_PATH 260 // from VC++ headers -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#define M_DIR ((wxDirData *)m_data) - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// this class stores everything we need to enumerate the files -class wxDirData -{ -public: - wxDirData(const wxString& dirname); - ~wxDirData(); - - void SetFileSpec(const wxString& filespec) { m_filespec = filespec; } - void SetFlags(int flags) { m_flags = flags; } - - bool Read(wxString *filename); // reads the next - void Rewind() ; - - const wxString& GetName() const { return m_dirname; } - bool Ok() const { return m_ok; } - -private: - CInfoPBRec m_CPB ; - wxInt16 m_index ; - long m_dirId ; - Str255 m_name ; - Boolean m_isDir ; - - wxString m_dirname; - wxString m_filespec; - - int m_flags; - bool m_ok; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDirData -// ---------------------------------------------------------------------------- - -wxDirData::wxDirData(const wxString& dirname) - : m_dirname(dirname) -{ - m_ok = false; - - OSErr err; - - // throw away the trailing slashes - size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); - - while ( n > 0 && wxIsPathSeparator(m_dirname[--n]) ) - ; - - m_dirname.Truncate(n + 1); - -#ifdef __DARWIN__ - FSRef theRef; - - // get the FSRef associated with the POSIX path - err = FSPathMakeRef((const UInt8 *) m_dirname.c_str(), &theRef, NULL); - FSGetVRefNum(&theRef, &(m_CPB.hFileInfo.ioVRefNum)); - - err = FSGetNodeID( &theRef , &m_dirId , &m_isDir ) ; -#else - FSSpec fsspec ; - - wxMacFilename2FSSpec( m_dirname , &fsspec ) ; - m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ; - - err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; -#endif - //wxASSERT_MSG( (err == noErr) || (err == nsvErr) , wxT("Error accessing directory " + m_dirname)) ; - if ( (err == noErr) || (err == nsvErr)) - m_ok = true; - else - wxLogError(wxString(wxT("Error accessing directory ")) + m_dirname); - - m_CPB.hFileInfo.ioNamePtr = m_name ; - m_index = 0 ; -} - -wxDirData::~wxDirData() -{ -} - -void wxDirData::Rewind() -{ - m_index = 0 ; -} - -bool wxDirData::Read(wxString *filename) -{ - if ( !m_isDir ) - return FALSE ; - - wxString result; - - short err = noErr ; - - while ( err == noErr ) - { - m_index++ ; - m_CPB.dirInfo.ioFDirIndex = m_index; - m_CPB.dirInfo.ioDrDirID = m_dirId; /* we need to do this every time */ - err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB); - if ( err != noErr ) - break ; - - // its hidden but we don't want it - if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) ) - continue ; -#ifdef __DARWIN__ - // under X, names that start with '.' are hidden - if ( ( m_name[1] == '.' ) && !(m_flags & wxDIR_HIDDEN) ) - continue; -#endif -#if TARGET_CARBON - // under X thats the way the mounting points look like - if ( ( m_CPB.dirInfo.ioDrDirID == 0 ) && ( m_flags & wxDIR_DIRS) ) - break ; -#endif - // we have a directory - if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) - break ; - - // its a file but we don't want it - if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) ) - continue ; - - wxString file = wxMacMakeStringFromPascal( m_name ) ; - if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") ) - { - } - else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") ) - { - if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() ) - { - continue ; - } - } - else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == wxT("*") ) - { - if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() ) - { - continue ; - } - } - else if ( file.Upper() != m_filespec.Upper() ) - { - continue ; - } - - break ; - } - if ( err != noErr ) - { - return FALSE ; - } - - *filename = wxMacMakeStringFromPascal( m_name ) ; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxDir helpers -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDir::Exists(const wxString& dir) -{ - return wxPathExists(dir); -} - -// ---------------------------------------------------------------------------- -// wxDir construction/destruction -// ---------------------------------------------------------------------------- - -wxDir::wxDir(const wxString& dirname) -{ - m_data = NULL; - - (void)Open(dirname); -} - -bool wxDir::Open(const wxString& dirname) -{ - delete M_DIR; - m_data = new wxDirData(dirname); - if (m_data->Ok()) - return TRUE; - else - { - delete m_data; - m_data = NULL; - return FALSE; - } -} - -bool wxDir::IsOpened() const -{ - return m_data != NULL; -} - -wxString wxDir::GetName() const -{ - wxString name; - if ( m_data ) - { - name = M_DIR->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) - { - // chop off the last (back)slash - name.Truncate(name.length() - 1); - } - } - - return name; -} - -wxDir::~wxDir() -{ - if (M_DIR != NULL) { - delete M_DIR; - m_data = NULL; - } -} - -// ---------------------------------------------------------------------------- -// wxDir enumerating -// ---------------------------------------------------------------------------- - -bool wxDir::GetFirst(wxString *filename, - const wxString& filespec, - int flags) const -{ - wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") ); - - M_DIR->Rewind(); - - M_DIR->SetFileSpec(filespec); - M_DIR->SetFlags(flags); - - return GetNext(filename); -} - -bool wxDir::GetNext(wxString *filename) const -{ - wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") ); - - wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") ); - - return M_DIR->Read(filename); -} diff --git a/src/mac/classic/display.cpp b/src/mac/classic/display.cpp deleted file mode 100644 index 8786306211..0000000000 --- a/src/mac/classic/display.cpp +++ /dev/null @@ -1,446 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: display.cpp -// Purpose: Mac implementation of wxDisplay class -// Author: Brian Victor -// Modified by: Royce Mitchell III & Ryan Norton -// Created: 06/21/02 -// RCS-ID: $Id$ -// Copyright: (c) wxWindows team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "display.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DISPLAY - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" - #include "wx/msgdlg.h" -#endif - -#ifdef __DARWIN__ - #include -#else - #include - #include - #include - #include //for VDSwitchInfoRec - #include -#endif - -#include "wx/display.h" -#include "wx/gdicmn.h" -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxDisplayMacPriv -{ -public: - GDHandle m_hndl; -}; - -size_t wxDisplayBase::GetCount() -{ - GDHandle hndl; - size_t num = 0; - hndl = DMGetFirstScreenDevice(true); - while(hndl) - { - num++; - hndl = DMGetNextScreenDevice(hndl, true); - } - return num; -} - -int wxDisplayBase::GetFromPoint(const wxPoint &p) -{ - GDHandle hndl; - size_t num = 0; - hndl = DMGetFirstScreenDevice(true); - while(hndl) - { - Rect screenrect = (*hndl)->gdRect; - if (p.x >= screenrect.left && - p.x <= screenrect.right && - p.y >= screenrect.top && - p.y <= screenrect.bottom) - { - return num; - } - num++; - hndl = DMGetNextScreenDevice(hndl, true); - } - return -1; -} - -wxDisplay::wxDisplay(size_t index) : wxDisplayBase ( index ), - m_priv ( new wxDisplayMacPriv() ) -{ - GDHandle hndl; - hndl = DMGetFirstScreenDevice(true); - m_priv->m_hndl = NULL; - while(hndl) - { - if (index == 0) - { - m_priv->m_hndl = hndl; - } - index--; - hndl = DMGetNextScreenDevice(hndl, true); - } -} - -wxRect wxDisplay::GetGeometry() const -{ - if (!(m_priv)) return wxRect(0, 0, 0, 0); - if (!(m_priv->m_hndl)) return wxRect(0, 0, 0, 0); - Rect screenrect = (*(m_priv->m_hndl))->gdRect; - return wxRect( screenrect.left, screenrect.top, - screenrect.right - screenrect.left, screenrect.bottom - screenrect.top); -} - -int wxDisplay::GetDepth() const -{ - if (!(m_priv)) return 0; - if (!(m_priv->m_hndl)) return 0; - - // This cryptic looking code is based on Apple's sample code: - // http://developer.apple.com/samplecode/Sample_Code/Graphics_2D/GDevVideo/Gen.cp.htm - - //RN - according to the docs - //gdPMap is a bitmap-type representation of the GDevice, and all - //0x0000FFFF does is get the lower 16 bits of pixelSize. However, - //since pixelSize is only 16 bits (a short)... - return ((*(*(m_priv->m_hndl))->gdPMap)->pixelSize) & 0x0000FFFF; -} - -wxString wxDisplay::GetName() const -{ - // Macs don't name their displays... - return wxEmptyString; -} - -struct DMModeIteratorRec -{ - wxArrayVideoModes* pModes; - const wxVideoMode* pMatchMode; -}; - -pascal void DMModeListIteratorProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeIteratorRec* pInfoData = (DMModeIteratorRec*) pData; - - //Note that in testing the refresh rate is always 0 on my ibook - RN - int refresh = (int) Fix2Long(pInfo->displayModeResolutionInfo->csRefreshRate); - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - - if (wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - refresh).Matches(*pInfoData->pMatchMode) ) - { - pInfoData->pModes->Add(wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - refresh)); - } -#undef pDBI - } -} - -struct DMModeInfoRec -{ - const wxVideoMode* pMode; - VDSwitchInfoRec sMode; - bool bMatched; -}; - -pascal void DMModeInfoProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeInfoRec* pInfoData = (DMModeInfoRec*) pData; - Fixed refresh = Long2Fix(pInfoData->pMode->refresh); - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - if (pInfoData->pMode->w == (int&) pInfo->displayModeResolutionInfo->csHorizontalPixels && - pInfoData->pMode->h == (int&) pInfo->displayModeResolutionInfo->csVerticalLines && - pInfoData->pMode->bpp == (int) pDBI->vpPixelSize && - refresh == pInfo->displayModeResolutionInfo->csRefreshRate) - { - memcpy(&pInfoData->sMode, pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthSwitchInfo, - sizeof(VDSwitchInfoRec)); - pInfoData->sMode.csMode = pDBI->vpPixelSize; - pInfoData->bMatched = true; - break; - } -#undef pDBI - } -} - -struct DMModeTransRec -{ - wxVideoMode Mode; - const VDSwitchInfoRec* psMode; - bool bMatched; -}; - -pascal void DMModeTransProc ( void* pData, - DMListIndexType nIndex, - DMDisplayModeListEntryPtr pInfo) -{ - DMModeTransRec* pInfoData = (DMModeTransRec*) pData; - - for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i) - { -#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock - if (pInfoData->psMode->csData == pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthSwitchInfo->csData) - { - pInfoData->Mode = wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels, - (int) pInfo->displayModeResolutionInfo->csVerticalLines, - (int) pDBI->vpPixelSize, - (int) Fix2Long(pInfo->displayModeResolutionInfo->csRefreshRate) ); - pInfoData->bMatched = true; - break; - } -#undef pDBI - } -} - -wxArrayVideoModes - wxDisplay::GetModes(const wxVideoMode& mode) const -{ - - wxArrayVideoModes Modes; - - unsigned long dwDMVer; - Gestalt(gestaltDisplayMgrVers, (long*) &dwDMVer); - - //Check DM version (for backward compatibility only - 7.5.3+ use 2.0) - if (dwDMVer >= 0x020000) //version 2? - { - - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeListIteratorProc); - wxASSERT(uppMLI); - - DMModeIteratorRec sModeInfo; - sModeInfo.pModes = &Modes; - sModeInfo.pMatchMode = &mode; - for (DMListIndexType i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - } - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - } - else //DM 1.0, 1.2, 1.x - { - wxLogSysError(wxString::Format(wxT("Display Manager Version %u Not Supported! Present? %s"), - (unsigned int) dwDMVer / 0x10000, - (dwDMVer & (1 << gestaltDisplayMgrPresent) ? wxT("Yes") : wxT("No")) ) - ); - } - - return Modes; -} - -wxVideoMode wxDisplay::GetCurrentMode() const -{ - unsigned long dwDMVer; - wxVideoMode RetMode; - - Gestalt(gestaltDisplayMgrVers, (long*) &dwDMVer); - //Check DM version (for backward compatibility only - 7.5.3+ use 2.0) - if (dwDMVer >= 0x020000) //version 2? - { - VDSwitchInfoRec sMode; //Note - csMode member also contains the bit depth - if (DMGetDisplayMode(m_priv->m_hndl, &sMode) == noErr) - { - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeTransProc); - wxASSERT(uppMLI); - - DMModeTransRec sModeInfo; - sModeInfo.bMatched = false; - sModeInfo.psMode = &sMode; - for (DMListIndexType i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - - if ( sModeInfo.bMatched == true ) - { - RetMode = sModeInfo.Mode; - break; - } - } - - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - } - else //Can't get current mode? - { - wxLogSysError(wxString::Format(wxT("Couldn't obtain current display mode!!!\ndwDMVer:%u"), - (unsigned int) dwDMVer)); - } - } - else //DM ver 1 - { - wxLogSysError(wxString::Format(wxT("Display Manager Version %u Not Supported! Present? %s"), - (unsigned int) dwDMVer / 0x10000, - (dwDMVer & (1 << gestaltDisplayMgrPresent) ? wxT("Yes") : wxT("No")) ) - ); - } - - return RetMode; -} - -bool wxDisplay::ChangeMode(const wxVideoMode& mode) -{ - unsigned long dwDMVer; - Gestalt(gestaltDisplayMgrVers, (long*)&dwDMVer); - if (GetCount() == 1 || dwDMVer >= 0x020000) - { - if (mode == wxDefaultVideoMode) - { -//#ifndef __DARWIN__ -// Handle hDisplayState; -// if (DMBeginConfigureDisplays(&hDisplayState) != noErr) -// { -// wxLogSysError(wxT("Could not lock display for display mode changing!")); -// return false; -// } -// wxASSERT( DMUseScreenPrefs(true, hDisplayState) == noErr); -// DMEndConfigureDisplays(hDisplayState); -// return true; -//#else - //hmmmmm.... - return true; -//#endif - } - - //0 & NULL for params 2 & 3 of DMSetVideoMode signal it to use defaults (current mode) - //DM 2.0+ doesn't use params 2 & 3 of DMSetDisplayMode - //so we have to use this icky structure - VDSwitchInfoRec sMode; - memset(&sMode, 0, sizeof(VDSwitchInfoRec) ); - - DMListIndexType nNumModes; - DMListType pModes; - DMDisplayModeListIteratorUPP uppMLI; - DisplayIDType nDisplayID; - - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); - //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); - - uppMLI = NewDMDisplayModeListIteratorUPP(DMModeInfoProc); - wxASSERT(uppMLI); - - DMModeInfoRec sModeInfo; - sModeInfo.bMatched = false; - sModeInfo.pMode = &mode; - unsigned int i; - for(i = 0; i < nNumModes; ++i) - { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); - if (sModeInfo.bMatched == true) - { - sMode = sModeInfo.sMode; - break; - } - } - if(i == nNumModes) - return false; - - DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); - - // For the really paranoid - - // unsigned long flags; - // Boolean bok; - // wxASSERT(noErr == DMCheckDisplayMode(m_priv->m_hndl, sMode.csData, - // sMode.csMode, &flags, NULL, &bok)); - // wxASSERT(bok); - - Handle hDisplayState; - if (DMBeginConfigureDisplays(&hDisplayState) != noErr) - { - wxLogSysError(wxT("Could not lock display for display mode changing!")); - return false; - } - - unsigned long dwBPP = (unsigned long) mode.bpp; - if (DMSetDisplayMode(m_priv->m_hndl, sMode.csData, - (unsigned long*) &(dwBPP), NULL - //(unsigned long) &sMode - , hDisplayState - ) != noErr) - { - DMEndConfigureDisplays(hDisplayState); - wxMessageBox(wxString::Format(wxT("Could not set the display mode"))); - return false; - } - DMEndConfigureDisplays(hDisplayState); - } - else //DM 1.0, 1.2, 1.x - { - wxLogSysError(wxString::Format(wxT("Monitor gravitation not supported yet. dwDMVer:%u"), - (unsigned int) dwDMVer)); - return false; - } - - return true; -} - -wxDisplay::~wxDisplay() -{ - if ( m_priv ) - { - delete m_priv; - m_priv = 0; - } -} - -#endif // wxUSE_DISPLAY diff --git a/src/mac/classic/dnd.cpp b/src/mac/classic/dnd.cpp deleted file mode 100644 index 22ced39ede..0000000000 --- a/src/mac/classic/dnd.cpp +++ /dev/null @@ -1,607 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dnd.cpp -// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "dnd.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_DRAG_AND_DROP - -#include "wx/dnd.h" -#include "wx/window.h" -#include "wx/toplevel.h" -#include "wx/app.h" -#include "wx/gdicmn.h" -#include "wx/mac/private.h" - -// ---------------------------------------------------------------------------- -// global -// ---------------------------------------------------------------------------- - -void wxMacEnsureTrackingHandlersInstalled() ; - -typedef struct -{ - wxWindow* m_currentTargetWindow ; - wxDropTarget* m_currentTarget ; - wxDropSource* m_currentSource ; -} MacTrackingGlobals ; - -MacTrackingGlobals gTrackingGlobals ; - -//---------------------------------------------------------------------------- -// wxDropTarget -//---------------------------------------------------------------------------- - -wxDropTarget::wxDropTarget( wxDataObject *data ) - : wxDropTargetBase( data ) -{ - wxMacEnsureTrackingHandlersInstalled() ; -} - -wxDragResult wxDropTarget::OnDragOver( wxCoord WXUNUSED(x), - wxCoord WXUNUSED(y), - wxDragResult def ) -{ - - return CurrentDragHasSupportedFormat() ? def : wxDragNone; -} - -bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) ) -{ - if (!m_dataObject) - return FALSE; - - return CurrentDragHasSupportedFormat() ; -} - -wxDragResult wxDropTarget::OnData( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - wxDragResult def ) -{ - if (!m_dataObject) - return wxDragNone; - - if (!CurrentDragHasSupportedFormat()) - return wxDragNone; - - return GetData() ? def : wxDragNone; -} - -bool wxDropTarget::CurrentDragHasSupportedFormat() -{ - bool supported = false ; - if ( gTrackingGlobals.m_currentSource != NULL ) - { - wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject() ; - - if ( data ) - { - size_t formatcount = data->GetFormatCount() ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - data->GetAllFormats( array ); - for (size_t i = 0; !supported && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_dataObject->IsSupported( format ) ) - { - supported = true ; - break ; - } - } - delete[] array ; - } - } - if ( !supported ) - { - UInt16 items ; - OSErr result; - CountDragItems((DragReference)m_currentDrag, &items); - for (UInt16 index = 1; index <= items && supported == false ; ++index) - { - ItemReference theItem; - FlavorType theType ; - UInt16 flavors = 0 ; - GetDragItemReferenceNumber((DragReference)m_currentDrag, index, &theItem); - CountDragItemFlavors( (DragReference)m_currentDrag, theItem , &flavors ) ; - for ( UInt16 flavor = 1 ; flavor <= flavors ; ++flavor ) - { - result = GetFlavorType((DragReference)m_currentDrag, theItem, flavor , &theType); - if ( m_dataObject->IsSupportedFormat( wxDataFormat( theType ) ) ) - { - supported = true ; - break ; - } - } - } - } - return supported ; -} - -bool wxDropTarget::GetData() -{ - if (!m_dataObject) - return FALSE; - - if ( !CurrentDragHasSupportedFormat() ) - return FALSE ; - - bool transferred = false ; - if ( gTrackingGlobals.m_currentSource != NULL ) - { - wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject() ; - - if ( data ) - { - size_t formatcount = data->GetFormatCount() ; - wxDataFormat *array = new wxDataFormat[ formatcount ]; - data->GetAllFormats( array ); - for (size_t i = 0; !transferred && i < formatcount ; i++) - { - wxDataFormat format = array[i] ; - if ( m_dataObject->IsSupported( format ) ) - { - int size = data->GetDataSize( format ); - transferred = true ; - - if (size == 0) - { - m_dataObject->SetData(format , 0 , 0 ) ; - } - else - { - char *d = new char[size]; - data->GetDataHere( format , (void*) d ); - m_dataObject->SetData( format , size , d ) ; - delete[] d ; - } - } - } - delete[] array ; - } - } - if ( !transferred ) - { - UInt16 items ; - OSErr result; - bool firstFileAdded = false ; - CountDragItems((DragReference)m_currentDrag, &items); - for (UInt16 index = 1; index <= items; ++index) - { - ItemReference theItem; - FlavorType theType ; - UInt16 flavors = 0 ; - GetDragItemReferenceNumber((DragReference)m_currentDrag, index, &theItem); - CountDragItemFlavors( (DragReference)m_currentDrag, theItem , &flavors ) ; - for ( UInt16 flavor = 1 ; flavor <= flavors ; ++flavor ) - { - result = GetFlavorType((DragReference)m_currentDrag, theItem, flavor , &theType); - wxDataFormat format(theType) ; - if ( m_dataObject->IsSupportedFormat( format ) ) - { - FlavorFlags theFlags; - result = GetFlavorFlags((DragReference)m_currentDrag, theItem, theType, &theFlags); - if (result == noErr) - { - Size dataSize ; - Ptr theData ; - GetFlavorDataSize((DragReference)m_currentDrag, theItem, theType, &dataSize); - if ( theType == 'TEXT' ) - { - // this increment is only valid for allocating, on the next GetFlavorData - // call it is reset again to the original value - dataSize++ ; - } - theData = new char[dataSize]; - GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L); - if( theType == 'TEXT' ) - { - theData[dataSize]=0 ; - wxString convert( theData , wxConvLocal ) ; - m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert ); - } - else if ( theType == kDragFlavorTypeHFS ) - { - HFSFlavor* theFile = (HFSFlavor*) theData ; - wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ) ; - if ( firstFileAdded ) - ((wxFileDataObject*)m_dataObject)->AddFile( name ) ; - else - { - ((wxFileDataObject*)m_dataObject)->SetData( 0 , name.c_str() ) ; - firstFileAdded = true ; - } - } - else - { - m_dataObject->SetData( format, dataSize, theData ); - } - delete[] theData; - } - break ; - } - } - } - } - return TRUE ; -} - -//------------------------------------------------------------------------- -// wxDropSource -//------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// drag request - -wxDropSource::wxDropSource(wxWindow *win, - const wxCursor &cursorCopy, - const wxCursor &cursorMove, - const wxCursor &cursorStop) - : wxDropSourceBase(cursorCopy, cursorMove, cursorStop) -{ - wxMacEnsureTrackingHandlersInstalled() ; - m_window = win; -} - -wxDropSource::wxDropSource(wxDataObject& data, - wxWindow *win, - const wxCursor &cursorCopy, - const wxCursor &cursorMove, - const wxCursor &cursorStop) - : wxDropSourceBase(cursorCopy, cursorMove, cursorStop) -{ - wxMacEnsureTrackingHandlersInstalled() ; - SetData( data ); - m_window = win; -} - -wxDropSource::~wxDropSource() -{ -} - - -wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) -{ - wxASSERT_MSG( m_data, wxT("Drop source: no data") ); - - if (!m_data) - return (wxDragResult) wxDragNone; - - if (m_data->GetFormatCount() == 0) - return (wxDragResult) wxDragNone; - - OSErr result; - DragReference theDrag; - RgnHandle dragRegion; - if ((result = NewDrag(&theDrag))) - { - return wxDragNone ; - } - // add data to drag - size_t formatCount = m_data->GetFormatCount() ; - wxDataFormat *formats = new wxDataFormat[formatCount] ; - m_data->GetAllFormats( formats ) ; - ItemReference theItem = 1 ; - for ( size_t i = 0 ; i < formatCount ; ++i ) - { - size_t dataSize = m_data->GetDataSize( formats[i] ) ; - Ptr dataPtr = new char[dataSize] ; - m_data->GetDataHere( formats[i] , dataPtr ) ; - OSType type = formats[i].GetFormatId() ; - if ( type == 'TEXT' ) - { - dataSize-- ; - dataPtr[ dataSize ] = 0 ; - wxString st( (wxChar*) dataPtr ) ; - wxCharBuffer buf = st.mb_str( wxConvLocal) ; - AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0); - } - else if (type == kDragFlavorTypeHFS ) - { - HFSFlavor theFlavor ; - OSErr err = noErr; - CInfoPBRec cat; - - wxMacFilename2FSSpec( dataPtr , &theFlavor.fileSpec ) ; - - cat.hFileInfo.ioNamePtr = theFlavor.fileSpec.name; - cat.hFileInfo.ioVRefNum = theFlavor.fileSpec.vRefNum; - cat.hFileInfo.ioDirID = theFlavor.fileSpec.parID; - cat.hFileInfo.ioFDirIndex = 0; - err = PBGetCatInfoSync(&cat); - if (err == noErr ) - { - theFlavor.fdFlags = cat.hFileInfo.ioFlFndrInfo.fdFlags; - if (theFlavor.fileSpec.parID == fsRtParID) { - theFlavor.fileCreator = 'MACS'; - theFlavor.fileType = 'disk'; - } else if ((cat.hFileInfo.ioFlAttrib & ioDirMask) != 0) { - theFlavor.fileCreator = 'MACS'; - theFlavor.fileType = 'fold'; - } else { - theFlavor.fileCreator = cat.hFileInfo.ioFlFndrInfo.fdCreator; - theFlavor.fileType = cat.hFileInfo.ioFlFndrInfo.fdType; - } - AddDragItemFlavor(theDrag, theItem, type , &theFlavor, sizeof(theFlavor), 0); - } - } - else - { - AddDragItemFlavor(theDrag, theItem, type , dataPtr, dataSize, 0); - } - delete[] dataPtr ; - } - delete[] formats ; - - dragRegion = NewRgn(); - RgnHandle tempRgn = NewRgn() ; - - EventRecord* ev = NULL ; -#if !TARGET_CARBON // TODO - ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; -#else - EventRecord rec ; - ev = &rec ; - wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ; -#endif - const short dragRegionOuterBoundary = 10 ; - const short dragRegionInnerBoundary = 9 ; - - SetRectRgn( dragRegion , ev->where.h - dragRegionOuterBoundary , - ev->where.v - dragRegionOuterBoundary , - ev->where.h + dragRegionOuterBoundary , - ev->where.v + dragRegionOuterBoundary ) ; - - SetRectRgn( tempRgn , ev->where.h - dragRegionInnerBoundary , - ev->where.v - dragRegionInnerBoundary , - ev->where.h + dragRegionInnerBoundary , - ev->where.v + dragRegionInnerBoundary ) ; - - DiffRgn( dragRegion , tempRgn , dragRegion ) ; - DisposeRgn( tempRgn ) ; - - // TODO:work with promises in order to return data only when drag - // was successfully completed - - gTrackingGlobals.m_currentSource = this ; - result = TrackDrag(theDrag, ev , dragRegion); - DisposeRgn(dragRegion); - DisposeDrag(theDrag); - gTrackingGlobals.m_currentSource = NULL ; - - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult dndresult = optionDown ? wxDragCopy : wxDragMove; - return dndresult; -} - -bool wxDropSource::MacInstallDefaultCursor(wxDragResult effect) -{ - const wxCursor& cursor = GetCursor(effect); - if ( cursor.Ok() ) - { - cursor.MacInstall() ; - - return TRUE; - } - else - { - return FALSE; - } -} - -bool gTrackingGlobalsInstalled = false ; - -// passing the globals via refcon is not needed by the CFM and later architectures anymore -// but I'll leave it in there, just in case... - -pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow, - void *handlerRefCon, DragReference theDrag) ; -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, -DragReference theDrag) ; - -void wxMacEnsureTrackingHandlersInstalled() -{ - if( !gTrackingGlobalsInstalled ) - { - OSErr result; - - result = InstallTrackingHandler(NewDragTrackingHandlerUPP(wxMacWindowDragTrackingHandler), 0L,&gTrackingGlobals); - wxASSERT( result == noErr ) ; - result = InstallReceiveHandler(NewDragReceiveHandlerUPP(wxMacWindowDragReceiveHandler), 0L, &gTrackingGlobals); - wxASSERT( result == noErr ) ; - - gTrackingGlobalsInstalled = true ; - } -} - -pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow, - void *handlerRefCon, DragReference theDrag) -{ - MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; - Point mouse, localMouse; - DragAttributes attributes; - GetDragAttributes(theDrag, &attributes); - wxTopLevelWindowMac* toplevel = wxFindWinFromMacWindow( theWindow ) ; - - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult result = optionDown ? wxDragCopy : wxDragMove; - - switch(theMessage) - { - case kDragTrackingEnterHandler: - break; - case kDragTrackingLeaveHandler: - break; - case kDragTrackingEnterWindow: - trackingGlobals->m_currentTargetWindow = NULL ; - trackingGlobals->m_currentTarget = NULL ; - break; - case kDragTrackingInWindow: - if (toplevel == NULL) - break; - - GetDragMouse(theDrag, &mouse, 0L); - localMouse = mouse; - GlobalToLocal(&localMouse); - - - -// if (attributes & kDragHasLeftSenderWindow) - { - wxPoint point(localMouse.h , localMouse.v) ; - wxWindow *win = NULL ; - toplevel->MacGetWindowFromPointSub( point , &win ) ; - int localx , localy ; - localx = localMouse.h ; - localy = localMouse.v ; - //TODO : should we use client coordinates - if ( win ) - win->MacRootWindowToWindow( &localx , &localy ) ; - if ( win != trackingGlobals->m_currentTargetWindow ) - { - if ( trackingGlobals->m_currentTargetWindow ) - { - // this window is left - if ( trackingGlobals->m_currentTarget ) - { - HideDragHilite(theDrag); - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnLeave() ; - trackingGlobals->m_currentTarget = NULL; - trackingGlobals->m_currentTargetWindow = NULL ; - } - } - if ( win ) - { - // this window is entered - trackingGlobals->m_currentTargetWindow = win ; - trackingGlobals->m_currentTarget = win->GetDropTarget() ; - { - - if ( trackingGlobals->m_currentTarget ) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - result = trackingGlobals->m_currentTarget->OnEnter( - localx , localy , result ) ; - } - - - if ( result != wxDragNone ) - { - int x , y ; - x = y = 0 ; - win->MacWindowToRootWindow( &x , &y ) ; - RgnHandle hiliteRgn = NewRgn() ; - SetRectRgn( hiliteRgn , x , y , x+win->GetSize().x ,y+win->GetSize().y) ; - ShowDragHilite(theDrag, hiliteRgn, true); - DisposeRgn( hiliteRgn ) ; - } - } - } - } - else - { - if( trackingGlobals->m_currentTarget ) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnDragOver( - localx , localy , result ) ; - } - } - - // set cursor for OnEnter and OnDragOver - if ( trackingGlobals->m_currentSource && trackingGlobals->m_currentSource->GiveFeedback( result ) == FALSE ) - { - if ( trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) == FALSE ) - { - switch( result ) - { - case wxDragCopy : - { - wxCursor cursor(wxCURSOR_COPY_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragMove : - { - wxCursor cursor(wxCURSOR_ARROW) ; - cursor.MacInstall() ; - } - break ; - case wxDragNone : - { - wxCursor cursor(wxCURSOR_NO_ENTRY) ; - cursor.MacInstall() ; - } - break ; - - case wxDragError: - case wxDragLink: - case wxDragCancel: - // put these here to make gcc happy - ; - } - } - } - - } - // MyTrackItemUnderMouse(localMouse, theWindow); - break; - case kDragTrackingLeaveWindow: - if (trackingGlobals->m_currentTarget) - { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - trackingGlobals->m_currentTarget->OnLeave() ; - HideDragHilite(theDrag); - trackingGlobals->m_currentTarget = NULL ; - } - trackingGlobals->m_currentTargetWindow = NULL ; - break; - } - return(noErr); -} - -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, - void *handlerRefCon, - DragReference theDrag) -{ - MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; - if ( trackingGlobals->m_currentTarget ) - { - Point mouse,localMouse ; - int localx,localy ; - - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ) ; - GetDragMouse(theDrag, &mouse, 0L); - localMouse = mouse; - GlobalToLocal(&localMouse); - localx = localMouse.h ; - localy = localMouse.v ; - //TODO : should we use client coordinates - if ( trackingGlobals->m_currentTargetWindow ) - trackingGlobals->m_currentTargetWindow->MacRootWindowToWindow( &localx , &localy ) ; - if ( trackingGlobals->m_currentTarget->OnDrop( localx , localy ) ) - { - KeyMap keymap; - GetKeys(keymap); - bool optionDown = keymap[1] & 4; - wxDragResult result = optionDown ? wxDragCopy : wxDragMove; - trackingGlobals->m_currentTarget->OnData( localx , localy , result ) ; - } - } - return(noErr); -} -#endif diff --git a/src/mac/classic/filedlg.cpp b/src/mac/classic/filedlg.cpp deleted file mode 100644 index 59807f398d..0000000000 --- a/src/mac/classic/filedlg.cpp +++ /dev/null @@ -1,647 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: filedlg.cpp -// Purpose: wxFileDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "filedlg.h" -#endif - -#include "wx/defs.h" -#include "wx/app.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/filedlg.h" -#include "wx/intl.h" -#include "wx/tokenzr.h" -#include "wx/filename.h" - -#ifndef __DARWIN__ - #include "PLStringFuncs.h" -#endif - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase) -#endif - -// begin wxmac - -#include "wx/mac/private.h" - -#include - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -extern bool gUseNavServices ; - -// the data we need to pass to our standard file hook routine -// includes a pointer to the dialog, a pointer to the standard -// file reply record (so we can inspect the current selection) -// and a copy of the "previous" file spec of the reply record -// so we can see if the selection has changed - -struct OpenUserDataRec { - int currentfilter ; - bool saveMode ; - wxArrayString name ; - wxArrayString extensions ; - wxArrayLong filtermactypes ; - wxString defaultLocation; -#if TARGET_CARBON - CFArrayRef menuitems ; -#else - NavMenuItemSpecArrayHandle menuitems ; -#endif -}; - -typedef struct OpenUserDataRec -OpenUserDataRec, *OpenUserDataRecPtr; - -static pascal void NavEventProc( - NavEventCallbackMessage inSelector, - NavCBRecPtr ioParams, - NavCallBackUserData ioUserData); - -#if TARGET_CARBON - static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc); -#else - static NavEventUPP sStandardNavEventFilter = NewNavEventProc(NavEventProc); -#endif - -static pascal void -NavEventProc( - NavEventCallbackMessage inSelector, - NavCBRecPtr ioParams, - NavCallBackUserData ioUserData ) -{ - OpenUserDataRec * data = ( OpenUserDataRec *) ioUserData ; - if (inSelector == kNavCBEvent) { -#if TARGET_CARBON -#else - wxTheApp->MacHandleOneEvent(ioParams->eventData.eventDataParms.event); -#endif - } - else if ( inSelector == kNavCBStart ) - { -#if TARGET_CARBON - if (data && !(data->defaultLocation).IsEmpty()) - { - // Set default location for the modern Navigation APIs - // Apple Technical Q&A 1151 - FSSpec theFSSpec; - wxMacFilename2FSSpec(data->defaultLocation, &theFSSpec); - AEDesc theLocation = {typeNull, NULL}; - if (noErr == ::AECreateDesc(typeFSS, &theFSSpec, sizeof(FSSpec), &theLocation)) - ::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation); - } -#else - if ( data->menuitems ) - NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &(*data->menuitems)[data->currentfilter]); -#endif - } - else if ( inSelector == kNavCBPopupMenuSelect ) - { - NavMenuItemSpec * menu = (NavMenuItemSpec *) ioParams->eventData.eventDataParms.param ; -#if TARGET_CARBON -#else - if ( menu->menuCreator == 'WXNG' ) -#endif - { - data->currentfilter = menu->menuType ; - if ( data->saveMode ) - { - int i = menu->menuType ; - wxString extension = data->extensions[i].AfterLast('.') ; - extension.MakeLower() ; - wxString sfilename ; - -#if TARGET_CARBON - wxMacCFStringHolder cfString( NavDialogGetSaveFileName( ioParams->context ) , false ); - sfilename = cfString.AsString() ; -#else - Str255 filename ; - // get the current filename - NavCustomControl(ioParams->context, kNavCtlGetEditFileName, &filename); - sfilename = wxMacMakeStringFromPascal( filename ) ; -#endif - - int pos = sfilename.Find('.', true) ; - if ( pos != wxNOT_FOUND ) - { - sfilename = sfilename.Left(pos+1)+extension ; -#if TARGET_CARBON - cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ; - NavDialogSetSaveFileName( ioParams->context , cfString ) ; -#else - wxMacStringToPascal( sfilename , filename ) ; - NavCustomControl(ioParams->context, kNavCtlSetEditFileName, &filename); -#endif - } - } - } - } -} - - -void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter ) -{ - myData->menuitems = NULL ; - myData->currentfilter = 0 ; - myData->saveMode = false ; - - if ( filter && filter[0] ) - { - wxString filter2(filter) ; - int filterIndex = 0; - bool isName = true ; - wxString current ; - for( unsigned int i = 0; i < filter2.Len() ; i++ ) - { - if( filter2.GetChar(i) == wxT('|') ) - { - if( isName ) { - myData->name.Add( current ) ; - } - else { - myData->extensions.Add( current.MakeUpper() ) ; - ++filterIndex ; - } - isName = !isName ; - current = wxEmptyString ; - } - else - { - current += filter2.GetChar(i) ; - } - } - // we allow for compatibility reason to have a single filter expression (like *.*) without - // an explanatory text, in that case the first part is name and extension at the same time - - wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ; - if ( current.IsEmpty() ) - myData->extensions.Add( myData->name[filterIndex] ) ; - else - myData->extensions.Add( current.MakeUpper() ) ; - if ( filterIndex == 0 || isName ) - myData->name.Add( current.MakeUpper() ) ; - - ++filterIndex ; - - const size_t extCount = myData->extensions.GetCount(); - for ( size_t i = 0 ; i < extCount; i++ ) - { - wxUint32 fileType; - wxUint32 creator; - wxString extension = myData->extensions[i]; - - if (extension.GetChar(0) == '*') - extension = extension.Mid(1); // Remove leading * - - if (extension.GetChar(0) == '.') - { - extension = extension.Mid(1); // Remove leading . - } - - if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator )) - { - myData->filtermactypes.Add( (OSType)fileType ); - } - else - { - myData->filtermactypes.Add( '****' ) ; // We'll fail safe if it's not recognized - } - } - } -} - -static Boolean CheckFile( const wxString &filename , OSType type , OpenUserDataRecPtr data) -{ - wxString file(filename) ; - file.MakeUpper() ; - - if ( data->extensions.GetCount() > 0 ) - { - //for ( int i = 0 ; i < data->numfilters ; ++i ) - int i = data->currentfilter ; - if ( data->extensions[i].Right(2) == wxT(".*") ) - return true ; - - { - if ( type == (OSType)data->filtermactypes[i] ) - return true ; - - wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ; - while( tokenizer.HasMoreTokens() ) - { - wxString extension = tokenizer.GetNextToken() ; - if ( extension.GetChar(0) == '*' ) - extension = extension.Mid(1) ; - - if ( file.Len() >= extension.Len() && extension == file.Right(extension.Len() ) ) - return true ; - } - } - return false ; - } - return true ; -} - -#ifndef __DARWIN__ -static pascal Boolean CrossPlatformFileFilter(CInfoPBPtr myCInfoPBPtr, void *dataPtr) -{ - OpenUserDataRecPtr data = (OpenUserDataRecPtr) dataPtr ; - // return true if this item is invisible or a file - - Boolean visibleFlag; - Boolean folderFlag; - - visibleFlag = ! (myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible); - folderFlag = (myCInfoPBPtr->hFileInfo.ioFlAttrib & 0x10); - - // because the semantics of the filter proc are "true means don't show - // it" we need to invert the result that we return - - if ( !visibleFlag ) - return true ; - - if ( !folderFlag ) - { - wxString file = wxMacMakeStringFromPascal( myCInfoPBPtr->hFileInfo.ioNamePtr ) ; - return !CheckFile( file , myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdType , data ) ; - } - - return false ; -} -#endif - -// end wxmac - -wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, - const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard, - long style, const wxPoint& pos) - :wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos) -{ - wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ; -} - -pascal Boolean CrossPlatformFilterCallback ( - AEDesc *theItem, - void *info, - void *callBackUD, - NavFilterModes filterMode -) -{ - bool display = true; - OpenUserDataRecPtr data = (OpenUserDataRecPtr) callBackUD ; - - if (filterMode == kNavFilteringBrowserList) - { - NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ; - if ( !theInfo->isFolder ) - { - if (theItem->descriptorType == typeFSS ) - { - FSSpec spec; - memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ; - wxString file = wxMacMakeStringFromPascal( spec.name ) ; - display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; - } - #if TARGET_CARBON - else if ( theItem->descriptorType == typeFSRef ) - { - FSRef fsref ; - memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ; - - - - CFURLRef fullURLRef; - fullURLRef = ::CFURLCreateFromFSRef(NULL, &fsref); -#ifdef __UNIX__ - CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; -#else - CFURLPathStyle pathstyle = kCFURLHFSPathStyle; -#endif - CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); - ::CFRelease( fullURLRef ) ; - wxString file = wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding()); - - display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; - } -#endif - } - } - - return display; -} - -int wxFileDialog::ShowModal() -{ -#if TARGET_CARBON - OSErr err; - NavDialogCreationOptions dialogCreateOptions; - // set default options - ::NavGetDefaultDialogCreationOptions(&dialogCreateOptions); - - // this was always unset in the old code - dialogCreateOptions.optionFlags &= ~kNavSelectDefaultLocation; - - wxMacCFStringHolder message(m_message, m_font.GetEncoding()); - dialogCreateOptions.windowTitle = message; - - wxMacCFStringHolder defaultFileName(m_fileName, m_font.GetEncoding()); - dialogCreateOptions.saveFileName = defaultFileName; - - - NavDialogRef dialog; - NavObjectFilterUPP navFilterUPP = NULL; - CFArrayRef cfArray = NULL; // for popupExtension - OpenUserDataRec myData; - myData.defaultLocation = m_dir; - - if (m_dialogStyle & wxSAVE) - { - dialogCreateOptions.optionFlags |= kNavNoTypePopup; - dialogCreateOptions.optionFlags |= kNavDontAutoTranslate; - dialogCreateOptions.optionFlags |= kNavDontAddTranslateItems; - - // The extension is important - dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension; - - err = ::NavCreatePutFileDialog(&dialogCreateOptions, - 'TEXT', - 'TEXT', - sStandardNavEventFilter, - &myData, // for defaultLocation - &dialog); - } - else - { - MakeUserDataRec(&myData , m_wildCard); - size_t numfilters = myData.extensions.GetCount(); - if (numfilters > 0) - { - CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault , - numfilters , &kCFTypeArrayCallBacks ) ; - dialogCreateOptions.popupExtension = popup ; - myData.menuitems = dialogCreateOptions.popupExtension ; - for ( size_t i = 0 ; i < numfilters ; ++i ) - { - CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] , m_font.GetEncoding() ) ) ; - } - } - - navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback); - err = ::NavCreateGetFileDialog(&dialogCreateOptions, - NULL, // NavTypeListHandle - sStandardNavEventFilter, - NULL, // NavPreviewUPP - navFilterUPP, - (void *) &myData, // inClientData - &dialog); - } - - if (err == noErr) - err = ::NavDialogRun(dialog); - - // clean up filter related data, etc. - if (navFilterUPP) - ::DisposeNavObjectFilterUPP(navFilterUPP); - if (cfArray) - ::CFRelease(cfArray); - - if (err != noErr) - return wxID_CANCEL; - - NavReplyRecord navReply; - err = ::NavDialogGetReply(dialog, &navReply); - if (err == noErr && navReply.validRecord) - { - AEKeyword theKeyword; - DescType actualType; - Size actualSize; - FSRef theFSRef; - wxString thePath ; - long count; - ::AECountItems(&navReply.selection , &count); - for (long i = 1; i <= count; ++i) - { - err = ::AEGetNthPtr(&(navReply.selection), i, typeFSRef, &theKeyword, &actualType, - &theFSRef, sizeof(theFSRef), &actualSize); - if (err != noErr) - break; - - CFURLRef fullURLRef; - if (m_dialogStyle & wxSAVE) - { - CFURLRef parentURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef); - - if (parentURLRef) - { - fullURLRef = - ::CFURLCreateCopyAppendingPathComponent(NULL, - parentURLRef, - navReply.saveFileName, - false); - ::CFRelease(parentURLRef); - } - } - else - { - fullURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef); - } -#ifdef __UNIX__ - CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; -#else - CFURLPathStyle pathstyle = kCFURLHFSPathStyle; -#endif - CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); - thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding()); - if (!thePath) - { - ::NavDisposeReply(&navReply); - return wxID_CANCEL; - } - m_path = thePath; - m_paths.Add(m_path); - m_fileName = wxFileNameFromPath(m_path); - m_fileNames.Add(m_fileName); - } - // set these to the first hit - m_path = m_paths[0]; - m_fileName = wxFileNameFromPath(m_path); - m_dir = wxPathOnly(m_path); - } - ::NavDisposeReply(&navReply); - - return (err == noErr) ? wxID_OK : wxID_CANCEL; -#else // TARGET_CARBON - - NavDialogOptions mNavOptions; - NavObjectFilterUPP mNavFilterUPP = NULL; - NavPreviewUPP mNavPreviewUPP = NULL ; - NavReplyRecord mNavReply; - AEDesc mDefaultLocation ; - bool mSelectDefault = false ; - OSStatus err = noErr ; - // setup dialog - - mNavFilterUPP = nil; - mNavPreviewUPP = nil; - mSelectDefault = false; - mDefaultLocation.descriptorType = typeNull; - mDefaultLocation.dataHandle = nil; - - NavGetDefaultDialogOptions(&mNavOptions); - wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ; - wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ; - - // Set default location, the location - // that's displayed when the dialog - // first appears - - FSSpec location ; - wxMacFilename2FSSpec( m_dir , &location ) ; - - err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation ); - - if ( mDefaultLocation.dataHandle ) - { - if (mSelectDefault) - { - mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; - } else { - mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; - } - } - - memset( &mNavReply , 0 , sizeof( mNavReply ) ) ; - mNavReply.validRecord = false; - mNavReply.replacing = false; - mNavReply.isStationery = false; - mNavReply.translationNeeded = false; - mNavReply.selection.descriptorType = typeNull; - mNavReply.selection.dataHandle = nil; - mNavReply.keyScript = smSystemScript; - mNavReply.fileTranslation = nil; - mNavReply.version = kNavReplyRecordVersion ; - - // zero all data - - m_path = wxEmptyString ; - m_fileName = wxEmptyString ; - m_paths.Empty(); - m_fileNames.Empty(); - - OpenUserDataRec myData; - MakeUserDataRec( &myData , m_wildCard ) ; - myData.currentfilter = m_filterIndex ; - if ( myData.extensions.GetCount() > 0 ) - { - mNavOptions.popupExtension = (NavMenuItemSpecArrayHandle) NewHandle( sizeof( NavMenuItemSpec ) * myData.extensions.GetCount() ) ; - myData.menuitems = mNavOptions.popupExtension ; - for ( size_t i = 0 ; i < myData.extensions.GetCount() ; ++i ) - { - (*mNavOptions.popupExtension)[i].version = kNavMenuItemSpecVersion ; - (*mNavOptions.popupExtension)[i].menuCreator = 'WXNG' ; - // TODO : according to the new docs -1 to 10 are reserved for the OS - (*mNavOptions.popupExtension)[i].menuType = i ; - wxMacStringToPascal( myData.name[i] , (StringPtr)(*mNavOptions.popupExtension)[i].menuItemName ) ; - } - } - if ( m_dialogStyle & wxSAVE ) - { - myData.saveMode = true ; - - mNavOptions.dialogOptionFlags |= kNavDontAutoTranslate ; - mNavOptions.dialogOptionFlags |= kNavDontAddTranslateItems ; - - err = ::NavPutFile( - &mDefaultLocation, - &mNavReply, - &mNavOptions, - sStandardNavEventFilter , - NULL, - kNavGenericSignature, - &myData); // User Data - m_filterIndex = myData.currentfilter ; - } - else - { - myData.saveMode = false ; - - mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ; - if ( m_dialogStyle & wxMULTIPLE ) - mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ; - else - mNavOptions.dialogOptionFlags &= ~kNavAllowMultipleFiles ; - - err = ::NavGetFile( - &mDefaultLocation, - &mNavReply, - &mNavOptions, - sStandardNavEventFilter , - mNavPreviewUPP, - mNavFilterUPP, - NULL , - &myData); - m_filterIndex = myData.currentfilter ; - } - - DisposeNavObjectFilterUPP(mNavFilterUPP); - if ( mDefaultLocation.dataHandle != nil ) - { - ::AEDisposeDesc(&mDefaultLocation); - } - - if ( (err != noErr) && (err != userCanceledErr) ) { - return wxID_CANCEL ; - } - - if (mNavReply.validRecord) - { - FSSpec outFileSpec ; - AEDesc specDesc ; - AEKeyword keyWord ; - - long count ; - ::AECountItems( &mNavReply.selection , &count ) ; - for ( long i = 1 ; i <= count ; ++i ) - { - OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc); - if ( err != noErr ) - { - m_path = wxT("") ; - return wxID_CANCEL ; - } - outFileSpec = **(FSSpec**) specDesc.dataHandle; - if (specDesc.dataHandle != nil) { - ::AEDisposeDesc(&specDesc); - } - m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ; - - m_paths.Add( m_path ) ; - m_fileName = wxFileNameFromPath(m_path); - m_fileNames.Add(m_fileName); - } - // set these to the first hit - m_path = m_paths[ 0 ] ; - m_fileName = wxFileNameFromPath(m_path); - m_dir = wxPathOnly(m_path); - NavDisposeReply( &mNavReply ) ; - return wxID_OK ; - } - return wxID_CANCEL; -#endif // TARGET_CARBON -} - diff --git a/src/mac/classic/font.cpp b/src/mac/classic/font.cpp deleted file mode 100644 index ef0ecc73b6..0000000000 --- a/src/mac/classic/font.cpp +++ /dev/null @@ -1,446 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: font.cpp -// Purpose: wxFont class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "font.h" -#endif - -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/font.h" -#include "wx/fontutil.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" - -#include "wx/fontutil.h" - -#include "wx/mac/private.h" -#include - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -#endif - -class WXDLLEXPORT wxFontRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxFont; -public: - wxFontRefData() - : m_fontId(0) - , m_pointSize(10) - , m_family(wxDEFAULT) - , m_style(wxNORMAL) - , m_weight(wxNORMAL) - , m_underlined(FALSE) - , m_faceName(wxT("Geneva")) - , m_encoding(wxFONTENCODING_DEFAULT) - , m_macFontNum(0) - , m_macFontSize(0) - , m_macFontStyle(0) - , m_macATSUFontID() - { - Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE, - wxT("Geneva"), wxFONTENCODING_DEFAULT); - } - - wxFontRefData(const wxFontRefData& data) - : wxGDIRefData() - , m_fontId(data.m_fontId) - , m_pointSize(data.m_pointSize) - , m_family(data.m_family) - , m_style(data.m_style) - , m_weight(data.m_weight) - , m_underlined(data.m_underlined) - , m_faceName(data.m_faceName) - , m_encoding(data.m_encoding) - , m_macFontNum(data.m_macFontNum) - , m_macFontSize(data.m_macFontSize) - , m_macFontStyle(data.m_macFontStyle) - , m_macATSUFontID(data.m_macATSUFontID) - { - Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight, - data.m_underlined, data.m_faceName, data.m_encoding); - } - - wxFontRefData(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) - : m_fontId(0) - , m_pointSize(size) - , m_family(family) - , m_style(style) - , m_weight(weight) - , m_underlined(underlined) - , m_faceName(faceName) - , m_encoding(encoding) - , m_macFontNum(0) - , m_macFontSize(0) - , m_macFontStyle(0) - , m_macATSUFontID(0) - { - Init(size, family, style, weight, underlined, faceName, encoding); - } - - virtual ~wxFontRefData(); - void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; } - bool GetNoAntiAliasing() { return m_noAA; } - -protected: - // common part of all ctors - void Init(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding); - - // font characterstics - int m_fontId; - int m_pointSize; - int m_family; - int m_style; - int m_weight; - bool m_underlined; - wxString m_faceName; - wxFontEncoding m_encoding; - bool m_noAA; // No anti-aliasing - -public: - short m_macFontNum; - short m_macFontSize; - unsigned char m_macFontStyle; - wxUint32 m_macATSUFontID; - - wxNativeFontInfo m_info; - -public: - void MacFindFont() ; -}; -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontRefData -// ---------------------------------------------------------------------------- - -void wxFontRefData::Init(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) -{ - m_style = style; - m_pointSize = pointSize; - m_family = family; - m_style = style; - m_weight = weight; - m_underlined = underlined; - m_faceName = faceName; - m_encoding = encoding; - - m_macFontNum = 0 ; - m_macFontSize = 0; - m_macFontStyle = 0; - m_fontId = 0; - m_noAA = FALSE; -} - -wxFontRefData::~wxFontRefData() -{ -} - -void wxFontRefData::MacFindFont() -{ - if( m_faceName.Length() == 0 ) - { - switch( m_family ) - { - case wxDEFAULT : - m_macFontNum = ::GetAppFont() ; - break ; - case wxDECORATIVE : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxROMAN : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxSCRIPT : - ::GetFNum( "\pTimes" , &m_macFontNum) ; - break ; - case wxSWISS : - ::GetFNum( "\pGeneva" , &m_macFontNum) ; - break ; - case wxMODERN : - ::GetFNum( "\pMonaco" , &m_macFontNum) ; - break ; - } - Str255 name ; - GetFontName( m_macFontNum , name ) ; - m_faceName = wxMacMakeStringFromPascal( name ) ; - } - else - { - if ( m_faceName == wxT("systemfont") ) - m_macFontNum = ::GetSysFont() ; - else if ( m_faceName == wxT("applicationfont") ) - m_macFontNum = ::GetAppFont() ; - else - { - Str255 fontname ; - wxMacStringToPascal( m_faceName , fontname ) ; - ::GetFNum( fontname, &m_macFontNum); - } - } - - m_macFontStyle = 0; - if (m_weight == wxBOLD) - m_macFontStyle |= bold; - if (m_style == wxITALIC || m_style == wxSLANT) - m_macFontStyle |= italic; - if (m_underlined) - m_macFontStyle |= underline; - m_macFontSize = m_pointSize ; - - //TODO:if we supply the style as an additional parameter we must make a testing - //sequence in order to degrade gracefully while trying to maintain most of the style - //information, meanwhile we just take the normal font and apply the features after -#ifdef __WXDEBUG__ - OSStatus status = -#endif // __WXDEBUG__ - ::ATSUFONDtoFontID(m_macFontNum, normal /*qdStyle*/, (UInt32*)&m_macATSUFontID); - /* - status = ATSUFindFontFromName ( (Ptr) m_faceName , strlen( m_faceName ) , - kFontFullName, kFontMacintoshPlatform, kFontRomanScript , kFontNoLanguage , (UInt32*)&m_macATSUFontID ) ; - */ - wxASSERT_MSG( status == noErr , wxT("couldn't retrieve font identifier") ) ; -} - -// ---------------------------------------------------------------------------- -// wxFont -// ---------------------------------------------------------------------------- - -void wxFont::Init() -{ -} - -bool wxFont::Create(const wxNativeFontInfo& info) -{ - return Create(info.pointSize, info.family, info.style, info.weight, - info.underlined, info.faceName, info.encoding); -} - -wxFont::wxFont(const wxString& fontdesc) -{ - wxNativeFontInfo info; - if ( info.FromString(fontdesc) ) - (void)Create(info); -} - -bool wxFont::Create(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) -{ - UnRef(); - m_refData = new wxFontRefData(pointSize, family, style, weight, - underlined, faceName, encoding); - - RealizeResource(); - - return TRUE; -} - -wxFont::~wxFont() -{ -} - -bool wxFont::RealizeResource() -{ - M_FONTDATA->MacFindFont() ; - return TRUE; -} - -void wxFont::SetEncoding(wxFontEncoding encoding) -{ - Unshare(); - - M_FONTDATA->m_encoding = encoding; - - RealizeResource(); -} - -void wxFont::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxFontRefData(); - } - else - { - wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxFont::SetPointSize(int pointSize) -{ - Unshare(); - - M_FONTDATA->m_pointSize = pointSize; - - RealizeResource(); -} - -void wxFont::SetFamily(int family) -{ - Unshare(); - - M_FONTDATA->m_family = family; - - RealizeResource(); -} - -void wxFont::SetStyle(int style) -{ - Unshare(); - - M_FONTDATA->m_style = style; - - RealizeResource(); -} - -void wxFont::SetWeight(int weight) -{ - Unshare(); - - M_FONTDATA->m_weight = weight; - - RealizeResource(); -} - -void wxFont::SetFaceName(const wxString& faceName) -{ - Unshare(); - - M_FONTDATA->m_faceName = faceName; - - RealizeResource(); -} - -void wxFont::SetUnderlined(bool underlined) -{ - Unshare(); - - M_FONTDATA->m_underlined = underlined; - - RealizeResource(); -} - -void wxFont::SetNoAntiAliasing( bool no ) -{ - Unshare(); - - M_FONTDATA->SetNoAntiAliasing( no ); - - RealizeResource(); -} - -// ---------------------------------------------------------------------------- -// accessors -// ---------------------------------------------------------------------------- - -// TODO: insert checks everywhere for M_FONTDATA == NULL! - -int wxFont::GetPointSize() const -{ - return M_FONTDATA->m_pointSize; -} - -int wxFont::GetFamily() const -{ - return M_FONTDATA->m_family; -} - -int wxFont::GetStyle() const -{ - return M_FONTDATA->m_style; -} - -int wxFont::GetWeight() const -{ - return M_FONTDATA->m_weight; -} - -bool wxFont::GetUnderlined() const -{ - return M_FONTDATA->m_underlined; -} - -wxString wxFont::GetFaceName() const -{ - wxString str; - if ( M_FONTDATA ) - str = M_FONTDATA->m_faceName ; - return str; -} - -wxFontEncoding wxFont::GetEncoding() const -{ - return M_FONTDATA->m_encoding; -} - -bool wxFont::GetNoAntiAliasing() -{ - return M_FONTDATA->m_noAA; -} - -short wxFont::GetMacFontNum() const -{ - return M_FONTDATA->m_macFontNum; -} - -short wxFont::GetMacFontSize() const -{ - return M_FONTDATA->m_macFontSize; -} - -wxByte wxFont::GetMacFontStyle() const -{ - return M_FONTDATA->m_macFontStyle; -} - -wxUint32 wxFont::GetMacATSUFontID() const -{ - return M_FONTDATA->m_macATSUFontID; -} - -const wxNativeFontInfo *wxFont::GetNativeFontInfo() const -{ - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); - - M_FONTDATA->m_info.InitFromFont(*this); - - return &(M_FONTDATA->m_info); -} - diff --git a/src/mac/classic/fontdlg.cpp b/src/mac/classic/fontdlg.cpp deleted file mode 100644 index 03c894c553..0000000000 --- a/src/mac/classic/fontdlg.cpp +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.cpp -// Purpose: wxFontDialog class. NOTE: you can use the generic class -// if you wish, instead of implementing this. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "fontdlg.h" -#endif - -#include "wx/mac/fontdlg.h" -#include "wx/cmndata.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) -#endif - -/* - * wxFontDialog - */ - -wxFontDialog::wxFontDialog() -{ - m_dialogParent = NULL; -} - -wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData& data) -{ - Create(parent, data); -} - -bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) -{ - m_dialogParent = parent; - - m_fontData = data; - - // TODO: you may need to do dialog creation here, unless it's - // done in ShowModal. - return TRUE; -} - -int wxFontDialog::ShowModal() -{ - // TODO: show (maybe create) the dialog - return wxID_CANCEL; -} - diff --git a/src/mac/classic/fontenum.cpp b/src/mac/classic/fontenum.cpp deleted file mode 100644 index 467bc95442..0000000000 --- a/src/mac/classic/fontenum.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/fontenum.cpp -// Purpose: wxFontEnumerator class for MacOS -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "fontenum.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/font.h" -#endif - -#include "wx/fontenum.h" -#include "wx/fontutil.h" -#include "wx/fontmap.h" -#include "wx/fontutil.h" -#include "wx/encinfo.h" - -#include "wx/mac/private.h" - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxFontEnumeratorHelper -{ -public: - wxFontEnumeratorHelper(wxFontEnumerator *fontEnum); - - // control what exactly are we enumerating - bool SetEncoding(wxFontEncoding encoding); - void SetFixedOnly(bool fixedOnly) - { m_fixedOnly = fixedOnly; } - - // call to start enumeration - void DoEnumerate(); - -private: - // the object we forward calls to OnFont() to - wxFontEnumerator *m_fontEnum; - - // if != -1, enum only fonts which have this encoding - int m_charset; - - // if not empty, enum only the fonts with this facename - wxString m_facename; - - // if TRUE, enum only fixed fonts - bool m_fixedOnly; -}; -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontEnumeratorHelper -// ---------------------------------------------------------------------------- - -wxFontEnumeratorHelper::wxFontEnumeratorHelper(wxFontEnumerator *fontEnum) -{ - m_fontEnum = fontEnum; - m_charset = -1; - m_fixedOnly = FALSE; -} - -bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) -{ - wxNativeEncodingInfo info; - if ( !wxGetNativeFontEncoding(encoding, &info) ) - { - if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) - { - // no such encodings at all - return FALSE; - } - } - m_charset = info.charset; - m_facename = info.facename; - - return TRUE; -} - -void wxFontEnumeratorHelper::DoEnumerate() -{ - MenuHandle menu ; - Str255 p_name ; - - short lines ; - - menu = NewMenu( 32000 , "\pFont" ) ; - AppendResMenu( menu , 'FONT' ) ; - lines = CountMenuItems( menu ) ; - - for ( int i = 1 ; i < lines+1 ; i ++ ) - { - GetMenuItemText( menu , i , p_name ) ; - wxString c_name = wxMacMakeStringFromPascal(p_name) ; - - /* - - if ( m_fixedOnly ) - { - // check that it's a fixed pitch font (there is *no* error here, the - // flag name is misleading!) - if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) - { - // not a fixed pitch font - return TRUE; - } - } - - if ( m_charset != -1 ) - { - // check that we have the right encoding - if ( lf->lfCharSet != m_charset ) - { - return TRUE; - } - } - - */ - m_fontEnum->OnFacename( c_name ) ; - } - DisposeMenu( menu ) ; -} - -// ---------------------------------------------------------------------------- -// wxFontEnumerator -// ---------------------------------------------------------------------------- - -bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, - bool fixedWidthOnly) -{ - wxFontEnumeratorHelper fe(this); - if ( fe.SetEncoding(encoding) ) - { - fe.SetFixedOnly(fixedWidthOnly); - - fe.DoEnumerate(); - } - // else: no such fonts, unknown encoding - - return TRUE; -} - -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) -{ - wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented")); - - return TRUE; -} diff --git a/src/mac/classic/fontutil.cpp b/src/mac/classic/fontutil.cpp deleted file mode 100644 index 1aa2298245..0000000000 --- a/src/mac/classic/fontutil.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/fontutil.cpp -// Purpose: font-related helper functions for wxMSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.11.99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "fontutil.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include "wx/fontutil.h" -#include "wx/fontmap.h" -#include "wx/encinfo.h" - -#include "wx/tokenzr.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNativeEncodingInfo -// ---------------------------------------------------------------------------- - -// convert to/from the string representation: format is -// facename[;charset] - -bool wxNativeEncodingInfo::FromString(const wxString& s) -{ - wxStringTokenizer tokenizer(s, _T(";")); - - facename = tokenizer.GetNextToken(); - if ( !facename ) - return FALSE; - - wxString tmp = tokenizer.GetNextToken(); - if ( !tmp ) - { - // default charset (don't use DEFAULT_CHARSET though because of subtle - // Windows 9x/NT differences in handling it) - charset = 0; - } - else - { - if ( wxSscanf(tmp, _T("%u"), &charset) != 1 ) - { - // should be a number! - return FALSE; - } - } - - return TRUE; -} - -wxString wxNativeEncodingInfo::ToString() const -{ - wxString s(facename); - if ( charset != 0 ) - { - s << _T(';') << charset; - } - - return s; -} - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -bool wxGetNativeFontEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info) -{ - wxCHECK_MSG( info, FALSE, _T("bad pointer in wxGetNativeFontEncoding") ); - - if ( encoding == wxFONTENCODING_DEFAULT ) - { - encoding = wxFont::GetDefaultEncoding(); - } - - info->encoding = encoding ; - - return TRUE; -} - -bool wxTestFontEncoding(const wxNativeEncodingInfo& info) -{ - // basically we should be able to support every encoding via the OS - return true ; -} - - diff --git a/src/mac/classic/frame.cpp b/src/mac/classic/frame.cpp deleted file mode 100644 index b56f24712b..0000000000 --- a/src/mac/classic/frame.cpp +++ /dev/null @@ -1,338 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp -// Purpose: wxFrame -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "frame.h" -#endif - -#include "wx/frame.h" -#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" - -#include "wx/mac/uma.h" - -extern wxWindowList wxModelessWindows; -extern wxList wxPendingDelete; - -#if !USE_SHARED_LIBRARY -BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) - EVT_ACTIVATE(wxFrame::OnActivate) - // EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) -// EVT_IDLE(wxFrame::OnIdle) -// EVT_CLOSE(wxFrame::OnCloseWindow) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) -#endif - -#define WX_MAC_STATUSBAR_HEIGHT 15 -// ---------------------------------------------------------------------------- -// creation/destruction -// ---------------------------------------------------------------------------- - -void wxFrame::Init() -{ - m_frameMenuBar = NULL; - -#if wxUSE_TOOLBAR - m_frameToolBar = NULL ; -#endif - m_frameStatusBar = NULL; - m_winLastFocused = NULL ; - - m_iconized = FALSE; - -#if wxUSE_TOOLTIPS - m_hwndToolTip = 0; -#endif -} - -wxPoint wxFrame::GetClientAreaOrigin() const -{ - // on mac we are at position -1,-1 with the control - wxPoint pt(0, 0); - -#if wxUSE_TOOLBAR - if ( GetToolBar() ) - { - int w, h; - GetToolBar()->GetSize(& w, & h); - - if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL ) - { - pt.x += w - 1; - } - else - { - pt.y += h - 1 ; - } - } -#endif // wxUSE_TOOLBAR - - return pt; -} - -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; - - MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - wxModelessWindows.Append(this); - - return TRUE; -} - -wxFrame::~wxFrame() -{ - m_isBeingDeleted = TRUE; - DeleteAllBars(); -} - - -bool wxFrame::Enable(bool enable) -{ - if ( !wxWindow::Enable(enable) ) - return FALSE; - - if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) - { - int iMaxMenu = m_frameMenuBar->GetMenuCount(); - for ( int i = 0 ; i < iMaxMenu ; ++ i ) - { - m_frameMenuBar->EnableTop( i , enable ) ; - } - } - - return TRUE; -} - -wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - wxStatusBar *statusBar = NULL; - - statusBar = new wxStatusBar(this, id, - style, name); - statusBar->SetSize( 100 , 15 ) ; - statusBar->SetFieldsCount(number); - return statusBar; -} - -void wxFrame::PositionStatusBar() -{ - if (m_frameStatusBar ) - { - int w, h; - GetClientSize(&w, &h); - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - - // Since we wish the status bar to be directly under the client area, - // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. - m_frameStatusBar->SetSize(0, h, w, sh); - } -} - -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - Refresh(); - - if ( m_frameStatusBar ) - { - wxSysColourChangedEvent event2; - event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->ProcessEvent(event2); - } - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - - -// Default activation behaviour - set the focus for the first child -// subwindow found. -void wxFrame::OnActivate(wxActivateEvent& event) -{ - if ( !event.GetActive() ) - { - // remember the last focused child if it is our child - m_winLastFocused = FindFocus(); - - // so we NULL it out if it's a child from some other frame - wxWindow *win = m_winLastFocused; - while ( win ) - { - if ( win->IsTopLevel() ) - { - if ( win != this ) - { - m_winLastFocused = NULL; - } - - break; - } - - win = win->GetParent(); - } - - event.Skip(); - } - else - { - // restore focus to the child which was last focused - wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent() - : NULL; - if ( !parent ) - { - parent = this; - } - - wxSetFocusToChild(parent, &m_winLastFocused); - - if ( m_frameMenuBar != NULL ) - { - m_frameMenuBar->MacInstallMenuBar() ; - } - else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame))) - { - // Trying toplevel frame menbar - if( ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar() ) - ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar(); - } - } -} - -void wxFrame::DetachMenuBar() -{ - if ( m_frameMenuBar ) - { - m_frameMenuBar->UnsetInvokingWindow(); - } - - wxFrameBase::DetachMenuBar(); -} - -void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) -{ - wxFrameBase::AttachMenuBar(menuBar); - - if (m_frameMenuBar) - { - m_frameMenuBar->SetInvokingWindow( this ); - } -} - -void wxFrame::DoGetClientSize(int *x, int *y) const -{ - wxWindow::DoGetClientSize( x , y ) ; - -#if wxUSE_STATUSBAR - if ( GetStatusBar() && y ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - *y -= statusY; - } -#endif // wxUSE_STATUSBAR - - wxPoint pt(GetClientAreaOrigin()); - if ( y ) - *y -= pt.y; - if ( x ) - *x -= pt.x; -} - -void wxFrame::DoSetClientSize(int clientwidth, int clientheight) -{ - int currentclientwidth , currentclientheight ; - int currentwidth , currentheight ; - - GetClientSize( ¤tclientwidth , ¤tclientheight ) ; - GetSize( ¤twidth , ¤theight ) ; - - // find the current client size - - // Find the difference between the entire window (title bar and all) - // and the client area; add this to the new client size to move the - // window - - DoSetSize( -1 , -1 , currentwidth + clientwidth - currentclientwidth , - currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ; -} - - -#if wxUSE_TOOLBAR -wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) -{ - if ( wxFrameBase::CreateToolBar(style, id, name) ) - { - PositionToolBar(); - } - - return m_frameToolBar; -} - -void wxFrame::PositionToolBar() -{ - int cw, ch; - - cw = m_width ; - ch = m_height ; - - if ( GetStatusBar() ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - ch -= statusY; - } - - if (GetToolBar()) - { - int tw, th; - GetToolBar()->GetSize(& tw, & th); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - // Use the 'real' position. wxSIZE_NO_ADJUSTMENTS - // means, pretend we don't have toolbar/status bar, so we - // have the original client size. - GetToolBar()->SetSize(-1, -1, tw, ch + 2 , wxSIZE_NO_ADJUSTMENTS | wxSIZE_ALLOW_MINUS_ONE ); - } - else - { - // Use the 'real' position - GetToolBar()->SetSize(-1, -1, cw + 2, th, wxSIZE_NO_ADJUSTMENTS | wxSIZE_ALLOW_MINUS_ONE ); - } - } -} -#endif diff --git a/src/mac/classic/gauge.cpp b/src/mac/classic/gauge.cpp deleted file mode 100644 index 01a557e17c..0000000000 --- a/src/mac/classic/gauge.cpp +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp -// Purpose: wxGauge class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gauge.h" -#endif - -#include "wx/gauge.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) -#endif - -#include "wx/mac/uma.h" - -bool wxGauge::Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos, - const wxSize& s, - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) ) - return false; - - wxSize size = s ; - Rect bounds ; - Str255 title ; - m_rangeMax = range ; - m_gaugePos = 0 ; - - if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y) - { - size = wxSize( 200 , 16 ) ; - } - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range, - kControlProgressBarProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -void wxGauge::SetShadowWidth(int w) -{ -} - -void wxGauge::SetBezelFace(int w) -{ -} - -void wxGauge::SetRange(int r) -{ - m_rangeMax = r; - ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ; -} - -void wxGauge::SetValue(int pos) -{ - m_gaugePos = pos; - ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ; -} - -int wxGauge::GetShadowWidth() const -{ - return 0; -} - -int wxGauge::GetBezelFace() const -{ - return 0; -} - -int wxGauge::GetRange() const -{ - return m_rangeMax; -} - -int wxGauge::GetValue() const -{ - return m_gaugePos; -} - diff --git a/src/mac/classic/gdiobj.cpp b/src/mac/classic/gdiobj.cpp deleted file mode 100644 index 528c5a7efe..0000000000 --- a/src/mac/classic/gdiobj.cpp +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp -// Purpose: wxGDIObject class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif - -#include "wx/gdiobj.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) -#endif - -// TODO: Nothing to do, unless you want to. diff --git a/src/mac/classic/glcanvas.cpp b/src/mac/classic/glcanvas.cpp deleted file mode 100644 index e208531ff4..0000000000 --- a/src/mac/classic/glcanvas.cpp +++ /dev/null @@ -1,385 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: glcanvas.cpp -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "glcanvas.h" -#endif - -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) -#pragma hdrstop -#endif - -#include "wx/setup.h" - -#if wxUSE_GLCANVAS - -#ifndef WX_PRECOMP -#include "wx/frame.h" -#endif - -#include "wx/settings.h" -#include "wx/log.h" - -#include "wx/glcanvas.h" -#include "wx/mac/uma.h" - -// DLL options compatibility check: -#include "wx/build.h" -WX_CHECK_BUILD_OPTIONS("wxGL") - -/* -* GLContext implementation -*/ - -wxGLContext::wxGLContext( - AGLPixelFormat fmt, wxGLCanvas *win, - const wxPalette& palette, - const wxGLContext *other /* for sharing display lists */ - ) -{ - m_window = win; - - m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow())); - - m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL); - wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") ); - - GLboolean b; - b = aglSetDrawable(m_glContext, m_drawable); - wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") ); - aglEnable(m_glContext , AGL_BUFFER_RECT ) ; - b = aglSetCurrentContext(m_glContext); - wxCHECK_RET( b, wxT("Couldn't activate OpenGl context") ); -} - -wxGLContext::~wxGLContext() -{ - if (m_glContext) - { - aglSetCurrentContext(NULL); - aglDestroyContext(m_glContext); - } -} - -void wxGLContext::SwapBuffers() -{ - if (m_glContext) - { - aglSwapBuffers(m_glContext); - } -} - -void wxGLContext::SetCurrent() -{ - if (m_glContext) - { - aglSetCurrentContext(m_glContext); - } -} - -void wxGLContext::Update() -{ - if (m_glContext) - { - aglUpdateContext(m_glContext); - } -} - -void wxGLContext::SetColour(const wxChar *colour) -{ - wxColour col = wxTheColourDatabase->Find(colour); - if (col.Ok()) - { - float r = (float)(col.Red()/256.0); - float g = (float)(col.Green()/256.0); - float b = (float)(col.Blue()/256.0); - glColor3f( r, g, b); - } -} - - -/* -* wxGLCanvas implementation -*/ - -IMPLEMENT_CLASS(wxGLCanvas, wxWindow) - -BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow) - EVT_SIZE(wxGLCanvas::OnSize) -END_EVENT_TABLE() - -wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette) -{ - Create(parent, NULL, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::wxGLCanvas( wxWindow *parent, - const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette ) -{ - Create(parent, shared, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette ) -{ - Create(parent, shared ? shared->GetContext() : NULL, id, pos, size, style, name, attribList, palette); -} - -wxGLCanvas::~wxGLCanvas() -{ - if (m_glContext != NULL) { - delete m_glContext; - m_glContext = NULL; - } -} - -static AGLPixelFormat ChoosePixelFormat(const int *attribList) -{ - GLint data[512]; - GLint defaultAttribs[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_MINIMUM_POLICY, - AGL_DEPTH_SIZE, 1, // use largest available depth buffer - AGL_RED_SIZE, 1, - AGL_GREEN_SIZE, 1, - AGL_BLUE_SIZE, 1, - AGL_ALPHA_SIZE, 0, - AGL_NONE }; - GLint *attribs; - if (!attribList) - { - attribs = defaultAttribs; - } - else - { - int arg=0, p=0; - - data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX - while( (attribList[arg]!=0) && (p<512) ) - { - switch( attribList[arg++] ) - { - case WX_GL_RGBA: data[p++] = AGL_RGBA; break; - case WX_GL_BUFFER_SIZE: - data[p++]=AGL_BUFFER_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_LEVEL: - data[p++]=AGL_LEVEL; data[p++]=attribList[arg++]; break; - case WX_GL_DOUBLEBUFFER: data[p++] = AGL_DOUBLEBUFFER; break; - case WX_GL_STEREO: data[p++] = AGL_STEREO; break; - case WX_GL_AUX_BUFFERS: - data[p++]=AGL_AUX_BUFFERS; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_RED: - data[p++]=AGL_RED_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_GREEN: - data[p++]=AGL_GREEN_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_BLUE: - data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ALPHA: - data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_DEPTH_SIZE: - data[p++]=AGL_DEPTH_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_STENCIL_SIZE: - data[p++]=AGL_STENCIL_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_RED: - data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_GREEN: - data[p++]=AGL_ACCUM_GREEN_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_BLUE: - data[p++]=AGL_ACCUM_BLUE_SIZE; data[p++]=attribList[arg++]; break; - case WX_GL_MIN_ACCUM_ALPHA: - data[p++]=AGL_ACCUM_ALPHA_SIZE; data[p++]=attribList[arg++]; break; - default: - break; - } - } - data[p] = 0; - - attribs = data; - } - - return aglChoosePixelFormat(NULL, 0, attribs); -} - -bool wxGLCanvas::Create(wxWindow *parent, const wxGLContext *shared, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style, const wxString& name, - int *attribList, const wxPalette& palette) -{ - wxWindow::Create( parent, id, pos, size, style, name ); - - AGLPixelFormat fmt = ChoosePixelFormat(attribList); - wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") ); - - m_glContext = new wxGLContext(fmt, this, palette, shared); - m_macCanvasIsShown = true ; - aglDestroyPixelFormat(fmt); - - return true; -} - -void wxGLCanvas::SwapBuffers() -{ - if (m_glContext) - m_glContext->SwapBuffers(); -} - -void wxGLCanvas::UpdateContext() -{ - if (m_glContext) - m_glContext->Update(); -} - -void wxGLCanvas::SetViewport() -{ - // viewport is initially set to entire port - // adjust glViewport to just this window - int x = 0 ; - int y = 0 ; - - wxWindow* iter = this ; - while( iter->GetParent() ) - { - iter = iter->GetParent() ; - } - - if ( iter && iter->IsTopLevel() ) - { - MacClientToRootWindow( &x , &y ) ; - int width, height; - GetClientSize(& width, & height); - Rect bounds ; - GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ; - GLint parms[4] ; - parms[0] = x ; - parms[1] = bounds.bottom - bounds.top - ( y + height ) ; - parms[2] = width ; - parms[3] = height ; - - if ( !m_macCanvasIsShown ) - parms[0] += 20000 ; - aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ; - } -} - -void wxGLCanvas::OnSize(wxSizeEvent& event) -{ - MacUpdateView() ; -} - -void wxGLCanvas::MacUpdateView() -{ - if (m_glContext) - { - UpdateContext(); - m_glContext->SetCurrent(); - SetViewport(); - } -} - -void wxGLCanvas::MacSuperChangedPosition() -{ - MacUpdateView() ; - wxWindow::MacSuperChangedPosition() ; -} - -void wxGLCanvas::MacTopLevelWindowChangedPosition() -{ - MacUpdateView() ; - wxWindow::MacTopLevelWindowChangedPosition() ; -} - -void wxGLCanvas::SetCurrent() -{ - if (m_glContext) - { - m_glContext->SetCurrent(); - } -} - -void wxGLCanvas::SetColour(const wxChar *colour) -{ - if (m_glContext) - m_glContext->SetColour(colour); -} - -bool wxGLCanvas::Show(bool show) -{ - if ( !wxWindow::Show( show ) ) - return FALSE ; - - if ( !show ) - { - if ( m_macCanvasIsShown ) - { - m_macCanvasIsShown = false ; - SetViewport() ; - } - } - else - { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) - { - m_macCanvasIsShown = true ; - SetViewport() ; - } - } - return TRUE ; -} - -void wxGLCanvas::MacSuperShown( bool show ) -{ - if ( !show ) - { - if ( m_macCanvasIsShown ) - { - m_macCanvasIsShown = false ; - SetViewport() ; - } - } - else - { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) - { - m_macCanvasIsShown = true ; - SetViewport() ; - } - } - - wxWindow::MacSuperShown( show ) ; -} - -//--------------------------------------------------------------------------- -// wxGLApp -//--------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxGLApp, wxApp) - -bool wxGLApp::InitGLVisual(int *attribList) -{ - AGLPixelFormat fmt = ChoosePixelFormat(attribList); - if (fmt != NULL) { - aglDestroyPixelFormat(fmt); - return true; - } else - return false; -} - -wxGLApp::~wxGLApp(void) -{ -} - -#endif // wxUSE_GLCANVAS diff --git a/src/mac/classic/gsocket.c b/src/mac/classic/gsocket.c deleted file mode 100644 index 9e3ba3079a..0000000000 --- a/src/mac/classic/gsocket.c +++ /dev/null @@ -1,1653 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsocket.c - * Authors: Guilhem Lavaux, - * Guillermo Rodriguez Garcia (maintainer) - * Stefan CSomor - * Purpose: GSocket main mac file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -/* - * PLEASE don't put C++ comments here - this is a C source file. - */ - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/setup.h" -#include "wx/platform.h" -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#ifdef __DARWIN__ - #include - - #ifndef FALSE - #define FALSE 0 - #endif - #ifndef TRUE - #define TRUE 1 - #endif -#else - #include - #define OTUNIXERRORS 1 - #include - #include - #include -#endif -#if TARGET_CARBON && !defined(OTAssert) - #define OTAssert( str , cond ) /* does not exists in Carbon */ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * INADDR_BROADCAST is identical to INADDR_NONE which is not defined - * on all unices. INADDR_BROADCAST should be fine to indicate an error. - */ -#ifndef INADDR_BROADCAST -#define INADDR_BROADCAST 0xFFFFFFFFUL -#endif -#ifndef INADDR_NONE -#define INADDR_NONE INADDR_BROADCAST -#endif -#ifndef INADDR_ANY -#define INADDR_ANY 0x0UL -#endif -#ifndef __GSOCKET_STANDALONE__ - -#include "wx/mac/macnotfy.h" -#include "wx/mac/gsockmac.h" -#include "wx/gsocket.h" - -#else - -#include "gsockmac.h" -#include "gsocket.h" - -#endif /* __GSOCKET_STANDALONE__ */ - -void wxCYield() ; -#ifdef __WXDEBUG__ -#define qDebug 1 -#define qDebug2 1 -extern pascal void OTDebugStr(const char* str); -#endif -#ifndef __DARWIN__ - #include -#endif -InetSvcRef gInetSvcRef = 0 ; -int gOTInited = 0 ; -OTNotifyUPP gOTNotifierUPP = NULL ; - -OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode); - -/* Input: ep - endpointref on which to negotiate the option - enableReuseIPMode - desired option setting - true/false - Return: kOTNoError indicates that the option was successfully negotiated - OSStatus is an error if < 0, otherwise, the status field is - returned and is > 0. - - IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise - this code will not function as desired -*/ - - -OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode) - -{ - UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size - TOption* opt; // option ptr to make items easier to access - TOptMgmt req; - TOptMgmt ret; - OSStatus err; - - if (!OTIsSynchronous(ep)) - { - return (-1); - } - opt = (TOption*)buf; // set option ptr to buffer - req.opt.buf = buf; - req.opt.len = sizeof(buf); - req.flags = T_NEGOTIATE; // negotiate for option - - ret.opt.buf = buf; - ret.opt.maxlen = kOTFourByteOptionSize; - - opt->level = INET_IP; // dealing with an IP Level function -#ifdef __DARWIN__ - opt->name = kIP_REUSEADDR; -#else - opt->name = IP_REUSEADDR; -#endif - opt->len = kOTFourByteOptionSize; - opt->status = 0; - *(UInt32*)opt->value = enableReuseIPMode; // set the desired option level, true or false - - err = OTOptionManagement(ep, &req, &ret); - - // if no error then return the option status value - if (err == kOTNoError) - { - if (opt->status != T_SUCCESS) - err = opt->status; - else - err = kOTNoError; - } - - return err; -} - - -pascal void OTInetEventHandler(void*s, OTEventCode event, OTResult, void *cookie) ; -pascal void OTInetEventHandler(void*s, OTEventCode event, OTResult result, void *cookie) -{ - int wakeUp = true ; - GSocket* sock = (GSocket*) s ; - - if ( event == kOTSyncIdleEvent ) - { - YieldToAnyThread() ; - return ; - } - - if ( s ) - { - wxMacAddEvent( sock->m_mac_events , _GSocket_Internal_Proc , event , s , wakeUp ) ; - } - - return; -} - -static void SetDefaultEndpointModes(EndpointRef ep , void *data ) - // This routine sets the supplied endpoint into the default - // mode used in this application. The specifics are: - // blocking, synchronous, and using synch idle events with - // the standard YieldingNotifier. -{ - OSStatus junk = kOTNoError ; - OTAssert ("SetDefaultEndpointModes:invalid ref", ep != kOTInvalidEndpointRef ) ; - junk = OTSetAsynchronous(ep); - OTAssert("SetDefaultEndpointModes: Could not set asynchronous", junk == noErr); -/* - junk = OTSetBlocking(ep); - OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr); - junk = OTSetSynchronous(ep); - OTAssert("SetDefaultEndpointModes: Could not set synchronous", junk == noErr); - junk = OTSetBlocking(ep); - OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr); -*/ - junk = OTInstallNotifier(ep, gOTNotifierUPP, data); - OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr); -/* - junk = OTUseSyncIdleEvents(ep, true); - OTAssert("SetDefaultEndpointModes: Could not use sync idle events", junk == noErr); -*/ -} - -/* Global initialisers */ - -void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *table) -{ - // do nothing, wxMac doesn't have wxBase-GUI separation yet -} - -int GSocket_Init() -{ - return TRUE; -} - -int GSocket_Verify_Inited() ; -int GSocket_Verify_Inited() -{ - OSStatus err ; -#if TARGET_CARBON - // Marc Newsam: added the clientcontext variable - // however, documentation is unclear how this works - OTClientContextPtr clientcontext; - - if ( gInetSvcRef ) - return TRUE ; - - InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext); - gOTInited = 1 ; - gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath, - NULL, &err, clientcontext); -#else - if ( gInetSvcRef ) - return TRUE ; - - InitOpenTransport() ; - gOTInited = 1 ; - gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); -#endif - if ( gInetSvcRef == NULL || err != kOTNoError ) - { - OTAssert("Could not open Inet Services", err == noErr); - return FALSE ; - } - gOTNotifierUPP = NewOTNotifyUPP( OTInetEventHandler ) ; - return TRUE ; -} - -void GSocket_Cleanup() -{ - if ( gOTInited != 0 ) - { - if ( gInetSvcRef != NULL ) - OTCloseProvider( gInetSvcRef ); - #if TARGET_CARBON - CloseOpenTransportInContext( NULL ) ; - #else - CloseOpenTransport() ; - #endif - if ( gOTNotifierUPP ) - DisposeOTNotifyUPP( gOTNotifierUPP ) ; - } -} - -/* Constructors / Destructors for GSocket */ - -GSocket *GSocket_new() -{ - - int i; - GSocket *socket; - - if ( GSocket_Verify_Inited() == FALSE ) - return NULL ; - - socket = (GSocket *)malloc(sizeof(GSocket)); - - if (socket == NULL) - return NULL; - - socket->m_endpoint = NULL ; - for (i=0;im_cbacks[i] = NULL; - } - socket->m_detected = 0; - socket->m_local = NULL; - socket->m_peer = NULL; - socket->m_error = GSOCK_NOERROR; - socket->m_server = FALSE; - socket->m_stream = TRUE; - socket->m_non_blocking = FALSE; - socket->m_timeout = 1*1000; - /* 10 sec * 1000 millisec */ - socket->m_takesEvents = TRUE ; - socket->m_mac_events = wxMacGetNotifierTable() ; - return socket; -} - -void GSocket_destroy(GSocket *socket) -{ - assert(socket != NULL); - - /* Check that the socket is really shutdowned */ - if (socket->m_endpoint != kOTInvalidEndpointRef) - GSocket_Shutdown(socket); - - - /* Destroy private addresses */ - if (socket->m_local) - GAddress_destroy(socket->m_local); - - if (socket->m_peer) - GAddress_destroy(socket->m_peer); - - /* Destroy the socket itself */ - free(socket); -} - -/* GSocket_Shutdown: - * Disallow further read/write operations on this socket, close - * the fd and disable all callbacks. - */ -void GSocket_Shutdown(GSocket *socket) -{ - OSStatus err ; - int evt; - - assert(socket != NULL); - - /* If socket has been created, shutdown it */ - if (socket->m_endpoint != kOTInvalidEndpointRef ) - { - err = OTSndOrderlyDisconnect( socket->m_endpoint ) ; - if ( err != kOTNoError ) - { - - } - err = OTRcvOrderlyDisconnect( socket->m_endpoint ) ; - err = OTUnbind( socket->m_endpoint ) ; - err = OTCloseProvider( socket->m_endpoint ) ; - socket->m_endpoint = kOTInvalidEndpointRef ; - } - - /* Disable GUI callbacks */ - for (evt = 0; evt < GSOCK_MAX_EVENT; evt++) - socket->m_cbacks[evt] = NULL; - - socket->m_detected = 0; - _GSocket_Disable_Events(socket); - wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable() , socket ) ; -} - - -/* Address handling */ - -/* GSocket_SetLocal: - * GSocket_GetLocal: - * GSocket_SetPeer: - * GSocket_GetPeer: - * Set or get the local or peer address for this socket. The 'set' - * functions return GSOCK_NOERROR on success, an error code otherwise. - * The 'get' functions return a pointer to a GAddress object on success, - * or NULL otherwise, in which case they set the error code of the - * corresponding GSocket. - * - * Error codes: - * GSOCK_INVSOCK - the socket is not valid. - * GSOCK_INVADDR - the address is not valid. - */ -GSocketError GSocket_SetLocal(GSocket *socket, GAddress *address) -{ - assert(socket != NULL); - - /* the socket must be initialized, or it must be a server */ - if ((socket->m_endpoint != kOTInvalidEndpointRef && !socket->m_server)) - { - socket->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - socket->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (socket->m_local) - GAddress_destroy(socket->m_local); - - socket->m_local = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GSocketError GSocket_SetPeer(GSocket *socket, GAddress *address) -{ - assert(socket != NULL); - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - socket->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (socket->m_peer) - GAddress_destroy(socket->m_peer); - - socket->m_peer = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GAddress *GSocket_GetLocal(GSocket *socket) -{ - GAddress *address = NULL ; - GSocketError err; - InetAddress loc ; - - assert(socket != NULL); - - /* try to get it from the m_local var first */ - if (socket->m_local) - return GAddress_copy(socket->m_local); - - /* else, if the socket is initialized, try getsockname */ - if (socket->m_endpoint == kOTInvalidEndpointRef) - { - socket->m_error = GSOCK_INVSOCK; - return NULL; - } - - -/* we do not support multihoming with this code at the moment - OTGetProtAddress will have to be used then - but we don't have a handy - method to use right now -*/ - { - InetInterfaceInfo info; - OTInetGetInterfaceInfo(&info, kDefaultInetInterface); - loc.fHost = info.fAddress ; - loc.fPort = 0 ; - loc.fAddressType = AF_INET ; - } - - /* got a valid address from getsockname, create a GAddress object */ - address = GAddress_new(); - if (address == NULL) - { - socket->m_error = GSOCK_MEMERR; - return NULL; - } - - err = _GAddress_translate_from(address, &loc); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(address); - socket->m_error = err; - return NULL; - } - - return address; -} - -GAddress *GSocket_GetPeer(GSocket *socket) -{ - assert(socket != NULL); - - /* try to get it from the m_peer var */ - if (socket->m_peer) - return GAddress_copy(socket->m_peer); - - return NULL; -} - -/* Server specific parts */ - -/* GSocket_SetServer: - * Sets up this socket as a server. The local address must have been - * set with GSocket_SetLocal() before GSocket_SetServer() is called. - * Returns GSOCK_NOERROR on success, one of the following otherwise: - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use. - * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_SetServer(GSocket *sck) -{ - assert(sck != NULL); - - /* must not be in use */ - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* the local addr must have been set */ - if (!sck->m_local) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - sck->m_stream = TRUE; - sck->m_server = TRUE; - sck->m_oriented = TRUE; - -// TODO -#if 0 - /* Create the socket */ - sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_STREAM, 0); - socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ; - if (sck->m_endpoint == kOTInvalidEndpointRef) - { - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - ioctl(sck->m_endpoint, FIONBIO, &arg); - _GSocket_Enable_Events(sck); - - /* Bind to the local address, - * retrieve the actual address bound, - * and listen up to 5 connections. - */ - if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) || - (getsockname(sck->m_endpoint, - sck->m_local->m_addr, - (SOCKLEN_T *) &sck->m_local->m_len) != 0) || - (listen(sck->m_endpoint, 5) != 0)) - { - close(sck->m_endpoint); - sck->m_endpoint = -1; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -#endif - return GSOCK_NOERROR; -} - -/* GSocket_WaitConnection: - * Waits for an incoming client connection. Returns a pointer to - * a GSocket object, or NULL if there was an error, in which case - * the last error field will be updated for the calling GSocket. - * - * Error codes (set in the calling GSocket) - * GSOCK_INVSOCK - the socket is not valid or not a server. - * GSOCK_TIMEDOUT - timeout, no incoming connections. - * GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking. - * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. - */ -GSocket *GSocket_WaitConnection(GSocket *socket) -{ - GSocket *connection = NULL ; - - assert(socket != NULL); - - /* Reenable CONNECTION events */ - socket->m_detected &= ~GSOCK_CONNECTION_FLAG; - - /* If the socket has already been created, we exit immediately */ - if (socket->m_endpoint == kOTInvalidEndpointRef || !socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return NULL; - } - - /* Create a GSocket object for the new connection */ - connection = GSocket_new(); - - if (!connection) - { - socket->m_error = GSOCK_MEMERR; - return NULL; - } - - /* Wait for a connection (with timeout) */ - if (_GSocket_Input_Timeout(socket) == GSOCK_TIMEDOUT) - { - GSocket_destroy(connection); - /* socket->m_error set by _GSocket_Input_Timeout */ - return NULL; - } - -// TODO -#if 0 - connection->m_endpoint = accept(socket->m_endpoint, &from, (SOCKLEN_T *) &fromlen); -#endif - - if (connection->m_endpoint == kOTInvalidEndpointRef ) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - - GSocket_destroy(connection); - return NULL; - } - - /* Initialize all fields */ - connection->m_server = FALSE; - connection->m_stream = TRUE; - connection->m_oriented = TRUE; - - /* Setup the peer address field */ - connection->m_peer = GAddress_new(); - if (!connection->m_peer) - { - GSocket_destroy(connection); - socket->m_error = GSOCK_MEMERR; - return NULL; - } - // TODO - #if 0 - err = _GAddress_translate_from(connection->m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(connection->m_peer); - GSocket_destroy(connection); - socket->m_error = err; - return NULL; - } - - ioctl(connection->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(connection); - - return connection; -} - -/* Datagram sockets */ - -/* GSocket_SetNonOriented: - * Sets up this socket as a non-connection oriented (datagram) socket. - * Before using this function, the local address must have been set - * with GSocket_SetLocal(), or the call will fail. Returns GSOCK_NOERROR - * on success, or one of the following otherwise. - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use. - * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_SetNonOriented(GSocket *sck) -{ - assert(sck != NULL); - - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!sck->m_local) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - sck->m_stream = FALSE; - sck->m_server = FALSE; - sck->m_oriented = FALSE; - - /* Create the socket */ - -// TODO -#if 0 - sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0); - socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ; -#endif - if (sck->m_endpoint == kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - -// TODO -#if 0 - ioctl(sck->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(sck); - - /* Bind to the local address, - * and retrieve the actual address bound. - */ -// TODO -#if 0 - if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) || - (getsockname(sck->m_endpoint, - sck->m_local->m_addr, - (SOCKLEN_T *) &sck->m_local->m_len) != 0)) - { - close(sck->m_endpoint); - sck->m_endpoint = -1; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -#endif - return GSOCK_NOERROR; -} - -/* Client specific parts */ - -/* GSocket_Connect: - * For stream (connection oriented) sockets, GSocket_Connect() tries - * to establish a client connection to a server using the peer address - * as established with GSocket_SetPeer(). Returns GSOCK_NOERROR if the - * connection has been succesfully established, or one of the error - * codes listed below. Note that for nonblocking sockets, a return - * value of GSOCK_WOULDBLOCK doesn't mean a failure. The connection - * request can be completed later; you should use GSocket_Select() - * to poll for GSOCK_CONNECTION | GSOCK_LOST, or wait for the - * corresponding asynchronous events. - * - * For datagram (non connection oriented) sockets, GSocket_Connect() - * just sets the peer address established with GSocket_SetPeer() as - * default destination. - * - * Error codes: - * GSOCK_INVSOCK - the socket is in use or not valid. - * GSOCK_INVADDR - the peer address has not been established. - * GSOCK_TIMEDOUT - timeout, the connection failed. - * GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only) - * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. - */ -GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) -{ - InetAddress addr ; - TEndpointInfo info; - OSStatus err = kOTNoError; - TCall peer ; - - assert(sck != NULL); - - /* Enable CONNECTION events (needed for nonblocking connections) */ - sck->m_detected &= ~GSOCK_CONNECTION_FLAG; - - if (sck->m_endpoint != kOTInvalidEndpointRef ) - { - sck->m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!sck->m_peer) - { - sck->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Streamed or dgram socket? */ - sck->m_stream = (stream == GSOCK_STREAMED); - sck->m_oriented = TRUE; - sck->m_server = FALSE; - - /* Create the socket */ -#if TARGET_CARBON - sck->m_endpoint = - OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ; -#else - sck->m_endpoint = - OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ; -#endif - if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError ) - { - sck->m_endpoint = kOTInvalidEndpointRef ; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - err = OTBind( sck->m_endpoint , nil , nil ) ; - if ( err != kOTNoError ) - { - return GSOCK_IOERR; - } - SetDefaultEndpointModes( sck->m_endpoint , sck ) ; -// TODO -#if 0 - ioctl(sck->m_endpoint, FIONBIO, &arg); -#endif - _GSocket_Enable_Events(sck); - - _GAddress_translate_to( sck->m_peer , &addr ) ; - memset( &peer , 0 , sizeof( TCall ) ) ; - peer.addr.len = sizeof( InetAddress ) ; - peer.addr.buf = (unsigned char*) &addr ; - err = OTConnect( sck->m_endpoint , &peer , nil ) ; - if ( err != noErr ) - { - /* If connect failed with EINPROGRESS and the GSocket object - * is in blocking mode, we select() for the specified timeout - * checking for writability to see if the connection request - * completes. - */ - - if ((err == kOTNoDataErr ) && (!sck->m_non_blocking)) - { - if (_GSocket_Output_Timeout(sck) == GSOCK_TIMEDOUT) - { - OTSndOrderlyDisconnect( sck->m_endpoint ) ; - sck->m_endpoint = kOTInvalidEndpointRef ; - /* sck->m_error is set in _GSocket_Output_Timeout */ - return GSOCK_TIMEDOUT; - } - else - { -/* - int error; - SOCKLEN_T len = sizeof(error); - - getsockopt(sck->m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len); - - if (!error) -*/ - return GSOCK_NOERROR; - } - } - - /* If connect failed with EINPROGRESS and the GSocket object - * is set to nonblocking, we set m_error to GSOCK_WOULDBLOCK - * (and return GSOCK_WOULDBLOCK) but we don't close the socket; - * this way if the connection completes, a GSOCK_CONNECTION - * event will be generated, if enabled. - */ - if ((err == kOTNoDataErr) && (sck->m_non_blocking)) - { - sck->m_error = GSOCK_WOULDBLOCK; - return GSOCK_WOULDBLOCK; - } - - /* If connect failed with an error other than EINPROGRESS, - * then the call to GSocket_Connect has failed. - */ - OTSndOrderlyDisconnect( sck->m_endpoint ) ; - - sck->m_endpoint = kOTInvalidEndpointRef ; - sck->m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -// OTInetEventHandler(sck, T_CONNECT , kOTNoError , NULL ) ; - return GSOCK_NOERROR; -} - -/* Generic IO */ - -/* Like recv(), send(), ... */ -int GSocket_Read(GSocket *socket, char *buffer, int size) -{ - int ret = 0 ; - - assert(socket != NULL); - - /* Reenable INPUT events */ - socket->m_detected &= ~GSOCK_INPUT_FLAG; - - if (socket->m_endpoint == kOTInvalidEndpointRef || socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return -1; - } - - /* If the socket is blocking, wait for data (with a timeout) */ - if (_GSocket_Input_Timeout(socket) == GSOCK_TIMEDOUT) - return -1; - - /* Read the data */ - if (socket->m_stream) - ret = _GSocket_Recv_Stream(socket, buffer, size); - else - ret = _GSocket_Recv_Dgram(socket, buffer, size); - - if (ret == -1) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - } - - return ret; -} - -int GSocket_Write(GSocket *socket, const char *buffer, int size) -{ - int ret; - - assert(socket != NULL); - - if (socket->m_endpoint == kOTInvalidEndpointRef || socket->m_server) - { - socket->m_error = GSOCK_INVSOCK; - return -1; - } - - /* If the socket is blocking, wait for writability (with a timeout) */ - if (_GSocket_Output_Timeout(socket) == GSOCK_TIMEDOUT) - return -1; - - /* Write the data */ - if (socket->m_stream) - ret = _GSocket_Send_Stream(socket, buffer, size); - else - ret = _GSocket_Send_Dgram(socket, buffer, size); - - if (ret == -1) - { - if (errno == EWOULDBLOCK) - socket->m_error = GSOCK_WOULDBLOCK; - else - socket->m_error = GSOCK_IOERR; - - /* Only reenable OUTPUT events after an error (just like WSAAsyncSelect - * in MSW). Once the first OUTPUT event is received, users can assume - * that the socket is writable until a read operation fails. Only then - * will further OUTPUT events be posted. - */ - socket->m_detected &= ~GSOCK_OUTPUT_FLAG; - return -1; - } - - return ret; -} - -/* GSocket_Select: - * Polls the socket to determine its status. This function will - * check for the events specified in the 'flags' parameter, and - * it will return a mask indicating which operations can be - * performed. This function won't block, regardless of the - * mode (blocking | nonblocking) of the socket. - */ -GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) -{ - assert(socket != NULL); - wxMacProcessNotifierEvents() ; - /* - state = OTGetEndpointState(socket->m_endpoint); - - if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) ) - { - size_t sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_OUTPUT_FLAG ) ) - { - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_detected |=GSOCK_OUTPUT_FLAG ; - (socket->m_cbacks[GSOCK_OUTPUT])(socket, GSOCK_OUTPUT, socket->m_data[GSOCK_OUTPUT]); - } - } - */ - return ( flags & socket->m_detected ) ; -} - -/* Flags */ - -/* GSocket_SetNonBlocking: - * Sets the socket to non-blocking mode. All IO calls will return - * immediately. - */ -void GSocket_SetNonBlocking(GSocket *socket, int non_block) -{ - assert(socket != NULL); - - socket->m_non_blocking = non_block; -} - -/* GSocket_SetTimeout: - * Sets the timeout for blocking calls. Time is expressed in - * milliseconds. - */ -void GSocket_SetTimeout(GSocket *socket, unsigned long millisec) -{ - assert(socket != NULL); - -// this is usually set too high and we have not yet been able to detect a closed -// stream, thus we leave the 10 sec timeout -// socket->m_timeout = millisec; -} - -/* GSocket_GetError: - * Returns the last error occured for this socket. Note that successful - * operations do not clear this back to GSOCK_NOERROR, so use it only - * after an error. - */ -GSocketError GSocket_GetError(GSocket *socket) -{ - assert(socket != NULL); - - return socket->m_error; -} - -/* Callbacks */ - -/* GSOCK_INPUT: - * There is data to be read in the input buffer. If, after a read - * operation, there is still data available, the callback function will - * be called again. - * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call - * won't block. This event is generated only once, when the connection is - * first established, and then only if a call failed with GSOCK_WOULDBLOCK, - * when the output buffer empties again. This means that the app should - * assume that it can write since the first OUTPUT event, and no more - * OUTPUT events will be generated unless an error occurs. - * GSOCK_CONNECTION: - * Connection succesfully established, for client sockets, or incoming - * client connection, for server sockets. Wait for this event (also watch - * out for GSOCK_LOST) after you issue a nonblocking GSocket_Connect() call. - * GSOCK_LOST: - * The connection is lost (or a connection request failed); this could - * be due to a failure, or due to the peer closing it gracefully. - */ - -/* GSocket_SetCallback: - * Enables the callbacks specified by 'flags'. Note that 'flags' - * may be a combination of flags OR'ed toghether, so the same - * callback function can be made to accept different events. - * The callback function must have the following prototype: - * - * void function(GSocket *socket, GSocketEvent event, char *cdata) - */ -void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags, - GSocketCallback callback, char *cdata) -{ - int count; - - assert(socket != NULL); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - socket->m_cbacks[count] = callback; - socket->m_data[count] = cdata; - } - } -} - -/* GSocket_UnsetCallback: - * Disables all callbacks specified by 'flags', which may be a - * combination of flags OR'ed toghether. - */ -void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags) -{ - int count; - - assert(socket != NULL); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - socket->m_cbacks[count] = NULL; - socket->m_data[count] = NULL; - } - } -} - - -#define CALL_CALLBACK(socket, event) { \ - _GSocket_Disable(socket, event); \ - if (socket->m_cbacks[event]) \ - socket->m_cbacks[event](socket, event, socket->m_data[event]); \ -} - -int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size) -{ - OTFlags flags ; - OTResult res ; - OTByteCount sz = 0 ; - - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( size > (int)sz ) - size = sz ; - res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ; - if ( res < 0 ) - { - return -1 ; - } - - // we simulate another read event if there are still bytes - if ( socket->m_takesEvents ) - { - OTByteCount sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - return res ; -} - -int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size) -{ -// TODO - int ret = -1; -#if 0 - struct sockaddr from; - SOCKLEN_T fromlen = sizeof(from); - GSocketError err; - - fromlen = sizeof(from); - - ret = recvfrom(socket->m_endpoint, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen); - - if (ret == -1) - return -1; - - /* Translate a system address into a GSocket address */ - if (!socket->m_peer) - { - socket->m_peer = GAddress_new(); - if (!socket->m_peer) - { - socket->m_error = GSOCK_MEMERR; - return -1; - } - } - err = _GAddress_translate_from(socket->m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(socket->m_peer); - socket->m_peer = NULL; - socket->m_error = err; - return -1; - } -#endif - return ret; -} - -int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size) -{ - OTFlags flags = 0 ; - OTResult res ; - - res = OTSnd( socket->m_endpoint , (void*) buffer , size , flags ) ; - return res ; -} - -int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size) -{ - int ret = -1 ; -// TODO -#if 0 - struct sockaddr *addr; - int len ; - GSocketError err; - - if (!socket->m_peer) - { - socket->m_error = GSOCK_INVADDR; - return -1; - } - - err = _GAddress_translate_to(socket->m_peer, &addr, &len); - if (err != GSOCK_NOERROR) - { - socket->m_error = err; - return -1; - } - - ret = sendto(socket->m_endpoint, buffer, size, 0, addr, len); - - /* Frees memory allocated from _GAddress_translate_to */ - free(addr); -#endif - return ret; -} - - -/* - * ------------------------------------------------------------------------- - * GAddress - * ------------------------------------------------------------------------- - */ - -/* CHECK_ADDRESS verifies that the current family is either GSOCK_NOFAMILY - * or GSOCK_*family*, and if it is GSOCK_NOFAMILY, it initalizes address - * to be a GSOCK_*family*. In other cases, it returns GSOCK_INVADDR. - */ -#define CHECK_ADDRESS(address, family, retval) \ -{ \ - if (address->m_family == GSOCK_NOFAMILY) \ - if (_GAddress_Init_##family(address) != GSOCK_NOERROR) \ - return address->m_error; \ - if (address->m_family != GSOCK_##family) \ - { \ - address->m_error = GSOCK_INVADDR; \ - return retval; \ - } \ -} - -GAddress *GAddress_new() -{ - GAddress *address; - - if ((address = (GAddress *) malloc(sizeof(GAddress))) == NULL) - return NULL; - - address->m_family = GSOCK_NOFAMILY; - address->m_host = INADDR_NONE ; - address->m_port = 0 ; - - return address; -} - -GAddress *GAddress_copy(GAddress *address) -{ - GAddress *addr2; - - assert(address != NULL); - - if ((addr2 = (GAddress *) malloc(sizeof(GAddress))) == NULL) - return NULL; - - memcpy(addr2, address, sizeof(GAddress)); - return addr2; -} - -void GAddress_destroy(GAddress *address) -{ - assert(address != NULL); - - free(address); -} - -void GAddress_SetFamily(GAddress *address, GAddressType type) -{ - assert(address != NULL); - - address->m_family = type; -} - -GAddressType GAddress_GetFamily(GAddress *address) -{ - assert(address != NULL); - - return address->m_family; -} - -GSocketError _GAddress_translate_from(GAddress *address, - InetAddress *addr) -{ - switch (addr->fAddressType) - { - case AF_INET: - address->m_family = GSOCK_INET; - break; -#ifdef AF_INET6 - case AF_INET6: - address->m_family = GSOCK_INET6; - break; -#endif - default: - { - address->m_error = GSOCK_INVOP; - return GSOCK_INVOP; - } - } - address->m_host = addr->fHost ; - address->m_port = addr->fPort ; - return GSOCK_NOERROR; -} - -GSocketError _GAddress_translate_to(GAddress *address, - InetAddress *addr) -{ - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - memset(addr, 0 , sizeof(struct InetAddress)); - OTInitInetAddress( addr , address->m_port , address->m_host ) ; - return GSOCK_NOERROR; -} - -/* - * ------------------------------------------------------------------------- - * Internet address family - * ------------------------------------------------------------------------- - */ - -GSocketError _GAddress_Init_INET(GAddress *address) -{ - address->m_family = GSOCK_INET; - address->m_host = kOTAnyInetAddress ; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) -{ - InetHostInfo hinfo ; - OSStatus ret ; - - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - - assert(address != NULL); - - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - ret = OTInetStringToAddress( gInetSvcRef , (char*) hostname , &hinfo ) ; - if ( ret != kOTNoError ) - { - address->m_host = INADDR_NONE ; - address->m_error = GSOCK_NOHOST; - return GSOCK_NOHOST; - } - address->m_host = hinfo.addrs[0] ; - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetAnyAddress(GAddress *address) -{ - return GAddress_INET_SetHostAddress(address, INADDR_ANY); -} - -GSocketError GAddress_INET_SetHostAddress(GAddress *address, - unsigned long hostaddr) -{ - assert(address != NULL); - - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - address->m_host = hostaddr ; - - return GSOCK_NOERROR; -} - -struct service_entry -{ - char * name ; - unsigned short port ; - char * protocol ; -} ; -typedef struct service_entry service_entry ; - -service_entry gServices[] = -{ - { "http" , 80 , "tcp" } -} ; - -GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, - const char *protocol) -{ - size_t i ; - - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - if (!port) - { - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; - } - for ( i = 0 ; i < sizeof( gServices) / sizeof( service_entry ) ; ++i ) - { - if ( strcmp( port , gServices[i].name ) == 0 ) - { - if ( protocol == NULL || strcmp( protocol , gServices[i].protocol ) ) - { - address->m_port = gServices[i].port ; - return GSOCK_NOERROR; - } - } - } - - if (isdigit(port[0])) - { - address->m_port = atoi(port); - return GSOCK_NOERROR; - } - - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; -} - -GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - address->m_port = port ; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf) -{ - InetDomainName name ; - if ( GSocket_Verify_Inited() == FALSE ) - return GSOCK_IOERR ; - - assert(address != NULL); - CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - - OTInetAddressToName( gInetSvcRef , address->m_host , name ) ; - strncpy( hostname , name , sbuf ) ; - return GSOCK_NOERROR; -} - -unsigned long GAddress_INET_GetHostAddress(GAddress *address) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, 0); - - return address->m_host; -} - -unsigned short GAddress_INET_GetPort(GAddress *address) -{ - assert(address != NULL); - CHECK_ADDRESS(address, INET, 0); - - return address->m_port; -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - if ( socket->m_takesEvents ) - return ; - - { - OTResult state ; - socket->m_takesEvents = TRUE ; - state = OTGetEndpointState(socket->m_endpoint); - - { - OTByteCount sz = 0 ; - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_detected |= GSOCK_INPUT_FLAG ; - (socket->m_cbacks[GSOCK_INPUT])(socket, GSOCK_INPUT, socket->m_data[GSOCK_INPUT]); - } - } - { - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_detected |=GSOCK_OUTPUT_FLAG ; - (socket->m_cbacks[GSOCK_OUTPUT])(socket, GSOCK_OUTPUT, socket->m_data[GSOCK_OUTPUT]); - } - } - } -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - socket->m_takesEvents = FALSE ; -} - -/* _GSocket_Input_Timeout: - * For blocking sockets, wait until data is available or - * until timeout ellapses. - */ -GSocketError _GSocket_Input_Timeout(GSocket *socket) -{ - if ( !socket->m_non_blocking ) - { - UnsignedWide now , start ; - short formerTakesEvents = socket->m_takesEvents ; - Microseconds(&start); - now = start ; - socket->m_takesEvents = FALSE ; - - while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) - { - OTResult state ; - OTByteCount sz = 0 ; - state = OTGetEndpointState(socket->m_endpoint); - - OTCountDataBytes( socket->m_endpoint , &sz ) ; - if ( state == T_INCON || sz > 0 ) - { - socket->m_takesEvents = formerTakesEvents ; - return GSOCK_NOERROR; - } - Microseconds(&now); - } - socket->m_takesEvents = formerTakesEvents ; - socket->m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - return GSOCK_NOERROR; -} - -/* _GSocket_Output_Timeout: - * For blocking sockets, wait until data can be sent without - * blocking or until timeout ellapses. - */ -GSocketError _GSocket_Output_Timeout(GSocket *socket) -{ - if ( !socket->m_non_blocking ) - { - UnsignedWide now , start ; - short formerTakesEvents = socket->m_takesEvents ; - Microseconds(&start); - now = start ; - socket->m_takesEvents = FALSE ; - - while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) - { - OTResult state ; - state = OTGetEndpointState(socket->m_endpoint); - - if ( state == T_DATAXFER || state == T_INREL ) - { - socket->m_takesEvents = formerTakesEvents ; - return GSOCK_NOERROR; - } - Microseconds(&now); - } - socket->m_takesEvents = formerTakesEvents ; - socket->m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - return GSOCK_NOERROR; -} - -/* GSOCK_INPUT: - * There is data to be read in the input buffer. If, after a read - * operation, there is still data available, the callback function will - * be called again. - * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call - * won't block. This event is generated only once, when the connection is - * first established, and then only if a call failed with GSOCK_WOULDBLOCK, - * when the output buffer empties again. This means that the app should - * assume that it can write since the first OUTPUT event, and no more - * OUTPUT events will be generated unless an error occurs. - * GSOCK_CONNECTION: - * Connection succesfully established, for client sockets, or incoming - * client connection, for server sockets. Wait for this event (also watch - * out for GSOCK_LOST) after you issue a nonblocking GSocket_Connect() call. - * GSOCK_LOST: - * The connection is lost (or a connection request failed); this could - * be due to a failure, or due to the peer closing it gracefully. - */ - -void _GSocket_Internal_Proc(unsigned long e , void* d ) -{ - - GSocket * socket = (GSocket*) d ; - OTEventCode ev = (OTEventCode) e ; - GSocketEvent event; - GSocketEvent event2; - GSocketCallback cback; - char *data; - GSocketCallback cback2; - char *data2; - - if ( !socket ) - return ; - event = GSOCK_MAX_EVENT ; - event2 = GSOCK_MAX_EVENT ; - cback = NULL; - data = NULL; - cback2 = NULL; - data2 = NULL; - - /* Check that the socket still exists (it has not been - * destroyed) and for safety, check that the m_endpoint field - * is what we expect it to be. - */ - if ((socket != NULL) && (socket->m_takesEvents)) - { - switch (ev) - { - case T_LISTEN : - event = GSOCK_CONNECTION ; - break ; - case T_CONNECT : - event = GSOCK_CONNECTION ; - event2 = GSOCK_OUTPUT ; - { - TCall retCall; - - retCall.addr.buf = NULL; - retCall.addr.maxlen = 0; - retCall.opt.buf = NULL; - retCall.opt.maxlen = 0; - retCall.udata.buf = NULL; - retCall.udata.maxlen= 0; - OTRcvConnect( socket->m_endpoint , &retCall ) ; - } - break ; - case T_DISCONNECT : - event = GSOCK_LOST ; - break ; - case T_GODATA : - case T_GOEXDATA : - event = GSOCK_OUTPUT ; - break ; - case T_DATA : - event = GSOCK_INPUT ; - break ; - case T_EXDATA : - event = GSOCK_INPUT ; - break ; - } - if (event != GSOCK_MAX_EVENT) - { - cback = socket->m_cbacks[event]; - data = socket->m_data[event]; - - if (event == GSOCK_LOST) - socket->m_detected = GSOCK_LOST_FLAG; - else - socket->m_detected |= (1 << event); - } - if (event2 != GSOCK_MAX_EVENT) - { - cback2 = socket->m_cbacks[event2]; - data2 = socket->m_data[event2]; - - if (event2 == GSOCK_LOST) - socket->m_detected = GSOCK_LOST_FLAG; - else - socket->m_detected |= (1 << event2); - } - } - - /* OK, we can now leave the critical section because we have - * already obtained the callback address (we make no further - * accesses to socket->whatever). However, the app should - * be prepared to handle events from a socket that has just - * been closed! - */ - - if (cback != NULL) - (cback)(socket, event, data); - if (cback2 != NULL) - (cback2)(socket, event2, data2); - -} - -/* Hack added for Mac OS X */ -GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf) -{ - return GSOCK_INVADDR; -} - -GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path) -{ - return GSOCK_INVADDR; -} - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ diff --git a/src/mac/classic/gsockosx.c b/src/mac/classic/gsockosx.c deleted file mode 100644 index 614ed425c8..0000000000 --- a/src/mac/classic/gsockosx.c +++ /dev/null @@ -1,181 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockosx.c - * Purpose: GSocket: Mac OS X mach-o part - * CVSID: $Id$ - * Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu - * ------------------------------------------------------------------------- */ - -#include "wx/setup.h" - -#if wxUSE_SOCKETS - -#include -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#include - -#define ALL_CALLBACK_TYPES (kCFSocketReadCallBack | kCFSocketWriteCallBack | kCFSocketConnectCallBack) - -struct MacGSocketData -{ - CFSocketRef socket; - CFRunLoopSourceRef source; -}; - -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) -{ - GSocket* socket = (GSocket*)info; - struct MacGSocketData* macdata; - macdata = (struct MacGSocketData*)socket->m_gui_dependent; - if (!macdata) return; - switch (callbackType) - { - case kCFSocketConnectCallBack: - assert(!socket->m_server); - socket->m_functions->Detected_Write(socket); - break; - case kCFSocketReadCallBack: - socket->m_functions->Detected_Read(socket); - break; - case kCFSocketWriteCallBack: - socket->m_functions->Detected_Write(socket); - break; - default: - break; /* We shouldn't get here. */ - } -} - -struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket) -{ - /* If socket is already created, returns a pointer to the data */ - /* Otherwise, creates socket and returns the pointer */ - CFSocketContext cont; - struct MacGSocketData* data = (struct MacGSocketData*)socket->m_gui_dependent; - - if (data && data->source) return data; - - /* CFSocket has not been created, create it: */ - if (socket->m_fd < 0 || !data) return NULL; - cont.version = 0; cont.retain = NULL; - cont.release = NULL; cont.copyDescription = NULL; - cont.info = socket; - - CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, - ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont); - CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0); - assert(source); - socket->m_gui_dependent = (char*)data; - - /* Keep the source and the socket around. */ - data->source = source; - data->socket = cf; - - return data; -} - -int _GSocket_GUI_Init(void) -{ - return 1; -} - -void _GSocket_GUI_Cleanup(void) -{ -} - -int _GSocket_GUI_Init_Socket(GSocket *socket) -{ - struct MacGSocketData *data = malloc(sizeof(struct MacGSocketData)); - if (data) - { - socket->m_gui_dependent = (char*)data; - data->socket = NULL; - data->source = NULL; - return 1; - } - return 0; -} - -void _GSocket_GUI_Destroy_Socket(GSocket *socket) -{ - struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent); - if (data) - { - CFRelease(data->socket); - free(data); - } -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketEnableCallBacks(data->socket, c); -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketDisableCallBacks(data->socket, c); -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - CFRunLoopAddSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopDefaultMode); -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */ - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes); - CFSocketInvalidate(data->socket); -} - -#endif // wxUSE_SOCKETS diff --git a/src/mac/classic/gsockosx.cpp b/src/mac/classic/gsockosx.cpp deleted file mode 100644 index 614ed425c8..0000000000 --- a/src/mac/classic/gsockosx.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockosx.c - * Purpose: GSocket: Mac OS X mach-o part - * CVSID: $Id$ - * Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu - * ------------------------------------------------------------------------- */ - -#include "wx/setup.h" - -#if wxUSE_SOCKETS - -#include -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#include - -#define ALL_CALLBACK_TYPES (kCFSocketReadCallBack | kCFSocketWriteCallBack | kCFSocketConnectCallBack) - -struct MacGSocketData -{ - CFSocketRef socket; - CFRunLoopSourceRef source; -}; - -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) -{ - GSocket* socket = (GSocket*)info; - struct MacGSocketData* macdata; - macdata = (struct MacGSocketData*)socket->m_gui_dependent; - if (!macdata) return; - switch (callbackType) - { - case kCFSocketConnectCallBack: - assert(!socket->m_server); - socket->m_functions->Detected_Write(socket); - break; - case kCFSocketReadCallBack: - socket->m_functions->Detected_Read(socket); - break; - case kCFSocketWriteCallBack: - socket->m_functions->Detected_Write(socket); - break; - default: - break; /* We shouldn't get here. */ - } -} - -struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket) -{ - /* If socket is already created, returns a pointer to the data */ - /* Otherwise, creates socket and returns the pointer */ - CFSocketContext cont; - struct MacGSocketData* data = (struct MacGSocketData*)socket->m_gui_dependent; - - if (data && data->source) return data; - - /* CFSocket has not been created, create it: */ - if (socket->m_fd < 0 || !data) return NULL; - cont.version = 0; cont.retain = NULL; - cont.release = NULL; cont.copyDescription = NULL; - cont.info = socket; - - CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, - ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont); - CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0); - assert(source); - socket->m_gui_dependent = (char*)data; - - /* Keep the source and the socket around. */ - data->source = source; - data->socket = cf; - - return data; -} - -int _GSocket_GUI_Init(void) -{ - return 1; -} - -void _GSocket_GUI_Cleanup(void) -{ -} - -int _GSocket_GUI_Init_Socket(GSocket *socket) -{ - struct MacGSocketData *data = malloc(sizeof(struct MacGSocketData)); - if (data) - { - socket->m_gui_dependent = (char*)data; - data->socket = NULL; - data->source = NULL; - return 1; - } - return 0; -} - -void _GSocket_GUI_Destroy_Socket(GSocket *socket) -{ - struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent); - if (data) - { - CFRelease(data->socket); - free(data); - } -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketEnableCallBacks(data->socket, c); -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketDisableCallBacks(data->socket, c); -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - CFRunLoopAddSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopDefaultMode); -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */ - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes); - CFSocketInvalidate(data->socket); -} - -#endif // wxUSE_SOCKETS diff --git a/src/mac/classic/helpxxxx.cpp b/src/mac/classic/helpxxxx.cpp deleted file mode 100644 index 7d0e4d1531..0000000000 --- a/src/mac/classic/helpxxxx.cpp +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpxxxx.cpp -// Purpose: Help system: native implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "helpxxxx.h" -#endif - -#include "wx/stubs/helpxxxx.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxXXXXHelpController, wxHelpControllerBase) -#endif - -wxXXXXHelpController::wxXXXXHelpController() -{ - m_helpFile = ""; -} - -wxXXXXHelpController::~wxXXXXHelpController() -{ -} - -bool wxXXXXHelpController::Initialize(const wxString& filename) -{ - m_helpFile = filename; - // TODO any other inits - return TRUE; -} - -bool wxXXXXHelpController::LoadFile(const wxString& file) -{ - m_helpFile = file; - // TODO - return TRUE; -} - -bool wxXXXXHelpController::DisplayContents() -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplaySection(int section) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplayBlock(long block) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::KeywordSearch(const wxString& k, - wxHelpSearchMode WXUNUSED(mode)) -{ - if (m_helpFile == "") return FALSE; - - // TODO - return FALSE; -} - -// Can't close the help window explicitly in WinHelp -bool wxXXXXHelpController::Quit() -{ - // TODO - return FALSE; -} - -void wxXXXXHelpController::OnQuit() -{ -} - diff --git a/src/mac/classic/hid.cpp b/src/mac/classic/hid.cpp deleted file mode 100644 index f4ce8a1874..0000000000 --- a/src/mac/classic/hid.cpp +++ /dev/null @@ -1,417 +0,0 @@ -#include "hid.h" - -#define wxFORCECHECK_MSG(arg, msg) \ -{\ - if (arg) \ - {\ - wxLogSysError(wxString::Format(wxT("Message:%s\nHID: %s failed!"), wxT(msg), wxT(#arg)));\ - return false;\ - }\ -} -#define wxIOCHECK(arg, msg) wxFORCECHECK_MSG(arg != kIOReturnSuccess, msg) -#define wxKERNCHECK(arg, msg) wxFORCECHECK_MSG(arg != KERN_SUCCESS, msg) -#define wxSCHECK(arg, msg) wxFORCECHECK_MSG(arg != S_OK, msg) - -void CFShowTypeIDDescription(CFTypeRef pData) -{ - if(!pData) - { - wxMessageBox("AHHH!"); - return; - } - - wxMessageBox( - CFStringGetCStringPtr( - CFCopyTypeIDDescription(CFGetTypeID(pData)),CFStringGetSystemEncoding() - ) - ); -} - -// ============================================================================ -// implementation -// ============================================================================ - - -bool wxHIDDevice::Create (const int& nClass, const int& nType) -{ - //Create the mach port - wxIOCHECK(IOMasterPort(bootstrap_port, &m_pPort), "Could not create mach port"); - - //Dictionary that will hold first - //the matching dictionary for determining which kind of devices we want, - //then later some registry properties from an iterator (see below) - CFMutableDictionaryRef pDictionary; - - //Create a dictionary - //The call to IOServiceMatching filters down the - //the services we want to hid services (and also eats the - //dictionary up for us (consumes one reference)) - wxASSERT((pDictionary = IOServiceMatching(kIOHIDDeviceKey)) != NULL ); - - //Here we'll filter down the services to what we want - if (nType != -1) - { - CFNumberRef pType = CFNumberCreate(kCFAllocatorDefault, - kCFNumberIntType, &nType); - CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsageKey), pType); - CFRelease(pType); - } - if (nClass != -1) - { - CFNumberRef pClass = CFNumberCreate(kCFAllocatorDefault, - kCFNumberIntType, &nClass); - CFDictionarySetValue(pDictionary, CFSTR(kIOHIDPrimaryUsagePageKey), pClass); - CFRelease(pClass); - } - - //Now get the maching services - io_iterator_t pIterator; - wxIOCHECK(IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator), "No Matching HID Services"); - wxASSERT(pIterator != NULL); - - //Now we iterate through them - io_object_t pObject; - while ( (pObject = IOIteratorNext(pIterator)) != NULL) - { - wxASSERT(IORegistryEntryCreateCFProperties(pObject, &pDictionary, - kCFAllocatorDefault, kNilOptions) == KERN_SUCCESS); - - //Just for sanity :) - wxASSERT(CFGetTypeID(CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey))) == CFStringGetTypeID()); - - //Get [product] name - m_szName = CFStringGetCStringPtr ( - (CFStringRef) CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey)), - CFStringGetSystemEncoding() - ); - - // - //Now the hard part - in order to scan things we need "cookies" - - // - wxCFArray CookieArray = CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDElementKey)); - BuildCookies(CookieArray); - if (m_ppQueue != NULL) - wxASSERT((*m_ppQueue)->start(m_ppQueue) == S_OK); - - //Create the interface (good grief - long function names!) - SInt32 nScore; - IOCFPlugInInterface** ppPlugin; - wxIOCHECK(IOCreatePlugInInterfaceForService(pObject, kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, &ppPlugin, &nScore), ""); - - //Now, the final thing we can check before we fall back to asserts - //(because the dtor only checks if the device is ok, so if anything - //fails from now on the dtor will delete the device anyway, so we can't break from this). - - //Get the HID interface from the plugin to the mach port - wxSCHECK((*ppPlugin)->QueryInterface(ppPlugin, - CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void**) &m_ppDevice), ""); - - //release the plugin - (*ppPlugin)->Release(ppPlugin); - - //open the HID interface... - wxASSERT((*m_ppDevice)->open(m_ppDevice, 0) == S_OK); - - //cleanup - CFRelease(pDictionary); - IOObjectRelease(pObject); - break; - } - //iterator cleanup - IOObjectRelease(pIterator); - - return true; -}//end Create() - -void wxHIDDevice::AddCookie(CFTypeRef Data, const int& i) -{ - CFNumberGetValue( - (CFNumberRef) CFDictionaryGetValue ( (CFDictionaryRef) Data - , CFSTR(kIOHIDElementCookieKey) - ), - kCFNumberIntType, - &m_pCookies[i] - ); -} - -void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, const int& i) -{ - AddCookie(Data, i); - wxASSERT((*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) == S_OK);//3rd Param flags (none yet) -} - -void wxHIDDevice::InitCookies(const size_t& dwSize, bool bQueue) -{ - m_pCookies = new IOHIDElementCookie[dwSize]; - if (bQueue) - { - wxASSERT( m_ppQueue != NULL); - wxASSERT( (m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice)) != NULL); - wxASSERT( (*m_ppQueue)->create(m_ppQueue, 0, 512) == S_OK); //Param 2, flags, none yet - } -} - -bool wxHIDDevice::IsActive(const int& nIndex) -{ - wxASSERT(m_pCookies[nIndex] != NULL); - IOHIDEventStruct Event; - (*m_ppDevice)->getElementValue(m_ppDevice, m_pCookies[nIndex], &Event); - return !!Event.value; -} - - -wxHIDDevice::~wxHIDDevice() -{ - if (m_ppDevice != NULL) - { - (*m_ppDevice)->close(m_ppDevice); - (*m_ppDevice)->Release(m_ppDevice); - mach_port_deallocate(mach_task_self(), m_pPort); - } - - if (m_pCookies != NULL) - { - delete [] m_pCookies; - if (m_ppQueue != NULL) - { - (*m_ppQueue)->stop(m_ppQueue); - (*m_ppQueue)->dispose(m_ppQueue); - (*m_ppQueue)->Release(m_ppQueue); - } - } -} -/* -enum -{ - kHIDUsage_KeyboardHyphen = 0x2D, - kHIDUsage_KeyboardEqualSign = 0x2E, - kHIDUsage_KeyboardOpenBracket = 0x2F, - kHIDUsage_KeyboardCloseBracket = 0x30, - kHIDUsage_KeyboardBackslash = 0x31, //* \ or | * - kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ * - kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : * - kHIDUsage_KeyboardQuote = 0x34, /* ' or " * - kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde * - kHIDUsage_KeyboardComma = 0x36, /* , or < * - kHIDUsage_KeyboardPeriod = 0x37, /* . or > * - kHIDUsage_KeyboardSlash = 0x38, /* / or ? * - kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock * - - kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen * - kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock * - kHIDUsage_KeyboardPause = 0x48, /* Pause * - kHIDUsage_KeyboardInsert = 0x49, /* Insert * - kHIDUsage_KeyboardHome = 0x4A, /* Home * - kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward * - - kHIDUsage_KeyboardUpArrow - kHIDUsage_KeypadNumLock - kHIDUsage_KeypadSlash - kHIDUsage_KeypadAsterisk - kHIDUsage_KeypadHyphen - kHIDUsage_KeypadPlus - kHIDUsage_KeypadEnter - kHIDUsage_KeypadPeriod - kHIDUsage_KeyboardNonUSBackslash - kHIDUsage_KeyboardApplication - kHIDUsage_KeyboardPower - kHIDUsage_KeypadEqualSign -}; -/* - enum wxKeyCode - { - - WXK_START = 300, - WXK_LBUTTON, - WXK_RBUTTON, - WXK_CANCEL, - WXK_MBUTTON, - WXK_CLEAR, - WXK_SHIFT, - WXK_ALT, - WXK_CONTROL, - WXK_MENU, - WXK_PAUSE, - WXK_PRIOR, * Page up * - WXK_NEXT, * Page down * - WXK_END, - WXK_HOME, - WXK_LEFT, - WXK_UP, - WXK_RIGHT, - WXK_DOWN, - WXK_SELECT, - WXK_PRINT, - WXK_EXECUTE, - WXK_SNAPSHOT, - WXK_INSERT, - WXK_HELP, - WXK_MULTIPLY, - WXK_ADD, - WXK_SEPARATOR, - WXK_SUBTRACT, - WXK_DECIMAL, - WXK_DIVIDE, - WXK_PAGEUP, - WXK_PAGEDOWN, - - WXK_NUMPAD_SPACE, - WXK_NUMPAD_TAB, - WXK_NUMPAD_ENTER, - WXK_NUMPAD_HOME, - WXK_NUMPAD_LEFT, - WXK_NUMPAD_UP, - WXK_NUMPAD_RIGHT, - WXK_NUMPAD_DOWN, - WXK_NUMPAD_PRIOR, - WXK_NUMPAD_PAGEUP, - WXK_NUMPAD_NEXT, - WXK_NUMPAD_PAGEDOWN, - WXK_NUMPAD_END, - WXK_NUMPAD_BEGIN, - WXK_NUMPAD_INSERT, - WXK_NUMPAD_DELETE, - WXK_NUMPAD_EQUAL, - WXK_NUMPAD_MULTIPLY, - WXK_NUMPAD_ADD, - WXK_NUMPAD_SEPARATOR, - WXK_NUMPAD_SUBTRACT, - WXK_NUMPAD_DECIMAL, - WXK_NUMPAD_DIVIDE, - - WXK_WINDOWS_LEFT, - WXK_WINDOWS_RIGHT, - WXK_WINDOWS_MENU , - WXK_COMMAND - }; - - */ -enum -{ - WXK_RSHIFT = 400, - WXK_RALT, - WXK_RCONTROL, - WXK_RMENU - -}; - -bool wxHIDKeyboard::Create() -{ - return wxHIDDevice::Create(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard); -} - -void wxHIDKeyboard::BuildCookies(wxCFArray& Array) -{ - Array = CFDictionaryGetValue((CFDictionaryRef)Array[0], CFSTR(kIOHIDElementKey)); - InitCookies(500); - int i, - nUsage; - for (i = 0; i < Array.Count(); ++i) - { - CFNumberGetValue( - (CFNumberRef) CFDictionaryGetValue((CFDictionaryRef) Array[i], CFSTR(kIOHIDElementUsageKey)), - kCFNumberLongType, &nUsage); - - if (nUsage >= kHIDUsage_KeyboardA && nUsage <= kHIDUsage_KeyboardZ) - AddCookie(Array[i], 'A' + (nUsage - kHIDUsage_KeyboardA) ); - else if (nUsage >= kHIDUsage_Keyboard1 && nUsage <= kHIDUsage_Keyboard9) - AddCookie(Array[i], '1' + (nUsage - kHIDUsage_Keyboard1) ); - else if (nUsage >= kHIDUsage_KeyboardF1 && nUsage <= kHIDUsage_KeyboardF12) - AddCookie(Array[i], WXK_F1 + (nUsage - kHIDUsage_KeyboardF1) ); - else if (nUsage >= kHIDUsage_KeyboardF13 && nUsage <= kHIDUsage_KeyboardF24) - AddCookie(Array[i], WXK_F13 + (nUsage - kHIDUsage_KeyboardF13) ); - else if (nUsage >= kHIDUsage_Keypad1 && nUsage <= kHIDUsage_Keypad9) - AddCookie(Array[i], WXK_NUMPAD1 + (nUsage - kHIDUsage_Keypad1) ); - else switch (nUsage) - { - //0's (wx & ascii go 0-9, but HID goes 1-0) - case kHIDUsage_Keyboard0: - AddCookie(Array[i],'0'); - break; - case kHIDUsage_Keypad0: - AddCookie(Array[i],WXK_NUMPAD0); - break; - - //Basic - case kHIDUsage_KeyboardReturnOrEnter: - AddCookie(Array[i], WXK_RETURN); - break; - case kHIDUsage_KeyboardEscape: - AddCookie(Array[i], WXK_ESCAPE); - break; - case kHIDUsage_KeyboardDeleteOrBackspace: - AddCookie(Array[i], WXK_BACK); - break; - case kHIDUsage_KeyboardTab: - AddCookie(Array[i], WXK_TAB); - break; - case kHIDUsage_KeyboardSpacebar: - AddCookie(Array[i], WXK_SPACE); - break; - case kHIDUsage_KeyboardPageUp: - AddCookie(Array[i], WXK_PRIOR); - break; - case kHIDUsage_KeyboardEnd: - AddCookie(Array[i], WXK_END); - break; - case kHIDUsage_KeyboardPageDown: - AddCookie(Array[i], WXK_NEXT); - break; - case kHIDUsage_KeyboardRightArrow: - AddCookie(Array[i], WXK_RIGHT); - break; - case kHIDUsage_KeyboardLeftArrow: - AddCookie(Array[i], WXK_LEFT); - break; - case kHIDUsage_KeyboardDownArrow: - AddCookie(Array[i], WXK_DOWN); - break; - case kHIDUsage_KeyboardUpArrow: - AddCookie(Array[i], WXK_UP); - break; - - //LEDS - case kHIDUsage_KeyboardCapsLock: - AddCookie(Array[i],WXK_CAPITAL); - break; - case kHIDUsage_KeypadNumLock: - AddCookie(Array[i],WXK_NUMLOCK); - break; - case kHIDUsage_KeyboardScrollLock: - AddCookie(Array[i],WXK_SCROLL); - break; - - //Menu keys, Shift, other specials - case kHIDUsage_KeyboardLeftControl: - AddCookie(Array[i],WXK_CONTROL); - break; - case kHIDUsage_KeyboardLeftShift: - AddCookie(Array[i],WXK_SHIFT); - break; - case kHIDUsage_KeyboardLeftAlt: - AddCookie(Array[i],WXK_ALT); - break; - case kHIDUsage_KeyboardLeftGUI: - AddCookie(Array[i],WXK_MENU); - break; - case kHIDUsage_KeyboardRightControl: - AddCookie(Array[i],WXK_RCONTROL); - break; - case kHIDUsage_KeyboardRightShift: - AddCookie(Array[i],WXK_RSHIFT); - break; - case kHIDUsage_KeyboardRightAlt: - AddCookie(Array[i],WXK_RALT); - break; - case kHIDUsage_KeyboardRightGUI: - AddCookie(Array[i],WXK_RMENU); - break; - - //Default - default: - //not in wx keycodes - do nothing.... - break; - } - } -}//end buildcookies diff --git a/src/mac/classic/icon.cpp b/src/mac/classic/icon.cpp deleted file mode 100644 index bd1937bc2a..0000000000 --- a/src/mac/classic/icon.cpp +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.cpp -// Purpose: wxIcon class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "icon.h" -#endif - -#include "wx/icon.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap) -#endif - -#include "wx/mac/private.h" - - -/* - * Icons - */ - -wxIcon::wxIcon() -{ -} - -wxIcon::wxIcon(const char bits[], int width, int height) : - wxBitmap(bits, width, height) -{ - -} - -wxIcon::wxIcon( const char **bits ) : - wxBitmap(bits) -{ -} - -wxIcon::wxIcon( char **bits ) : - wxBitmap(bits) -{ -} - -wxIcon::wxIcon(const wxString& icon_file, int flags, - int desiredWidth, int desiredHeight) -{ - LoadFile(icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight); -} - -wxIcon::~wxIcon() -{ -} - -bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, - int desiredWidth, int desiredHeight) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - wxBitmapHandler *handler = FindHandler((wxBitmapType)type); - - if ( handler ) - return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight); - else - return FALSE; -} - -void wxIcon::CopyFromBitmap(const wxBitmap& bmp) -{ - wxIcon *icon = (wxIcon*)(&bmp); - *this = *icon; -} - -IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler) - -bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - short theId = -1 ; - if ( name == wxT("wxICON_INFORMATION") ) - { - theId = kNoteIcon ; - } - else if ( name == wxT("wxICON_QUESTION") ) - { - theId = kCautionIcon ; - } - else if ( name == wxT("wxICON_WARNING") ) - { - theId = kCautionIcon ; - } - else if ( name == wxT("wxICON_ERROR") ) - { - theId = kStopIcon ; - } - else - { - Str255 theName ; - OSType theType ; - wxMacStringToPascal( name , theName ) ; - - Handle resHandle = GetNamedResource( 'cicn' , theName ) ; - if ( resHandle != 0L ) - { - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - } - } - if ( theId != -1 ) - { - CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ; - if ( theIcon ) - { - M_BITMAPHANDLERDATA->m_hIcon = theIcon ; - M_BITMAPHANDLERDATA->m_width = 32 ; - M_BITMAPHANDLERDATA->m_height = 32 ; - - M_BITMAPHANDLERDATA->m_depth = 8 ; - M_BITMAPHANDLERDATA->m_ok = true ; - M_BITMAPHANDLERDATA->m_numColors = 256 ; - M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeIcon ; - return TRUE ; - } - } - return FALSE ; -} diff --git a/src/mac/classic/joystick.cpp b/src/mac/classic/joystick.cpp deleted file mode 100644 index 156b9b2657..0000000000 --- a/src/mac/classic/joystick.cpp +++ /dev/null @@ -1,286 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.cpp -// Purpose: wxJoystick class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "joystick.h" -#endif - -#include "wx/setup.h" - -#include "wx/joystick.h" - -#if wxUSE_JOYSTICK - -IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -wxPoint wxJoystick::GetPosition() const -{ - // TODO - return wxPoint(0, 0); -} - -int wxJoystick::GetZPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetButtonState() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVCTSPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMovementThreshold() const -{ - // TODO - return 0; -} - -void wxJoystick::SetMovementThreshold(int threshold) -{ - // TODO -} - -// Capabilities -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::IsOk() const -{ - // TODO - return FALSE; -} - -int wxJoystick::GetNumberJoysticks() const -{ - // TODO - return 0; -} - -int wxJoystick::GetManufacturerId() const -{ - // TODO - return 0; -} - -int wxJoystick::GetProductId() const -{ - // TODO - return 0; -} - -wxString wxJoystick::GetProductName() const -{ - // TODO - return wxString(wxT("")); -} - -int wxJoystick::GetXMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetXMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMax() const -{ - // TODO - return 0; -} - -bool wxJoystick::HasRudder() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasZ() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasU() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV4Dir() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOVCTS() const -{ - // TODO - return FALSE; -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) -{ - // TODO - return FALSE; -} - -bool wxJoystick::ReleaseCapture() -{ - // TODO - return FALSE; -} - -#endif - // wxUSE_JOYSTICK - diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp deleted file mode 100644 index 8322a7a2f2..0000000000 --- a/src/mac/classic/listbox.cpp +++ /dev/null @@ -1,1023 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp -// Purpose: wxListBox -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "listbox.h" -#endif - -#include "wx/app.h" -#include "wx/listbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/toplevel.h" -#include "wx/dynarray.h" -#include "wx/log.h" - -#include "wx/utils.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) - -BEGIN_EVENT_TABLE(wxListBox, wxControl) - EVT_SIZE( wxListBox::OnSize ) - EVT_CHAR( wxListBox::OnChar ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -typedef struct { - unsigned short instruction; - void (*function)(); -} ldefRec, *ldefPtr, **ldefHandle; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#if TARGET_CARBON -const short kwxMacListItemHeight = 19 ; -#else -const short kwxMacListItemHeight = 14 ; -#endif - -extern "C" -{ -static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) ; -} - -static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect *drawRect, - Cell cell, short dataOffset, short dataLength, - ListHandle listHandle ) -{ - wxListBox* list; - list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) ); - if ( list == NULL ) - return ; - - GrafPtr savePort; - GrafPtr grafPtr; - RgnHandle savedClipRegion; - SInt32 savedPenMode; - GetPort(&savePort); - SetPort((**listHandle).port); - grafPtr = (**listHandle).port ; - // typecast our refCon - - // Calculate the cell rect. - - switch( message ) { - case lInitMsg: - break; - - case lCloseMsg: - break; - - case lDrawMsg: - { - const wxString linetext = list->m_stringArray[cell.v] ; - - // Save the current clip region, and set the clip region to the area we are about - // to draw. - - savedClipRegion = NewRgn(); - GetClip( savedClipRegion ); - - ClipRect( drawRect ); - EraseRect( drawRect ); - - const wxFont& font = list->GetFont(); - if ( font.Ok() ) - { - ::TextFont( font.GetMacFontNum() ) ; - ::TextSize( font.GetMacFontSize() ) ; - ::TextFace( font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - -#if TARGET_CARBON - { - Rect frame = { drawRect->top, drawRect->left + 4, - drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ; - CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ; - ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ; - ::DrawThemeTextBox( mString, - kThemeCurrentPortFont, - kThemeStateActive, - false, - &frame, - teJustLeft, - nil ); - CFRelease( mString ) ; - } -#else - { - wxCharBuffer text = linetext.mb_str( wxConvLocal) ; - MoveTo(drawRect->left + 4 , drawRect->top + 10 ); - DrawText(text, 0 , strlen(text) ); - } -#endif - // If the cell is hilited, do the hilite now. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - if( isSelected ) { - savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr ); - SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr)grafPtr, savedPenMode ); - } - - // Restore the saved clip region. - - SetClip( savedClipRegion ); - DisposeRgn( savedClipRegion ); - } - break; - case lHiliteMsg: - - // Hilite or unhilite the cell. Paint the cell contents with the - // appropriate QuickDraw transform mode. - - GetPort( &grafPtr ); - savedPenMode = GetPortPenMode( (CGrafPtr)grafPtr ); - SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode ); - PaintRect( drawRect ); - SetPortPenMode( (CGrafPtr)grafPtr, savedPenMode ); - break; - default : - break ; - } - SetPort(savePort); -} - -extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ; -// resources ldef ids -const short kwxMacListWithVerticalScrollbar = 128 ; -const short kwxMacListWithVerticalAndHorizontalScrollbar = 129 ; - -// ============================================================================ -// list box control implementation -// ============================================================================ - -// Listbox item -wxListBox::wxListBox() -{ - m_noItems = 0; - m_selected = 0; - m_macList = NULL ; -} - -static ListDefUPP macListDefUPP = NULL ; - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), - style, validator, name); -} - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) - return false; - - m_noItems = 0 ; // this will be increased by our append command - m_selected = 0; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - - ListDefSpec listDef; - listDef.defType = kListDefUserProcType; - if ( macListDefUPP == NULL ) - { - macListDefUPP = NewListDefUPP( wxMacListDefinition ); - } - listDef.u.userProc = macListDefUPP ; - - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; -#if TARGET_CARBON - GetThemeFont(kThemeViewsFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; -#else - GetFontName( kFontIDMonaco , fontName ) ; - fontSize = 9 ; - fontStyle = normal ; -#endif - SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , wxMacMakeStringFromPascal( fontName ) ) ) ; -#if TARGET_CARBON - Size asize; - - - CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, (style & wxLB_HSCROLL), true, - kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl ); - - GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, - sizeof(ListHandle), (Ptr) &m_macList, &asize); - - SetControlReference( (ControlHandle) m_macControl, (long) this); - SetControlVisibility( (ControlHandle) m_macControl, false, false); - -#else - - long result ; - wxStAppResource resload ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , - (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , - 0 , 0, kControlListBoxProc , (long) this ) ; - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag , - sizeof( ListHandle ) , (char*) &m_macList , &result ) ; - - HLock( (Handle) m_macList ) ; - ldefHandle ldef ; - ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ; - if ( (**(ListHandle)m_macList).listDefProc != NULL ) - { - (**ldef).instruction = 0x4EF9; /* JMP instruction */ - (**ldef).function = (void(*)()) listDef.u.userProc; - (**(ListHandle)m_macList).listDefProc = (Handle) ldef ; - } - - Point pt = (**(ListHandle)m_macList).cellSize ; - pt.v = kwxMacListItemHeight ; - LCellSize( pt , (ListHandle)m_macList ) ; - LAddColumn( 1 , 0 , (ListHandle)m_macList ) ; -#endif - OptionBits options = 0; - if ( style & wxLB_MULTIPLE ) - { - options += lExtendDrag + lUseSense ; - } - else if ( style & wxLB_EXTENDED ) - { - // default behaviour - } - else - { - options = (OptionBits) lOnlyOne ; - } - SetListSelectionFlags((ListHandle)m_macList, options); - - for ( int i = 0 ; i < n ; i++ ) - { - Append( choices[i] ) ; - } - - MacPostControlCreate() ; - - LSetDrawingMode( true , (ListHandle)m_macList ) ; - - return TRUE; -} - -wxListBox::~wxListBox() -{ - FreeData() ; - // avoid access during destruction - SetControlReference( (ControlHandle) m_macControl , NULL ) ; - if ( m_macList ) - { -#if !TARGET_CARBON - DisposeHandle( (**(ListHandle)m_macList).listDefProc ) ; - (**(ListHandle)m_macList).listDefProc = NULL ; -#endif - m_macList = NULL ; - } -} - -void wxListBox::FreeData() -{ -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) - { - size_t uiCount = m_aItems.Count(); - while ( uiCount-- != 0 ) { - delete m_aItems[uiCount]; - m_aItems[uiCount] = NULL; - } - - m_aItems.Clear(); - } - else -#endif // wxUSE_OWNER_DRAWN - if ( HasClientObjectData() ) - { - for ( size_t n = 0; n < (size_t)m_noItems; n++ ) - { - delete GetClientObject(n); - } - } -} - -void wxListBox::DoSetSize(int x, int y, - int width, int height, - int sizeFlags ) -{ - wxControl::DoSetSize( x , y , width , height , sizeFlags ) ; -#if TARGET_CARBON - Rect bounds ; - GetControlBounds( (ControlHandle) m_macControl , &bounds ) ; - ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ; - if ( control ) - { - Rect scrollbounds ; - GetControlBounds( control , &scrollbounds ) ; - if( scrollbounds.right != bounds.right + 1 ) - { - UMAMoveControl( control , bounds.right - (scrollbounds.right - scrollbounds.left) + 1 , - scrollbounds.top ) ; - } - } -#endif -} -void wxListBox::DoSetFirstItem(int N) -{ - MacScrollTo( N ) ; -} - -void wxListBox::Delete(int N) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::Delete") ); - -#if wxUSE_OWNER_DRAWN - delete m_aItems[N]; - m_aItems.RemoveAt(N); -#else // !wxUSE_OWNER_DRAWN - if ( HasClientObjectData() ) - { - delete GetClientObject(N); - } -#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN - m_stringArray.RemoveAt( N ) ; - m_dataArray.RemoveAt( N ) ; - m_noItems --; - - MacDelete( N ) ; -} - -int wxListBox::DoAppend(const wxString& item) -{ - int index = m_noItems ; - m_stringArray.Add( item ) ; - m_dataArray.Add( NULL ); - m_noItems ++; - DoSetItemClientData( index , NULL ) ; - MacAppend( item ) ; - - return index ; -} - -void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) -{ - MacSetRedraw( false ) ; - Clear() ; - int n = choices.GetCount(); - - for( int i = 0 ; i < n ; ++i ) - { - if ( clientData ) - { -#if wxUSE_OWNER_DRAWN - wxASSERT_MSG(clientData[i] == NULL, - wxT("Can't use client data with owner-drawn listboxes")); -#else // !wxUSE_OWNER_DRAWN - Append( choices[i] , clientData[i] ) ; -#endif - } - else - Append( choices[i] ) ; - } - -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) { - // first delete old items - size_t ui = m_aItems.Count(); - while ( ui-- != 0 ) { - delete m_aItems[ui]; - m_aItems[ui] = NULL; - } - m_aItems.Empty(); - - // then create new ones - for ( ui = 0; ui < (size_t)m_noItems; ui++ ) { - wxOwnerDrawn *pNewItem = CreateItem(ui); - pNewItem->SetName(choices[ui]); - m_aItems.Add(pNewItem); - } - } -#endif // wxUSE_OWNER_DRAWN - MacSetRedraw( true ) ; -} - -bool wxListBox::HasMultipleSelection() const -{ - return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED); -} - -int wxListBox::FindString(const wxString& s) const -{ - - if ( s.Right(1) == wxT("*") ) - { - wxString search = s.Left( s.Length() - 1 ) ; - int len = search.Length() ; - Str255 s1 , s2 ; - wxMacStringToPascal( search , s2 ) ; - - for ( int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ; - - if ( EqualString( s1 , s2 , false , false ) ) - return i ; - } - if ( s.Left(1) == wxT("*") && s.Length() > 1 ) - { - wxString st = s ; - st.MakeLower() ; - for ( int i = 0 ; i < m_noItems ; ++i ) - { - if ( GetString(i).Lower().Matches(st) ) - return i ; - } - } - - } - else - { - Str255 s1 , s2 ; - - wxMacStringToPascal( s , s2 ) ; - - for ( int i = 0 ; i < m_noItems ; ++ i ) - { - wxMacStringToPascal( m_stringArray[i] , s1 ) ; - - if ( EqualString( s1 , s2 , false , false ) ) - return i ; - } - } - return -1; -} - -void wxListBox::Clear() -{ - FreeData(); - m_noItems = 0; - m_stringArray.Empty() ; - m_dataArray.Empty() ; - MacClear() ; -} - -void wxListBox::SetSelection(int N, bool select) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::SetSelection") ); - MacSetSelection( N , select ) ; - GetSelections( m_selectionPreImage ) ; -} - -bool wxListBox::IsSelected(int N) const -{ - wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE, - wxT("invalid index in wxListBox::Selected") ); - - return MacIsSelected( N ) ; -} - -void *wxListBox::DoGetItemClientData(int N) const -{ - wxCHECK_MSG( N >= 0 && N < m_noItems, NULL, - wxT("invalid index in wxListBox::GetClientData")); - - return (void *)m_dataArray[N]; -} - -wxClientData *wxListBox::DoGetItemClientObject(int N) const -{ - return (wxClientData *) DoGetItemClientData( N ) ; -} - -void wxListBox::DoSetItemClientData(int N, void *Client_data) -{ - wxCHECK_RET( N >= 0 && N < m_noItems, - wxT("invalid index in wxListBox::SetClientData") ); - -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) - { - // client data must be pointer to wxOwnerDrawn, otherwise we would crash - // in OnMeasure/OnDraw. - wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes")); - } -#endif // wxUSE_OWNER_DRAWN - wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ; - - if ( m_dataArray.GetCount() > (size_t) N ) - { - m_dataArray[N] = (char*) Client_data ; - } - else - { - m_dataArray.Add( (char*) Client_data ) ; - } -} - -void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData) -{ - DoSetItemClientData(n, clientData); -} - -// Return number of selections and an array of selected integers -int wxListBox::GetSelections(wxArrayInt& aSelections) const -{ - return MacGetSelections( aSelections ) ; -} - -// Get single selection, for single choice list items -int wxListBox::GetSelection() const -{ - return MacGetSelection() ; -} - -// Find string for position -wxString wxListBox::GetString(int N) const -{ - return m_stringArray[N] ; -} - -void wxListBox::DoInsertItems(const wxArrayString& items, int pos) -{ - wxCHECK_RET( pos >= 0 && pos <= m_noItems, - wxT("invalid index in wxListBox::InsertItems") ); - - int nItems = items.GetCount(); - - for ( int i = 0 ; i < nItems ; i++ ) - { - m_stringArray.Insert( items[i] , pos + i ) ; - m_dataArray.Insert( NULL , pos + i ) ; - MacInsert( pos + i , items[i] ) ; - } - - m_noItems += nItems; -} - -void wxListBox::SetString(int N, const wxString& s) -{ - m_stringArray[N] = s ; - MacSet( N , s ) ; -} - -wxSize wxListBox::DoGetBestSize() const -{ - int lbWidth = 100; // some defaults - int lbHeight = 110; - int wLine; - - { - wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - - if ( m_font.Ok() ) - { - ::TextFont( m_font.GetMacFontNum() ) ; - ::TextSize( m_font.GetMacFontSize() ) ; - ::TextFace( m_font.GetMacFontStyle() ) ; - } - else - { - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - } - - // Find the widest line - for(int i = 0; i < GetCount(); i++) { - wxString str(GetString(i)); - #if wxUSE_UNICODE - Point bounds={0,0} ; - SInt16 baseline ; - ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) , - kThemeCurrentPortFont, - kThemeStateActive, - false, - &bounds, - &baseline ); - wLine = bounds.h ; - #else - wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ; - #endif - lbWidth = wxMax(lbWidth, wLine); - } - - // Add room for the scrollbar - lbWidth += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); - - // And just a bit more - int cy = 12 ; - int cx = ::TextWidth( "X" , 0 , 1 ) ; - lbWidth += cx ; - - // don't make the listbox too tall (limit height to around 10 items) but don't - // make it too small neither - lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10); - } - return wxSize(lbWidth, lbHeight); -} - -int wxListBox::GetCount() const -{ - return m_noItems; -} - -void wxListBox::SetupColours() -{ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetForegroundColour(GetParent()->GetForegroundColour()); -} - -void wxListBox::Refresh(bool eraseBack, const wxRect *rect) -{ - wxControl::Refresh( eraseBack , rect ) ; - // MacRedrawControl() ; -} - -#if wxUSE_OWNER_DRAWN - -class wxListBoxItem : public wxOwnerDrawn -{ -public: - wxListBoxItem(const wxString& str = ""); -}; - -wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE) -{ - // no bitmaps/checkmarks - SetMarginWidth(0); -} - -wxOwnerDrawn *wxListBox::CreateItem(size_t n) -{ - return new wxListBoxItem(); -} - -#endif //USE_OWNER_DRAWN - -// ============================================================================ -// list box control implementation -// ============================================================================ - -/* -void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) -{ -wxListBox* list; -// typecast our refCon -list = (wxListBox*)refCon; - - MoveTo(cellRect->left + 4 , cellRect->top + 10 ); - const wxString text = list->m_stringArray[lCell.v] ; - ::TextFont( kFontIDMonaco ) ; - ::TextSize( 9 ); - ::TextFace( 0 ) ; - DrawText(text, 0 , text.Length()); - - } -*/ -void wxListBox::MacDelete( int N ) -{ - LDelRow( 1 , N , (ListHandle)m_macList) ; - Refresh(); -} - -void wxListBox::MacInsert( int n , const wxString& text) -{ - Cell cell = { 0 , 0 } ; - cell.v = n ; - LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacAppend( const wxString& text) -{ - Cell cell = { 0 , 0 } ; - cell.v = (**(ListHandle)m_macList).dataBounds.bottom ; - LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacClear() -{ - LDelRow( (**(ListHandle)m_macList).dataBounds.bottom , 0 ,(ListHandle) m_macList ) ; - Refresh(); -} - -void wxListBox::MacSetSelection( int n , bool select ) -{ - Cell cell = { 0 , 0 } ; - if ( ! (m_windowStyle & wxLB_MULTIPLE) ) - { - if ( LGetSelect( true , &cell , (ListHandle)m_macList ) ) - { - LSetSelect( false , cell , (ListHandle)m_macList ) ; - } - } - - cell.v = n ; - LSetSelect( select , cell , (ListHandle)m_macList ) ; - LAutoScroll( (ListHandle)m_macList ) ; - Refresh(); -} - -bool wxListBox::MacIsSelected( int n ) const -{ - Cell cell = { 0 , 0 } ; - cell.v = n ; - return LGetSelect( false , &cell , (ListHandle)m_macList ) ; -} - -void wxListBox::MacDestroy() -{ - // DisposeExtLDEFInfo( m_macList ) ; -} - -int wxListBox::MacGetSelection() const -{ - Cell cell = { 0 , 0 } ; - if ( LGetSelect( true , &cell , (ListHandle)m_macList ) ) - return cell.v ; - else - return -1 ; -} - -int wxListBox::MacGetSelections( wxArrayInt& aSelections ) const -{ - int no_sel = 0 ; - - aSelections.Empty(); - - Cell cell = { 0 , 0 } ; - cell.v = 0 ; - - while ( LGetSelect( true , &cell ,(ListHandle) m_macList ) ) - { - aSelections.Add( cell.v ) ; - no_sel++ ; - cell.v++ ; - } - return no_sel ; -} - -void wxListBox::MacSet( int n , const wxString& text ) -{ - // our implementation does not store anything in the list - // so we just have to redraw - Cell cell = { 0 , 0 } ; - cell.v = n ; - // LSetCell(text, strlen(text), cell, m_macList); - Refresh(); -} - -void wxListBox::MacScrollTo( int n ) -{ - // TODO implement scrolling -} - -void wxListBox::OnSize( wxSizeEvent &event) -{ - Point pt; - -#if TARGET_CARBON - GetListCellSize((ListHandle)m_macList, &pt); -#else - pt = (**(ListHandle)m_macList).cellSize ; -#endif - pt.h = m_width - 15 ; - LCellSize( pt , (ListHandle)m_macList ) ; -} - -void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - Boolean wasDoubleClick = false ; - long result ; - - ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ; - if ( !wasDoubleClick ) - { - MacDoClick() ; - } - else - { - MacDoDoubleClick() ; - } -} - -void wxListBox::MacSetRedraw( bool doDraw ) -{ - LSetDrawingMode( doDraw , (ListHandle)m_macList ) ; - -} - -void wxListBox::MacDoClick() -{ - wxArrayInt aSelections; - int n ; - size_t count = GetSelections(aSelections); - - if ( count == m_selectionPreImage.GetCount() ) - { - bool hasChanged = false ; - for ( size_t i = 0 ; i < count ; ++i ) - { - if ( aSelections[i] != m_selectionPreImage[i] ) - { - hasChanged = true ; - break ; - } - } - if ( !hasChanged ) - { - return ; - } - } - - m_selectionPreImage = aSelections; - - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - if ( count > 0 ) - { - n = aSelections[0]; - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - event.SetString( GetString(n) ); - } - else - { - n = -1; - } - - event.m_commandInt = n; - - GetEventHandler()->ProcessEvent(event); -} - -void wxListBox::MacDoDoubleClick() -{ - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, m_windowId); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event) ; -} - -void wxListBox::OnChar(wxKeyEvent& event) -{ - if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER) - { - wxWindow* parent = GetParent() ; - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) - parent = parent->GetParent() ; - - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - event.Skip() ; - } - /* generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) */ - else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) ) - { - // FIXME: look in ancestors, not just parent. - wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ; - if (win) - { - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); - new_event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( new_event ); - } - } - else if ( event.GetKeyCode() == WXK_TAB ) - { - wxNavigationKeyEvent new_event; - new_event.SetEventObject( this ); - new_event.SetDirection( !event.ShiftDown() ); - /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - new_event.SetWindowChange( event.ControlDown() ); - new_event.SetCurrentFocus( this ); - if ( !GetEventHandler()->ProcessEvent( new_event ) ) - event.Skip() ; - } - else if ( event.GetKeyCode() == WXK_DOWN || event.GetKeyCode() == WXK_UP ) - { - // perform the default key handling first - wxControl::OnKeyDown( event ) ; - - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - wxArrayInt aSelections; - int n, count = GetSelections(aSelections); - if ( count > 0 ) - { - n = aSelections[0]; - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); - event.SetString( GetString(n) ); - } - else - { - n = -1; - } - - event.m_commandInt = n; - - GetEventHandler()->ProcessEvent(event); - } - else - { - if ( event.GetTimestamp() > m_lastTypeIn + 60 ) - { - m_typeIn = wxEmptyString ; - } - m_lastTypeIn = event.GetTimestamp() ; - m_typeIn += (char) event.GetKeyCode() ; - int line = FindString(wxT("*")+m_typeIn+wxT("*")) ; - if ( line >= 0 ) - { - if ( GetSelection() != line ) - { - SetSelection(line) ; - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId); - event.SetEventObject( this ); - - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject( line ) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(line) ); - event.SetString( GetString(line) ); - - event.m_commandInt = line ; - - GetEventHandler()->ProcessEvent(event); - } - } - } -} - diff --git a/src/mac/classic/macnotfy.cpp b/src/mac/classic/macnotfy.cpp deleted file mode 100644 index 690f83b214..0000000000 --- a/src/mac/classic/macnotfy.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: Mac Notifier Support - * Name: macnotfy.c - * Author: Stefan CSomor - * Purpose: Mac Notifier main file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ - -#include "wx/wx.h" - -#include "wx/mac/private.h" - -#include "wx/mac/macnotfy.h" - -const short kMaxEvents = 1000 ; - -struct wxMacNotificationEvents -{ - short top ; - short bottom ; - - wxMacNotificationProcPtr proc[kMaxEvents] ; - unsigned long events[kMaxEvents] ; - void* data[kMaxEvents] ; -} ; - -typedef struct wxMacNotificationEvents wxMacNotificationEvents ; -static wxMacNotificationEvents gMacNotificationEvents ; - -static ProcessSerialNumber gAppProcess ; - -void wxMacWakeUp() -{ - ProcessSerialNumber psn ; - Boolean isSame ; - psn.highLongOfPSN = 0 ; - psn.lowLongOfPSN = kCurrentProcess ; - SameProcess( &gAppProcess , &psn , &isSame ) ; - if ( isSame ) - { -#if TARGET_CARBON - EventRef dummyEvent ; - OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(), - kEventAttributeNone, &dummyEvent); - if (err == noErr) - { - err = PostEventToQueue(GetMainEventQueue(), dummyEvent, - kEventPriorityHigh); - } -#else - PostEvent( nullEvent , 0 ) ; -#endif - } - else - { - WakeUpProcess( &gAppProcess ) ; - } -} - -void wxMacCreateNotifierTable() -{ - GetCurrentProcess(&gAppProcess); - gMacNotificationEvents.top = 0 ; - gMacNotificationEvents.bottom = 0 ; - for ( int i = 0 ; i < kMaxEvents ; ++i ) - { - gMacNotificationEvents.proc[i] = NULL ; - gMacNotificationEvents.events[i] = NULL ; - gMacNotificationEvents.data[i] = NULL ; - } -} - -void wxMacDestroyNotifierTable() -{ -} - -wxMacNotifierTableRef wxMacGetNotifierTable() -{ - return (wxMacNotifierTableRef) &gMacNotificationEvents ; -} - -void wxMacAddEvent( - wxMacNotifierTableRef table , - wxMacNotificationProcPtr handler , - unsigned long event , - void* data , - short wakeUp ) -{ - wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ; - wxASSERT_MSG( handler != NULL , wxT("illegal notification proc ptr") ) ; - /* this should be protected eventually */ - short index = e->top++ ; - - if ( e->top == kMaxEvents ) - e->top = 0 ; - - e->proc[index] = handler ; - e->events[index] = event ; - e->data[index] = data ; - if ( wakeUp ) - wxMacWakeUp() ; -} - -bool gInProcessing = false ; - -void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data ) -{ - wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ; - /* this should be protected eventually */ - short index = e->bottom ; - - while ( e->top != index ) - { - if ( e->data[index] == data ) - e->data[index] = NULL ; - index++ ; - if ( index == kMaxEvents ) - index = 0 ; - } -} - -void wxMacProcessNotifierEvents() -{ - // if ( gInProcessing ) - // return ; - - gInProcessing = true ; - if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom ) - { - // we only should process the notifiers that were here when we entered it - // otherwise we might never get out... - short count = gMacNotificationEvents.top - gMacNotificationEvents.bottom ; - if ( count < 0 ) - count += kMaxEvents ; - - while ( count-- ) - { - // consume event at bottom - short index = gMacNotificationEvents.bottom++ ; - if ( gMacNotificationEvents.bottom == kMaxEvents ) - gMacNotificationEvents.bottom = 0 ; - void* data = gMacNotificationEvents.data[index] ; - unsigned long event = gMacNotificationEvents.events[index] ; - wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ; - - gMacNotificationEvents.data[index] = NULL ; - gMacNotificationEvents.events[index] = NULL ; - gMacNotificationEvents.proc[index] = NULL ; - - if ( handler ) - handler( event , data ) ; - } - } - gInProcessing = false ; -} - -void wxMacProcessNotifierAndPendingEvents() -{ - wxMacProcessNotifierEvents() ; - wxTheApp->ProcessPendingEvents() ; -} diff --git a/src/mac/classic/main.cpp b/src/mac/classic/main.cpp deleted file mode 100644 index ad5bd33263..0000000000 --- a/src/mac/classic/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: main.cpp -// Purpose: Entry point -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// We don't put main() in the library any more. GD. diff --git a/src/mac/classic/mdi.cpp b/src/mac/classic/mdi.cpp deleted file mode 100644 index add9482e11..0000000000 --- a/src/mac/classic/mdi.cpp +++ /dev/null @@ -1,395 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.cpp -// Purpose: MDI classes -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mdi.h" -#endif - -#include "wx/mdi.h" -#include "wx/menu.h" -#include "wx/settings.h" -#include "wx/log.h" - -#include "wx/mac/private.h" -#include "wx/mac/uma.h" - -extern wxWindowList wxModelessWindows; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_ACTIVATE(wxMDIParentFrame::OnActivate) - EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow) - EVT_SCROLL(wxMDIClientWindow::OnScroll) -END_EVENT_TABLE() - -#endif - -static const int IDM_WINDOWTILE = 4001; -static const int IDM_WINDOWTILEHOR = 4001; -static const int IDM_WINDOWCASCADE = 4002; -static const int IDM_WINDOWICONS = 4003; -static const int IDM_WINDOWNEXT = 4004; -static const int IDM_WINDOWTILEVERT = 4005; -static const int IDM_WINDOWPREV = 4006; - -// This range gives a maximum of 500 MDI children. Should be enough :-) -static const int wxFIRST_MDI_CHILD = 4100; -static const int wxLAST_MDI_CHILD = 4600; - -// Status border dimensions -static const int wxTHICK_LINE_BORDER = 3; - -// Parent frame - -wxMDIParentFrame::wxMDIParentFrame() -{ - m_clientWindow = NULL; - m_currentChild = NULL; - m_windowMenu = (wxMenu*) NULL; - m_parentFrameActive = TRUE; -} - -bool wxMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_clientWindow = NULL; - m_currentChild = NULL; - - // this style can be used to prevent a window from having the standard MDI - // "Window" menu - if ( style & wxFRAME_NO_WINDOW_MENU ) - { - m_windowMenu = (wxMenu *)NULL; - style -= wxFRAME_NO_WINDOW_MENU ; - } - else // normal case: we have the window menu, so construct it - { - m_windowMenu = new wxMenu; - - m_windowMenu->Append(IDM_WINDOWCASCADE, wxT("&Cascade")); - m_windowMenu->Append(IDM_WINDOWTILEHOR, wxT("Tile &Horizontally")); - m_windowMenu->Append(IDM_WINDOWTILEVERT, wxT("Tile &Vertically")); - m_windowMenu->AppendSeparator(); - m_windowMenu->Append(IDM_WINDOWICONS, wxT("&Arrange Icons")); - m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next")); - } - - wxFrame::Create( parent , id , title , pos , size , style , name ) ; - m_parentFrameActive = TRUE; - - OnCreateClient(); - - return TRUE; -} - -wxMDIParentFrame::~wxMDIParentFrame() -{ - DestroyChildren(); - // already delete by DestroyChildren() -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif - m_clientWindow = NULL ; - - if (m_windowMenu) - { - delete m_windowMenu; - m_windowMenu = (wxMenu*) NULL; - } - - if ( m_clientWindow ) - { - delete m_clientWindow; - m_clientWindow = NULL ; - } -} - - -void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - wxFrame::SetMenuBar( menu_bar ) ; -} - -void wxMDIParentFrame::MacActivate(long timestamp, bool activating) -{ - wxLogDebug(wxT("MDI PARENT=%p MacActivate(0x%08lx,%s)"),this,timestamp,activating?wxT("ACTIV"):wxT("deact")); - if(activating) - { - if(s_macDeactivateWindow && s_macDeactivateWindow->GetParent()==this) - { - wxLogDebug(wxT("child had been scheduled for deactivation, rehighlighting")); - UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->MacGetWindowRef(), true); - wxLogDebug(wxT("done highliting child")); - s_macDeactivateWindow = NULL; - } - else if(s_macDeactivateWindow == this) - { - wxLogDebug(wxT("Avoided deactivation/activation of this=%p"), this); - s_macDeactivateWindow = NULL; - } - else // window to deactivate is NULL or is not us or one of our kids - { - // activate kid instead - if(m_currentChild) - m_currentChild->MacActivate(timestamp,activating); - else - wxFrame::MacActivate(timestamp,activating); - } - } - else - { - // We were scheduled for deactivation, and now we do it. - if(s_macDeactivateWindow==this) - { - s_macDeactivateWindow = NULL; - if(m_currentChild) - m_currentChild->MacActivate(timestamp,activating); - wxFrame::MacActivate(timestamp,activating); - } - else // schedule ourselves for deactivation - { - if(s_macDeactivateWindow) - wxLogDebug(wxT("window=%p SHOULD have been deactivated, oh well!"),s_macDeactivateWindow); - wxLogDebug(wxT("Scheduling delayed MDI Parent deactivation")); - s_macDeactivateWindow = this; - } - } -} - -void wxMDIParentFrame::OnActivate(wxActivateEvent& event) -{ - event.Skip(); -} - -// Returns the active MDI child window -wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const -{ - return m_currentChild ; -} - -// Create the client window class (don't Create the window, -// just return a new class) -wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() -{ - m_clientWindow = new wxMDIClientWindow( this ); - return m_clientWindow; -} - -// Responds to colour changes, and passes event on to children. -void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - // TODO - - // Propagate the event to the non-top-level children - wxFrame::OnSysColourChanged(event); -} - -// MDI operations -void wxMDIParentFrame::Cascade() -{ - // TODO -} - -void wxMDIParentFrame::Tile() -{ - // TODO -} - -void wxMDIParentFrame::ArrangeIcons() -{ - // TODO -} - -void wxMDIParentFrame::ActivateNext() -{ - // TODO -} - -void wxMDIParentFrame::ActivatePrevious() -{ - // TODO -} - -// Child frame - -wxMDIChildFrame::wxMDIChildFrame() -{ - Init() ; -} -void wxMDIChildFrame::Init() -{ -} - -bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; - - m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - - wxModelessWindows.Append(this); - return FALSE; -} - -wxMDIChildFrame::~wxMDIChildFrame() -{ - wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame); - wxASSERT(mdiparent); - if(mdiparent->m_currentChild == this) - mdiparent->m_currentChild = NULL; - DestroyChildren(); - // already delete by DestroyChildren() -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif -} - -void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - return wxFrame::SetMenuBar( menu_bar ) ; -} - -void wxMDIChildFrame::MacActivate(long timestamp, bool activating) -{ - wxLogDebug(wxT("MDI child=%p MacActivate(0x%08lx,%s)"),this,timestamp,activating?wxT("ACTIV"):wxT("deact")); - wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame); - wxASSERT(mdiparent); - if(activating) - { - if(s_macDeactivateWindow == m_parent) - { - wxLogDebug(wxT("parent had been scheduled for deactivation, rehighlighting")); - UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->MacGetWindowRef(), true); - wxLogDebug(wxT("done highliting parent")); - s_macDeactivateWindow = NULL; - } - else if((mdiparent->m_currentChild==this) || !s_macDeactivateWindow) - mdiparent->wxFrame::MacActivate(timestamp,activating); - - if(mdiparent->m_currentChild && mdiparent->m_currentChild!=this) - mdiparent->m_currentChild->wxFrame::MacActivate(timestamp,false); - mdiparent->m_currentChild = this; - - if(s_macDeactivateWindow==this) - { - wxLogDebug(wxT("Avoided deactivation/activation of this=%p"),this); - s_macDeactivateWindow=NULL; - } - else - wxFrame::MacActivate(timestamp, activating); - } - else - { - // We were scheduled for deactivation, and now we do it. - if(s_macDeactivateWindow==this) - { - s_macDeactivateWindow = NULL; - wxFrame::MacActivate(timestamp,activating); - if(mdiparent->m_currentChild==this) - mdiparent->wxFrame::MacActivate(timestamp,activating); - } - else // schedule ourselves for deactivation - { - if(s_macDeactivateWindow) - wxLogDebug(wxT("window=%p SHOULD have been deactivated, oh well!"),s_macDeactivateWindow); - wxLogDebug(wxT("Scheduling delayed deactivation")); - s_macDeactivateWindow = this; - } - } -} - -// MDI operations -void wxMDIChildFrame::Maximize() -{ - wxFrame::Maximize() ; -} - -void wxMDIChildFrame::Restore() -{ - wxFrame::Restore() ; -} - -void wxMDIChildFrame::Activate() -{ -} - -//----------------------------------------------------------------------------- -// wxMDIClientWindow -//----------------------------------------------------------------------------- - -wxMDIClientWindow::wxMDIClientWindow() -{ -} - -wxMDIClientWindow::~wxMDIClientWindow() -{ - DestroyChildren(); -} - -bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) -{ - - m_windowId = (int)NewControlId(); - - if ( parent ) - { - parent->AddChild(this); - } - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); - - wxModelessWindows.Append(this); - return TRUE; -} - -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const -{ - wxDisplaySize( x , y ) ; -} - -// Explicitly call default scroll behaviour -void wxMDIClientWindow::OnScroll(wxScrollEvent& event) -{ -} - diff --git a/src/mac/classic/menu.cpp b/src/mac/classic/menu.cpp deleted file mode 100644 index 9a04c36935..0000000000 --- a/src/mac/classic/menu.cpp +++ /dev/null @@ -1,881 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp -// Purpose: wxMenu, wxMenuBar, wxMenuItem -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "menu.h" -#pragma implementation "menuitem.h" -#endif - -// ============================================================================ -// headers & declarations -// ============================================================================ - -// wxWindows headers -// ----------------- - -#include "wx/app.h" -#include "wx/menu.h" -#include "wx/menuitem.h" -#include "wx/window.h" -#include "wx/log.h" -#include "wx/utils.h" -#include "wx/frame.h" - -#include "wx/mac/uma.h" - -// other standard headers -// ---------------------- -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) -#endif - -// the (popup) menu title has this special id -static const int idMenuTitle = -2; -static MenuItemIndex firstUserHelpMenuItem = 0 ; - -const short kwxMacMenuBarResource = 1 ; -const short kwxMacAppleMenuId = 1 ; - -// ============================================================================ -// implementation -// ============================================================================ -static void wxMenubarUnsetInvokingWindow( wxMenu *menu ) ; -static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ); - -// Menus - -// Construct a menu with optional title (then use append) - -#ifdef __DARWIN__ -short wxMenu::s_macNextMenuId = 3 ; -#else -short wxMenu::s_macNextMenuId = 2 ; -#endif - -void wxMenu::Init() -{ - m_doBreak = FALSE; - m_startRadioGroup = -1; - - // create the menu - m_macMenuId = s_macNextMenuId++; - m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() ); - - if ( !m_hMenu ) - { - wxLogLastError(wxT("UMANewMenu failed")); - } - - // if we have a title, insert it in the beginning of the menu - if ( !!m_title ) - { - Append(idMenuTitle, m_title) ; - AppendSeparator() ; - } -} - -wxMenu::~wxMenu() -{ - if (MAC_WXHMENU(m_hMenu)) - ::DisposeMenu(MAC_WXHMENU(m_hMenu)); -} - -void wxMenu::Break() -{ - // not available on the mac platform -} - -void wxMenu::Attach(wxMenuBarBase *menubar) -{ - wxMenuBase::Attach(menubar); - - EndRadioGroup(); -} - -// function appends a new item or submenu to the menu -// append a new item or submenu to the menu -bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) -{ - wxASSERT_MSG( pItem != NULL, wxT("can't append NULL item to the menu") ); - - if ( pItem->IsSeparator() ) - { - if ( pos == (size_t)-1 ) - MacAppendMenu(MAC_WXHMENU(m_hMenu), "\p-"); - else - MacInsertMenuItem(MAC_WXHMENU(m_hMenu), "\p-" , pos); - } - else - { - wxMenu *pSubMenu = pItem->GetSubMenu() ; - if ( pSubMenu != NULL ) - { - wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added")); - pSubMenu->m_menuParent = this ; - - if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar) - { - pSubMenu->MacBeforeDisplay( true ) ; - } - - if ( pos == (size_t)-1 ) - UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pSubMenu->m_macMenuId); - else - UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pos, pSubMenu->m_macMenuId); - pItem->UpdateItemBitmap() ; - pItem->UpdateItemStatus() ; - } - else - { - if ( pos == (size_t)-1 ) - { - UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , wxFont::GetDefaultEncoding() ); - pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ; - } - else - { - // MacOS counts menu items from 1 and inserts after, therefore having the - // same effect as wx 0 based and inserting before, we must correct pos - // after however for updates to be correct - UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos); - pos += 1 ; - } - - SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ; - pItem->UpdateItemText() ; - pItem->UpdateItemBitmap() ; - pItem->UpdateItemStatus() ; - - if ( pItem->GetId() == idMenuTitle ) - { - UMAEnableMenuItem(MAC_WXHMENU(m_hMenu) , pos , false ) ; - } - } - } - // if we're already attached to the menubar, we must update it - if ( IsAttached() ) - { - m_menuBar->Refresh(); - } - return TRUE ; -} - -void wxMenu::EndRadioGroup() -{ - // we're not inside a radio group any longer - m_startRadioGroup = -1; -} - -wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); - - bool check = FALSE; - - if ( item->GetKind() == wxITEM_RADIO ) - { - int count = GetMenuItemCount(); - - if ( m_startRadioGroup == -1 ) - { - // start a new radio group - m_startRadioGroup = count; - - // for now it has just one element - item->SetAsRadioGroupStart(); - item->SetRadioGroupEnd(m_startRadioGroup); - - // ensure that we have a checked item in the radio group - check = TRUE; - } - else // extend the current radio group - { - // we need to update its end item - item->SetRadioGroupStart(m_startRadioGroup); - wxMenuItemList::Node *node = GetMenuItems().Item(m_startRadioGroup); - - if ( node ) - { - node->GetData()->SetRadioGroupEnd(count); - } - else - { - wxFAIL_MSG( _T("where is the radio group start item?") ); - } - } - } - else // not a radio item - { - EndRadioGroup(); - } - - if ( !wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item) ) - { - return NULL; - } - - if ( check ) - { - // check the item initially - item->Check(TRUE); - } - - return item; -} - -wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) -{ - if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos)) - return item; - else - return NULL; -} - -wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) -{ - // we need to find the items position in the child list - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData() == item ) - break; - - node = node->GetNext(); - } - - // DoRemove() (unlike Remove) can only be called for existing item! - wxCHECK_MSG( node, NULL, wxT("bug in wxMenu::Remove logic") ); - - ::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1); - - if ( IsAttached() ) - { - // otherwise, the change won't be visible - m_menuBar->Refresh(); - } - - // and from internal data structures - return wxMenuBase::DoRemove(item); -} - -void wxMenu::SetTitle(const wxString& label) -{ - m_title = label ; - UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ; -} -bool wxMenu::ProcessCommand(wxCommandEvent & event) -{ - bool processed = FALSE; - - // Try the menu's event handler - if ( !processed && GetEventHandler()) - { - processed = GetEventHandler()->ProcessEvent(event); - } - - // Try the window the menu was popped up from (and up through the - // hierarchy) - wxWindow *win = GetInvokingWindow(); - if ( !processed && win ) - processed = win->GetEventHandler()->ProcessEvent(event); - - return processed; -} - - -// --------------------------------------------------------------------------- -// other -// --------------------------------------------------------------------------- - -wxWindow *wxMenu::GetWindow() const -{ - if ( m_invokingWindow != NULL ) - return m_invokingWindow; - else if ( m_menuBar != NULL) - return (wxWindow *) m_menuBar->GetFrame(); - - return NULL; -} - -// helper functions returning the mac menu position for a certain item, note that this is -// mac-wise 1 - based, i.e. the first item has index 1 whereas on MSWin it has pos 0 - -int wxMenu::MacGetIndexFromId( int id ) -{ - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData()->GetId() == id ) - break; - - node = node->GetNext(); - } - - if (!node) - return 0; - - return pos + 1 ; -} - -int wxMenu::MacGetIndexFromItem( wxMenuItem *pItem ) -{ - size_t pos; - wxMenuItemList::Node *node = GetMenuItems().GetFirst(); - for ( pos = 0; node; pos++ ) - { - if ( node->GetData() == pItem ) - break; - - node = node->GetNext(); - } - - if (!node) - return 0; - - return pos + 1 ; -} - -void wxMenu::MacEnableMenu( bool bDoEnable ) -{ - UMAEnableMenuItem(MAC_WXHMENU(m_hMenu) , 0 , bDoEnable ) ; - - ::DrawMenuBar() ; -} - -// MacOS needs to know about submenus somewhere within this menu -// before it can be displayed , also hide special menu items like preferences -// that are handled by the OS -void wxMenu::MacBeforeDisplay( bool isSubMenu ) -{ - wxMenuItem* previousItem = NULL ; - size_t pos ; - wxMenuItemList::Node *node; - wxMenuItem *item; - for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - wxMenu* subMenu = item->GetSubMenu() ; - if (subMenu) - { - subMenu->MacBeforeDisplay( true ) ; - } - else - { - #if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) - { - if ( item->GetId() == wxApp::s_macPreferencesMenuItemId || item->GetId() == wxApp::s_macExitMenuItemId) - { - ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos + 1, kMenuItemAttrHidden, 0 ); - if ( GetMenuItems().GetCount() == pos + 1 && - previousItem != NULL && - previousItem->IsSeparator() ) - { - ChangeMenuItemAttributes( MAC_WXHMENU( GetHMenu() ) , pos , kMenuItemAttrHidden, 0 ); - } - } - } - #endif - } - previousItem = item ; - } - - if ( isSubMenu ) - ::InsertMenu(MAC_WXHMENU( GetHMenu()), -1); - -} -// undo all changes from the MacBeforeDisplay call -void wxMenu::MacAfterDisplay( bool isSubMenu ) -{ - if ( isSubMenu ) - ::DeleteMenu(MacGetMenuId()); - - wxMenuItem* previousItem = NULL ; - int pos ; - wxMenuItemList::Node *node; - wxMenuItem *item; - for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - wxMenu* subMenu = item->GetSubMenu() ; - if (subMenu) - { - subMenu->MacAfterDisplay( true ) ; - } - else - { - // no need to undo hidings - } - previousItem = item ; - } -} - -// Menu Bar - -/* - -Mac Implementation note : - -The Mac has only one global menubar, so we attempt to install the currently -active menubar from a frame, we currently don't take into account mdi-frames -which would ask for menu-merging - -Secondly there is no mac api for changing a menubar that is not the current -menubar, so we have to wait for preparing the actual menubar until the -wxMenubar is to be used - -We can in subsequent versions use MacInstallMenuBar to provide some sort of -auto-merge for MDI in case this will be necessary - -*/ - -wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ; -wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ; - -void wxMenuBar::Init() -{ - m_eventHandler = this; - m_menuBarFrame = NULL; - m_invokingWindow = (wxWindow*) NULL; -} - -wxMenuBar::wxMenuBar() -{ - Init(); -} - -wxMenuBar::wxMenuBar( long WXUNUSED(style) ) -{ - Init(); -} - - -wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[]) -{ - Init(); - - m_titles.Alloc(count); - - for ( int i = 0; i < count; i++ ) - { - m_menus.Append(menus[i]); - m_titles.Add(titles[i]); - - menus[i]->Attach(this); - } -} - -wxMenuBar::~wxMenuBar() -{ - if (s_macCommonMenuBar == this) - s_macCommonMenuBar = NULL; - if (s_macInstalledMenuBar == this) - { - ::ClearMenuBar(); - s_macInstalledMenuBar = NULL; - } - -} - -void wxMenuBar::Refresh(bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect)) -{ - wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") ); - - DrawMenuBar(); -} - -void wxMenuBar::MacInstallMenuBar() -{ - if ( s_macInstalledMenuBar == this ) - return ; - - wxStAppResource resload ; - - Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; - wxString message ; - wxCHECK_RET( menubar != NULL, wxT("can't read MBAR resource") ); - ::SetMenuBar( menubar ) ; -#if TARGET_API_MAC_CARBON - ::DisposeMenuBar( menubar ) ; -#else - ::DisposeHandle( menubar ) ; -#endif - -#if TARGET_API_MAC_OS8 - MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; - if ( CountMenuItems( menu ) == 2 ) - { - ::AppendResMenu(menu, 'DRVR'); - } -#endif - - // clean-up the help menu before adding new items - MenuHandle mh = NULL ; - if ( UMAGetHelpMenu( &mh , &firstUserHelpMenuItem) == noErr ) - { - for ( int i = CountMenuItems( mh ) ; i >= firstUserHelpMenuItem ; --i ) - { - DeleteMenuItem( mh , i ) ; - } - } - else - { - mh = NULL ; - } -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 && wxApp::s_macPreferencesMenuItemId) - { - wxMenuItem *item = FindItem( wxApp::s_macPreferencesMenuItemId , NULL ) ; - if ( item == NULL || !(item->IsEnabled()) ) - DisableMenuCommand( NULL , kHICommandPreferences ) ; - else - EnableMenuCommand( NULL , kHICommandPreferences ) ; - } -#endif - for (size_t i = 0; i < m_menus.GetCount(); i++) - { - wxMenuItemList::Node *node; - wxMenuItem *item; - int pos ; - wxMenu* menu = m_menus[i] , *subMenu = NULL ; - - if( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName ) - { - if ( mh == NULL ) - { - continue ; - } - - for (pos = 0 , node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - subMenu = item->GetSubMenu() ; - if (subMenu) - { - // we don't support hierarchical menus in the help menu yet - } - else - { - if ( item->IsSeparator() ) - { - if ( mh ) - MacAppendMenu(mh, "\p-" ); - } - else - { - wxAcceleratorEntry* entry = wxGetAccelFromString( item->GetText() ) ; - - if ( item->GetId() == wxApp::s_macAboutMenuItemId ) - { - UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() , wxFont::GetDefaultEncoding() ); - UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true ); - SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ; - UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ; - } - else - { - if ( mh ) - { - UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry); - SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ; - } - } - - delete entry ; - } - } - } - } - else - { - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], m_font.GetEncoding() ) ; - m_menus[i]->MacBeforeDisplay(false) ; - ::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0); - } - } - ::DrawMenuBar() ; - s_macInstalledMenuBar = this; -} - -void wxMenuBar::EnableTop(size_t pos, bool enable) -{ - wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") ); - m_menus[pos]->MacEnableMenu( enable ) ; - Refresh(); -} - -void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) -{ - wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") ); - - m_titles[pos] = label; - - if ( !IsAttached() ) - { - return; - } - - m_menus[pos]->SetTitle( label ) ; - if (wxMenuBar::s_macInstalledMenuBar == this) // are we currently installed ? - { - ::SetMenuBar( GetMenuBar() ) ; - ::InvalMenuBar() ; - } -} - -wxString wxMenuBar::GetLabelTop(size_t pos) const -{ - wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString, - wxT("invalid menu index in wxMenuBar::GetLabelTop") ); - - return m_titles[pos]; -} - -int wxMenuBar::FindMenu(const wxString& title) -{ - wxString menuTitle = wxStripMenuCodes(title); - - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title = wxStripMenuCodes(m_titles[i]); - if ( menuTitle == title ) - return i; - } - - return wxNOT_FOUND; - -} - - -// --------------------------------------------------------------------------- -// wxMenuBar construction -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// wxMenuBar construction -// --------------------------------------------------------------------------- - -wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) -{ - wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title); - if ( !menuOld ) - return FALSE; - m_titles[pos] = title; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - menuOld->MacAfterDisplay( false ) ; - ::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; - { - menu->MacBeforeDisplay( false ) ; - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - if ( pos == m_menus.GetCount() - 1) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - else - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , m_menus[pos+1]->MacGetMenuId() ) ; - } - } - } - - Refresh(); - } - - return menuOld; -} - -bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) -{ - if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; - - m_titles.Insert(title, pos); - - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - - if ( IsAttached() && s_macInstalledMenuBar == this ) - { - if (s_macInstalledMenuBar == this) - { - menu->MacBeforeDisplay( false ) ; - if ( pos == (size_t) -1 || pos + 1 == m_menus.GetCount() ) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - else - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , m_menus[pos+1]->MacGetMenuId() ) ; - } - } - Refresh(); - } - - return TRUE; -} - -wxMenu *wxMenuBar::Remove(size_t pos) -{ - wxMenu *menu = wxMenuBarBase::Remove(pos); - if ( !menu ) - return NULL; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - ::DeleteMenu( menu->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; - } - - Refresh(); - } - - m_titles.RemoveAt(pos); - - return menu; -} - -bool wxMenuBar::Append(wxMenu *menu, const wxString& title) -{ - WXHMENU submenu = menu ? menu->GetHMenu() : 0; - wxCHECK_MSG( submenu, FALSE, wxT("can't append invalid menu to menubar") ); - - if ( !wxMenuBarBase::Append(menu, title) ) - return FALSE; - - m_titles.Add(title); - - UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ; - - if ( IsAttached() ) - { - if (s_macInstalledMenuBar == this) - { - ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; - } - - Refresh(); - } - - // m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables - // adding menu later on. - if (m_invokingWindow) - wxMenubarSetInvokingWindow( menu, m_invokingWindow ); - - return TRUE; -} - -static void wxMenubarUnsetInvokingWindow( wxMenu *menu ) -{ - menu->SetInvokingWindow( (wxWindow*) NULL ); - - wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst(); - while (node) - { - wxMenuItem *menuitem = node->GetData(); - if (menuitem->IsSubMenu()) - wxMenubarUnsetInvokingWindow( menuitem->GetSubMenu() ); - node = node->GetNext(); - } -} - -static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ) -{ - menu->SetInvokingWindow( win ); - - wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst(); - while (node) - { - wxMenuItem *menuitem = node->GetData(); - if (menuitem->IsSubMenu()) - wxMenubarSetInvokingWindow( menuitem->GetSubMenu() , win ); - node = node->GetNext(); - } -} - -void wxMenuBar::UnsetInvokingWindow() -{ - m_invokingWindow = (wxWindow*) NULL; - wxMenuList::Node *node = m_menus.GetFirst(); - while (node) - { - wxMenu *menu = node->GetData(); - wxMenubarUnsetInvokingWindow( menu ); - node = node->GetNext(); - } -} - -void wxMenuBar::SetInvokingWindow(wxFrame *frame) -{ - m_invokingWindow = frame; - wxMenuList::Node *node = m_menus.GetFirst(); - while (node) - { - wxMenu *menu = node->GetData(); - wxMenubarSetInvokingWindow( menu, frame ); - node = node->GetNext(); - } -} - -void wxMenuBar::Detach() -{ - wxMenuBarBase::Detach() ; -} - -void wxMenuBar::Attach(wxFrame *frame) -{ - wxMenuBarBase::Attach( frame ) ; -} -// --------------------------------------------------------------------------- -// wxMenuBar searching for menu items -// --------------------------------------------------------------------------- - -// Find the itemString in menuString, and return the item id or wxNOT_FOUND -int wxMenuBar::FindMenuItem(const wxString& menuString, - const wxString& itemString) const -{ - wxString menuLabel = wxStripMenuCodes(menuString); - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title = wxStripMenuCodes(m_titles[i]); - if ( menuString == title ) - return m_menus[i]->FindItem(itemString); - } - - return wxNOT_FOUND; -} - -wxMenuItem *wxMenuBar::FindItem(int id, wxMenu **itemMenu) const -{ - if ( itemMenu ) - *itemMenu = NULL; - - wxMenuItem *item = NULL; - size_t count = GetMenuCount(); - for ( size_t i = 0; !item && (i < count); i++ ) - { - item = m_menus[i]->FindItem(id, itemMenu); - } - - return item; -} - - diff --git a/src/mac/classic/menuitem.cpp b/src/mac/classic/menuitem.cpp deleted file mode 100644 index 6cc3aa1a79..0000000000 --- a/src/mac/classic/menuitem.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp -// Purpose: wxMenuItem implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers & declarations -// ============================================================================ - -#include "wx/app.h" -#include "wx/menu.h" -#include "wx/menuitem.h" - -#include "wx/mac/uma.h" -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// dynamic classes implementation -// ---------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) -#endif //USE_SHARED_LIBRARY - -// ---------------------------------------------------------------------------- -// wxMenuItem -// ---------------------------------------------------------------------------- - -// -// ctor & dtor -// ----------- - -wxMenuItem::wxMenuItem(wxMenu *pParentMenu, - int id, - const wxString& text, - const wxString& strHelp, - wxItemKind kind, - wxMenu *pSubMenu) - : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) -{ - // TO DISCUSS on dev : whether we can veto id 0 - // wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ; - - // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines - // therefore these item must not be translated - if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) - { - m_text =wxT("Quit\tCtrl+Q") ; - } - - m_radioGroup.start = -1; - m_isRadioGroupStart = FALSE; -} - -wxMenuItem::~wxMenuItem() -{ -} - -// change item state -// ----------------- - -void wxMenuItem::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - UpdateItemBitmap() ; -} - -void wxMenuItem::UpdateItemBitmap() -{ - if ( !m_parentMenu ) - return ; - - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - if ( m_bitmap.Ok() ) - { - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , m_bitmap , kControlContentCIconHandle ) ; - if ( info.contentType != kControlNoContent ) - { - if ( info.contentType == kControlContentCIconHandle ) - SetMenuItemIconHandle( mhandle , index , - kMenuColorIconType , (Handle) info.u.cIconHandle ) ; - } - - } -} - -void wxMenuItem::UpdateItemStatus() -{ - if ( !m_parentMenu ) - return ; - -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId) - { - if ( !IsEnabled() ) - DisableMenuCommand( NULL , kHICommandPreferences ) ; - else - EnableMenuCommand( NULL , kHICommandPreferences ) ; - } - if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId) - { - if ( !IsEnabled() ) - DisableMenuCommand( NULL , kHICommandQuit ) ; - else - EnableMenuCommand( NULL , kHICommandQuit ) ; - } -#endif - { - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - UMAEnableMenuItem( mhandle , index , m_isEnabled ) ; - if ( IsCheckable() && IsChecked() ) - ::SetItemMark( mhandle , index , 0x12 ) ; // checkmark - else - ::SetItemMark( mhandle , index , 0 ) ; // no mark - - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; - wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; - UMASetMenuItemShortcut( mhandle , index , entry ) ; - delete entry ; - } -} - -void wxMenuItem::UpdateItemText() -{ - if ( !m_parentMenu ) - return ; - - MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; - MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; - if( mhandle == NULL || index == 0) - return ; - - UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ; - wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; - UMASetMenuItemShortcut( mhandle , index , entry ) ; - delete entry ; -} - - -void wxMenuItem::Enable(bool bDoEnable) -{ - if ( m_isEnabled != bDoEnable ) - { - wxMenuItemBase::Enable( bDoEnable ) ; - UpdateItemStatus() ; - } -} -void wxMenuItem::UncheckRadio() -{ - if ( m_isChecked ) - { - wxMenuItemBase::Check( false ) ; - UpdateItemStatus() ; - } -} - -void wxMenuItem::Check(bool bDoCheck) -{ - wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); - - if ( m_isChecked != bDoCheck ) - { - if ( GetKind() == wxITEM_RADIO ) - { - if ( bDoCheck ) - { - wxMenuItemBase::Check( bDoCheck ) ; - UpdateItemStatus() ; - - // get the index of this item in the menu - const wxMenuItemList& items = m_parentMenu->GetMenuItems(); - int pos = items.IndexOf(this); - wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); - - // get the radio group range - int start, - end; - - if ( m_isRadioGroupStart ) - { - // we already have all information we need - start = pos; - end = m_radioGroup.end; - } - else // next radio group item - { - // get the radio group end from the start item - start = m_radioGroup.start; - end = items.Item(start)->GetData()->m_radioGroup.end; - } - - // also uncheck all the other items in this radio group - wxMenuItemList::Node *node = items.Item(start); - for ( int n = start; n <= end && node; n++ ) - { - if ( n != pos ) - { - ((wxMenuItem*)node->GetData())->UncheckRadio(); - } - node = node->GetNext(); - } - } - } - else - { - wxMenuItemBase::Check( bDoCheck ) ; - UpdateItemStatus() ; - } - } -} - -void wxMenuItem::SetText(const wxString& text) -{ - // don't do anything if label didn't change - if ( m_text == text ) - return; - - wxMenuItemBase::SetText(text); - - UpdateItemText() ; -} - -// radio group stuff -// ----------------- - -void wxMenuItem::SetAsRadioGroupStart() -{ - m_isRadioGroupStart = TRUE; -} - -void wxMenuItem::SetRadioGroupStart(int start) -{ - wxASSERT_MSG( !m_isRadioGroupStart, - _T("should only be called for the next radio items") ); - - m_radioGroup.start = start; -} - -void wxMenuItem::SetRadioGroupEnd(int end) -{ - wxASSERT_MSG( m_isRadioGroupStart, - _T("should only be called for the first radio item") ); - - m_radioGroup.end = end; -} - -// ---------------------------------------------------------------------------- -// wxMenuItemBase -// ---------------------------------------------------------------------------- - -/* static */ -wxString wxMenuItemBase::GetLabelFromText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - -wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, - int id, - const wxString& name, - const wxString& help, - wxItemKind kind, - wxMenu *subMenu) -{ - return new wxMenuItem(parentMenu, id, name, help, kind, subMenu); -} diff --git a/src/mac/classic/metafile.cpp b/src/mac/classic/metafile.cpp deleted file mode 100644 index 594fe43af5..0000000000 --- a/src/mac/classic/metafile.cpp +++ /dev/null @@ -1,219 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: metafile.cpp -// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional. -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "metafile.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/setup.h" -#endif - -#if wxUSE_METAFILE - -#ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/app.h" -#endif - -#include "wx/metafile.h" -#include "wx/clipbrd.h" - -#include "wx/mac/private.h" - -#include -#include - -extern bool wxClipboardIsOpen; - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMetafile, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC, wxDC) -#endif - -/* - * Metafiles - * Currently, the only purpose for making a metafile is to put - * it on the clipboard. - */ - -wxMetafileRefData::wxMetafileRefData(void) -{ - m_metafile = 0; -} - -wxMetafileRefData::~wxMetafileRefData(void) -{ - if (m_metafile) - { - KillPicture( (PicHandle) m_metafile ) ; - m_metafile = 0; - } -} - -wxMetaFile::wxMetaFile(const wxString& file) -{ - m_refData = new wxMetafileRefData; - - - M_METAFILEDATA->m_metafile = 0; - wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ; -/* - if (!file.IsNull() && (file.Cmp("") == 0)) - M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file); -*/ -} - -wxMetaFile::~wxMetaFile() -{ -} - -bool wxMetaFile::SetClipboard(int width, int height) -{ -#if wxUSE_DRAG_AND_DROP - //TODO finishi this port , we need the data obj first - if (!m_refData) - return FALSE; - - bool alreadyOpen=wxTheClipboard->IsOpened() ; - if (!alreadyOpen) - { - wxTheClipboard->Open(); - wxTheClipboard->Clear(); - } - wxDataObject *data = - new wxMetafileDataObject( *this) ; - bool success = wxTheClipboard->SetData(data); - if (!alreadyOpen) - wxTheClipboard->Close(); - return (bool) success; -#endif - return TRUE ; -} - -void wxMetafile::SetHMETAFILE(WXHMETAFILE mf) -{ - if (!m_refData) - m_refData = new wxMetafileRefData; - if ( M_METAFILEDATA->m_metafile ) - KillPicture( (PicHandle) M_METAFILEDATA->m_metafile ) ; - - M_METAFILEDATA->m_metafile = mf; -} - -bool wxMetaFile::Play(wxDC *dc) -{ - if (!m_refData) - return FALSE; - - if (!dc->Ok() ) - return FALSE; - - { - wxMacPortSetter helper( dc ) ; - PicHandle pict = (PicHandle) GetHMETAFILE() ; - DrawPicture( pict , &(**pict).picFrame ) ; - } - return TRUE; -} - -wxSize wxMetaFile::GetSize() const -{ - wxSize size = wxDefaultSize ; - if ( Ok() ) - { - PicHandle pict = (PicHandle) GetHMETAFILE() ; - Rect &r = (**pict).picFrame ; - size.x = r.right - r.left ; - size.y = r.bottom - r.top ; - } - - return size; -} - -/* - * Metafile device context - * - */ - -// New constructor that takes origin and extent. If you use this, don't -// give origin/extent arguments to wxMakeMetaFilePlaceable. - -wxMetaFileDC::wxMetaFileDC(const wxString& filename , - int width , int height , - const wxString& WXUNUSED(description) ) -{ - wxASSERT_MSG( width == 0 || height == 0 , _T("no arbitration of metafilesize supported") ) ; - wxASSERT_MSG( filename.IsEmpty() , _T("no file based metafile support yet")) ; - - m_metaFile = new wxMetaFile(filename) ; - Rect r={0,0,height,width} ; - - RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ; - CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; - - m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ; - ::GetPort( (GrafPtr*) &m_macPort ) ; - m_ok = TRUE ; - - SetMapMode(wxMM_TEXT); -} - -wxMetaFileDC::~wxMetaFileDC() -{ -} - -void wxMetaFileDC::DoGetSize(int *width, int *height) const -{ - wxCHECK_RET( m_metaFile , _T("GetSize() doesn't work without a metafile") ); - - wxSize sz = m_metaFile->GetSize() ; - if (width) (*width) = sz.x; - if (height) (*height) = sz.y; -} - -wxMetaFile *wxMetaFileDC::Close() -{ - ClosePicture() ; - return m_metaFile; -} - -#if wxUSE_DATAOBJ -size_t wxMetafileDataObject::GetDataSize() const -{ - return GetHandleSize( (Handle) (*((wxMetafile*)&m_metafile)).GetHMETAFILE() ) ; -} - -bool wxMetafileDataObject::GetDataHere(void *buf) const -{ - memcpy( buf , (*(PicHandle)(*((wxMetafile*)&m_metafile)).GetHMETAFILE()) , - GetHandleSize( (Handle) (*((wxMetafile*)&m_metafile)).GetHMETAFILE() ) ) ; - return true ; -} - -bool wxMetafileDataObject::SetData(size_t len, const void *buf) -{ - Handle handle = NewHandle( len ) ; - SetHandleSize( handle , len ) ; - memcpy( *handle , buf , len ) ; - m_metafile.SetHMETAFILE( handle ) ; - return true ; -} -#endif - -#endif diff --git a/src/mac/classic/mimetmac.cpp b/src/mac/classic/mimetmac.cpp deleted file mode 100644 index 1ea83612c2..0000000000 --- a/src/mac/classic/mimetmac.cpp +++ /dev/null @@ -1,228 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mac/mimetype.cpp -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mimetype.h" -#endif - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif -#endif //WX_PRECOMP - - -#include "wx/log.h" -#include "wx/file.h" -#include "wx/intl.h" -#include "wx/dynarray.h" -#include "wx/confbase.h" - -#include "wx/mac/mimetype.h" - -// other standard headers -#include - -// in case we're compiling in non-GUI mode -class WXDLLEXPORT wxIcon; - -bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt) -{ - return FALSE; -} - -bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int index) -{ - return FALSE; -} - -bool wxFileTypeImpl::GetCommand(wxString *command, const char *verb) const -{ - return FALSE; -} - -// @@ this function is half implemented -bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) -{ - return FALSE; -} - -bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const -{ - if ( m_strFileType.Length() > 0 ) - { - *mimeType = m_strFileType ; - return TRUE ; - } - else - return FALSE; -} - -bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const -{ - wxString s; - - if (GetMimeType(&s)) - { - mimeTypes.Clear(); - mimeTypes.Add(s); - return TRUE; - } - else - return FALSE; -} - -bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const -{ - // no such file type or no value or incorrect icon entry - return FALSE; -} - -bool wxFileTypeImpl::GetDescription(wxString *desc) const -{ - return FALSE; -} - -size_t -wxFileTypeImpl::GetAllCommands(wxArrayString * verbs, wxArrayString * commands, - const wxFileType::MessageParameters& params) const -{ - wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") ); - return 0; -} - -void -wxMimeTypesManagerImpl::Initialize(int mailcapStyles, const wxString& extraDir) -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") ); -} - -void -wxMimeTypesManagerImpl::ClearData() -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::ClearData() not yet implemented") ); -} - -// extension -> file type -wxFileType * -wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& e) -{ - wxString ext = e ; - ext = ext.Lower() ; - if ( ext == wxT("txt") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("text/text")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("htm") || ext == wxT("html") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("text/html")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("gif") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/gif")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("png" )) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/png")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("jpg" )|| ext == wxT("jpeg") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/jpeg")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("bmp") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/bmp")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("tif") || ext == wxT("tiff") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/tiff")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("xpm") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/xpm")); - fileType->m_impl->SetExt(ext); - return fileType; - } - else if ( ext == wxT("xbm") ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->SetFileType(wxT("image/xbm")); - fileType->m_impl->SetExt(ext); - return fileType; - } - - // unknown extension - return NULL; -} - -// MIME type -> extension -> file type -wxFileType * -wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) -{ - return NULL; -} - -size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) -{ - // VZ: don't know anything about this for Mac - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") ); - - return 0; -} - -wxFileType * -wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) -{ - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") ); - - return NULL; -} - -bool -wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) -{ - return FALSE; -} - diff --git a/src/mac/classic/minifram.cpp b/src/mac/classic/minifram.cpp deleted file mode 100644 index 6b49b9bdc7..0000000000 --- a/src/mac/classic/minifram.cpp +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: minifram.cpp -// Purpose: wxMiniFrame. Optional; identical to wxFrame if not supported. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "minifram.h" -#endif - -#include "wx/minifram.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) -#endif - - diff --git a/src/mac/classic/morefile/DirectoryCopy.c b/src/mac/classic/morefile/DirectoryCopy.c deleted file mode 100644 index dd484c9b2c..0000000000 --- a/src/mac/classic/morefile/DirectoryCopy.c +++ /dev/null @@ -1,685 +0,0 @@ -/* - File: DirectoryCopy.c - - Contains: A robust, general purpose directory copy routine. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreFilesExtras.h" -#include "MoreDesktopMgr.h" -#include "FileCopy.h" -#include "DirectoryCopy.h" - -/*****************************************************************************/ - -/* local constants */ - -enum -{ - dirCopyBigCopyBuffSize = 0x00004000, - dirCopyMinCopyBuffSize = 0x00000200 -}; - - -/*****************************************************************************/ - -/* local data structures */ - -/* The EnumerateGlobals structure is used to minimize the amount of -** stack space used when recursively calling CopyLevel and to hold -** global information that might be needed at any time. */ - -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif -struct EnumerateGlobals -{ - Ptr copyBuffer; /* pointer to buffer used for file copy operations */ - long bufferSize; /* the size of the copy buffer */ - CopyErrProcPtr errorHandler; /* pointer to error handling function */ - CopyFilterProcPtr copyFilterProc; /* pointer to filter function */ - OSErr error; /* temporary holder of results - saves 2 bytes of stack each level */ - Boolean bailout; /* set to true to by error handling function if fatal error */ - short destinationVRefNum; /* the destination vRefNum */ - Str63 itemName; /* the name of the current item */ - CInfoPBRec myCPB; /* the parameter block used for PBGetCatInfo calls */ -}; -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif - -typedef struct EnumerateGlobals EnumerateGlobals; -typedef EnumerateGlobals *EnumerateGlobalsPtr; - - -/* The PreflightGlobals structure is used to minimize the amount of -** stack space used when recursively calling GetLevelSize and to hold -** global information that might be needed at any time. */ - -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif -struct PreflightGlobals -{ - OSErr result; /* temporary holder of results - saves 2 bytes of stack each level */ - Str63 itemName; /* the name of the current item */ - CInfoPBRec myCPB; /* the parameter block used for PBGetCatInfo calls */ - - unsigned long dstBlksPerAllocBlk; /* the number of 512 byte blocks per allocation block on destination */ - - unsigned long allocBlksNeeded; /* the total number of allocation blocks needed */ - - unsigned long tempBlocks; /* temporary storage for calculations (save some stack space) */ - CopyFilterProcPtr copyFilterProc; /* pointer to filter function */ -}; -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif - -typedef struct PreflightGlobals PreflightGlobals; -typedef PreflightGlobals *PreflightGlobalsPtr; - -/*****************************************************************************/ - -/* static prototypes */ - -static void GetLevelSize(long currentDirID, - PreflightGlobals *theGlobals); - -static OSErr PreflightDirectoryCopySpace(short srcVRefNum, - long srcDirID, - short dstVRefNum, - CopyFilterProcPtr copyFilterProc, - Boolean *spaceOK); - -static void CopyLevel(long sourceDirID, - long dstDirID, - EnumerateGlobals *theGlobals); - -/*****************************************************************************/ - -static void GetLevelSize(long currentDirID, - PreflightGlobals *theGlobals) -{ - short index = 1; - - do - { - theGlobals->myCPB.dirInfo.ioFDirIndex = index; - theGlobals->myCPB.dirInfo.ioDrDirID = currentDirID; /* we need to do this every time */ - /* through, since GetCatInfo */ - /* returns ioFlNum in this field */ - theGlobals->result = PBGetCatInfoSync(&theGlobals->myCPB); - if ( theGlobals->result == noErr ) - { - if ( (theGlobals->copyFilterProc == NULL) || - CallCopyFilterProc(theGlobals->copyFilterProc, &theGlobals->myCPB) ) /* filter if filter proc was supplied */ - { - /* Either there's no filter proc OR the filter proc says to use this item */ - if ( (theGlobals->myCPB.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* we have a directory */ - - GetLevelSize(theGlobals->myCPB.dirInfo.ioDrDirID, theGlobals); /* recurse */ - theGlobals->result = noErr; /* clear error return on way back */ - } - else - { - /* We have a file - add its allocation blocks to allocBlksNeeded. */ - /* Since space on Mac OS disks is always allocated in allocation blocks, */ - /* this takes into account rounding up to the end of an allocation block. */ - - /* get number of 512-byte blocks needed for data fork */ - if ( ((unsigned long)theGlobals->myCPB.hFileInfo.ioFlLgLen & 0x000001ff) != 0 ) - { - theGlobals->tempBlocks = ((unsigned long)theGlobals->myCPB.hFileInfo.ioFlLgLen >> 9) + 1; - } - else - { - theGlobals->tempBlocks = (unsigned long)theGlobals->myCPB.hFileInfo.ioFlLgLen >> 9; - } - /* now, calculate number of new allocation blocks needed for the data fork and add it to the total */ - if ( theGlobals->tempBlocks % theGlobals->dstBlksPerAllocBlk ) - { - theGlobals->allocBlksNeeded += (theGlobals->tempBlocks / theGlobals->dstBlksPerAllocBlk) + 1; - } - else - { - theGlobals->allocBlksNeeded += theGlobals->tempBlocks / theGlobals->dstBlksPerAllocBlk; - } - - /* get number of 512-byte blocks needed for resource fork */ - if ( ((unsigned long)theGlobals->myCPB.hFileInfo.ioFlRLgLen & 0x000001ff) != 0 ) - { - theGlobals->tempBlocks = ((unsigned long)theGlobals->myCPB.hFileInfo.ioFlRLgLen >> 9) + 1; - } - else - { - theGlobals->tempBlocks = (unsigned long)theGlobals->myCPB.hFileInfo.ioFlRLgLen >> 9; - } - /* now, calculate number of new allocation blocks needed for the resource fork and add it to the total */ - if ( theGlobals->tempBlocks % theGlobals->dstBlksPerAllocBlk ) - { - theGlobals->allocBlksNeeded += (theGlobals->tempBlocks / theGlobals->dstBlksPerAllocBlk) + 1; - } - else - { - theGlobals->allocBlksNeeded += theGlobals->tempBlocks / theGlobals->dstBlksPerAllocBlk; - } - } - } - } - ++index; - } while ( theGlobals->result == noErr ); -} - -/*****************************************************************************/ - -static OSErr PreflightDirectoryCopySpace(short srcVRefNum, - long srcDirID, - short dstVRefNum, - CopyFilterProcPtr copyFilterProc, - Boolean *spaceOK) -{ - XVolumeParam pb; - OSErr error; - unsigned long dstFreeBlocks; - PreflightGlobals theGlobals; - - error = XGetVolumeInfoNoName(NULL, dstVRefNum, &pb); - if ( error == noErr ) - { - /* Convert freeBytes to free disk blocks (512-byte blocks) */ - dstFreeBlocks = U32SetU(U64ShiftRight(pb.ioVFreeBytes, 9)); - - /* get allocation block size (always multiple of 512) and divide by 512 - to get number of 512-byte blocks per allocation block */ - theGlobals.dstBlksPerAllocBlk = ((unsigned long)pb.ioVAlBlkSiz >> 9); - - theGlobals.allocBlksNeeded = 0; - - theGlobals.myCPB.dirInfo.ioNamePtr = theGlobals.itemName; - theGlobals.myCPB.dirInfo.ioVRefNum = srcVRefNum; - - theGlobals.copyFilterProc = copyFilterProc; - - GetLevelSize(srcDirID, &theGlobals); - - /* Is there enough room on the destination volume for the source file? */ - /* Note: This will work because the largest number of disk blocks supported */ - /* on a 2TB volume is 0xffffffff and (allocBlksNeeded * dstBlksPerAllocBlk) */ - /* will always be less than 0xffffffff. */ - *spaceOK = ((theGlobals.allocBlksNeeded * theGlobals.dstBlksPerAllocBlk) <= dstFreeBlocks); - } - - return ( error ); -} - -/*****************************************************************************/ - -static void CopyLevel(long sourceDirID, - long dstDirID, - EnumerateGlobals *theGlobals) -{ - long currentSrcDirID = 0 ; - long newDirID; - short index = 1; - - do - { - /* Get next source item at the current directory level */ - - theGlobals->myCPB.dirInfo.ioFDirIndex = index; - theGlobals->myCPB.dirInfo.ioDrDirID = sourceDirID; - theGlobals->error = PBGetCatInfoSync(&theGlobals->myCPB); - - if ( theGlobals->error == noErr ) - { - if ( (theGlobals->copyFilterProc == NULL) || - CallCopyFilterProc(theGlobals->copyFilterProc, &theGlobals->myCPB) ) /* filter if filter proc was supplied */ - { - /* Either there's no filter proc OR the filter proc says to use this item */ - - /* We have an item. Is it a file or directory? */ - if ( (theGlobals->myCPB.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* We have a directory */ - - /* Create a new directory at the destination. No errors allowed! */ - theGlobals->error = DirCreate(theGlobals->destinationVRefNum, dstDirID, theGlobals->itemName, &newDirID); - if ( theGlobals->error == noErr ) - { - /* Save the current source directory ID where we can get it when we come back - ** from recursion land. */ - currentSrcDirID = theGlobals->myCPB.dirInfo.ioDrDirID; - - /* Dive again (copy the directory level we just found below this one) */ - CopyLevel(theGlobals->myCPB.dirInfo.ioDrDirID, newDirID, theGlobals); - - if ( !theGlobals->bailout ) - { - /* Copy comment from old to new directory. */ - /* Ignore the result because we really don't care if it worked or not. */ - (void) DTCopyComment(theGlobals->myCPB.dirInfo.ioVRefNum, currentSrcDirID, NULL, theGlobals->destinationVRefNum, newDirID, NULL); - - /* Copy directory attributes (dates, etc.) to newDirID. */ - /* No errors allowed */ - theGlobals->error = CopyFileMgrAttributes(theGlobals->myCPB.dirInfo.ioVRefNum, currentSrcDirID, NULL, theGlobals->destinationVRefNum, newDirID, NULL, true); - - /* handle any errors from CopyFileMgrAttributes */ - if ( theGlobals->error != noErr ) - { - if ( theGlobals->errorHandler != NULL ) - { - theGlobals->bailout = CallCopyErrProc(theGlobals->errorHandler, theGlobals->error, copyDirFMAttributesOp, - theGlobals->myCPB.dirInfo.ioVRefNum, currentSrcDirID, NULL, - theGlobals->destinationVRefNum, newDirID, NULL); - } - else - { - /* If you don't handle the errors with an error handler, */ - /* then the copy stops here. */ - theGlobals->bailout = true; - } - } - } - } - else /* error handling for DirCreate */ - { - /* note that currentSrcDirID has not been initialised when entering this execution path */ - if ( theGlobals->errorHandler != NULL ) - { - theGlobals->bailout = CallCopyErrProc(theGlobals->errorHandler, theGlobals->error, dirCreateOp, - theGlobals->myCPB.dirInfo.ioVRefNum, currentSrcDirID, NULL, - theGlobals->destinationVRefNum, dstDirID, theGlobals->itemName); - } - else - { - /* If you don't handle the errors with an error handler, */ - /* then the copy stops here. */ - theGlobals->bailout = true; - } - } - - if ( !theGlobals->bailout ) - { - /* clear error return on way back if we aren't bailing out */ - theGlobals->error = noErr; - } - } - else - { - /* We have a file, so copy it */ - - theGlobals->error = FileCopy(theGlobals->myCPB.hFileInfo.ioVRefNum, - theGlobals->myCPB.hFileInfo.ioFlParID, - theGlobals->itemName, - theGlobals->destinationVRefNum, - dstDirID, - NULL, - NULL, - theGlobals->copyBuffer, - theGlobals->bufferSize, - false); - - /* handle any errors from FileCopy */ - if ( theGlobals->error != noErr ) - { - if ( theGlobals->errorHandler != NULL ) - { - theGlobals->bailout = CallCopyErrProc(theGlobals->errorHandler, theGlobals->error, fileCopyOp, - theGlobals->myCPB.hFileInfo.ioVRefNum, theGlobals->myCPB.hFileInfo.ioFlParID, theGlobals->itemName, - theGlobals->destinationVRefNum, dstDirID, NULL); - if ( !theGlobals->bailout ) - { - /* If the CopyErrProc handled the problem, clear the error here */ - theGlobals->error = noErr; - } - } - else - { - /* If you don't handle the errors with an error handler, */ - /* then the copy stops here. */ - theGlobals->bailout = true; - } - } - } - } - } - else - { /* error handling for PBGetCatInfo */ - /* it's normal to get a fnfErr when indexing; that only means you've hit the end of the directory */ - if ( theGlobals->error != fnfErr ) - { - if ( theGlobals->errorHandler != NULL ) - { - theGlobals->bailout = CallCopyErrProc(theGlobals->errorHandler, theGlobals->error, getNextItemOp, - theGlobals->myCPB.dirInfo.ioVRefNum, sourceDirID, NULL, 0, 0, NULL); - if ( !theGlobals->bailout ) - { - /* If the CopyErrProc handled the problem, clear the error here */ - theGlobals->error = noErr; - } - } - else - { - /* If you don't handle the errors with an error handler, */ - /* then the copy stops here. */ - theGlobals->bailout = true; - } - } - } - ++index; /* prepare to get next item */ - } while ( (theGlobals->error == noErr) && (!theGlobals->bailout) ); /* time to fall back a level? */ -} - -/*****************************************************************************/ - -pascal OSErr FilteredDirectoryCopy(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler, - CopyFilterProcPtr copyFilterProc) -{ - EnumerateGlobals theGlobals; - Boolean isDirectory; - OSErr error; - Boolean ourCopyBuffer = false; - Str63 srcDirName, oldDiskName; - Boolean spaceOK; - - /* Make sure a copy buffer is allocated. */ - if ( copyBufferPtr == NULL ) - { - /* The caller didn't supply a copy buffer so grab one from the application heap. - ** Try to get a big copy buffer, if we can't, try for a 512-byte buffer. - ** If 512 bytes aren't available, we're in trouble. */ - copyBufferSize = dirCopyBigCopyBuffSize; - copyBufferPtr = NewPtr(copyBufferSize); - if ( copyBufferPtr == NULL ) - { - copyBufferSize = dirCopyMinCopyBuffSize; - copyBufferPtr = NewPtr(copyBufferSize); - if ( copyBufferPtr == NULL ) - { - return ( memFullErr ); - } - } - ourCopyBuffer = true; - } - - /* Get the real dirID where we're copying from and make sure it is a directory. */ - error = GetDirectoryID(srcVRefNum, srcDirID, srcName, &srcDirID, &isDirectory); - if ( error != noErr ) - { - goto ErrorExit; - } - if ( !isDirectory ) - { - error = dirNFErr; - goto ErrorExit; - } - - /* Special case destination if it is the root parent directory. */ - /* Since you can't create the root directory, this is needed if */ - /* you want to copy a directory's content to a disk's root directory. */ - if ( (dstDirID == fsRtParID) && (dstName == NULL) ) - { - dstDirID = fsRtParID; - isDirectory = true; - error = noErr; - } - else - { - /* Get the real dirID where we're going to put the copy and make sure it is a directory. */ - error = GetDirectoryID(dstVRefNum, dstDirID, dstName, &dstDirID, &isDirectory); - if ( error != noErr ) - { - goto ErrorExit; - } - if ( !isDirectory ) - { - error = dirNFErr; - goto ErrorExit; - } - } - - /* Get the real vRefNum of both the source and destination */ - error = DetermineVRefNum(srcName, srcVRefNum, &srcVRefNum); - if ( error != noErr ) - { - goto ErrorExit; - } - error = DetermineVRefNum(dstName, dstVRefNum, &dstVRefNum); - if ( error != noErr ) - { - goto ErrorExit; - } - - if ( preflight ) - { - error = PreflightDirectoryCopySpace(srcVRefNum, srcDirID, dstVRefNum, copyFilterProc, &spaceOK); - if ( error != noErr ) - { - goto ErrorExit; - } - if ( !spaceOK ) - { - error = dskFulErr; /* not enough room on destination */ - goto ErrorExit; - } - } - - /* Create the new directory in the destination directory with the */ - /* same name as the source directory. */ - error = GetDirName(srcVRefNum, srcDirID, srcDirName); - if ( error != noErr ) - { - goto ErrorExit; - } - - /* Again, special case destination if the destination is the */ - /* root parent directory. This time, we'll rename the disk to */ - /* the source directory name. */ - if ( dstDirID == fsRtParID ) - { - /* Get the current name of the destination disk */ - error = GetDirName(dstVRefNum, fsRtDirID, oldDiskName); - if ( error == noErr ) - { - /* use the copyName as srcDirName if supplied */ - if ( copyName != NULL ) - { - /* make a copy since copyName is a const input */ - BlockMoveData(copyName, srcDirName, sizeof(Str31)); - } - /* Shorten the name if it's too long to be the volume name */ - TruncPString(srcDirName, srcDirName, 27); - - /* Rename the disk */ - error = HRename(dstVRefNum, fsRtParID, oldDiskName, srcDirName); - - /* and copy to the root directory */ - dstDirID = fsRtDirID; - } - } - else - { - /* use the copyName as srcDirName if supplied */ - error = DirCreate(dstVRefNum, dstDirID, ((copyName != NULL) ? copyName : srcDirName), &dstDirID); - } - if ( error != noErr ) - { - /* handle any errors from DirCreate */ - if ( copyErrHandler != NULL ) - { - if ( CallCopyErrProc(copyErrHandler, error, dirCreateOp, - srcVRefNum, srcDirID, NULL, - dstVRefNum, dstDirID, srcDirName) ) - { - goto ErrorExit; - } - else - { - /* If the CopyErrProc handled the problem, clear the error here */ - /* and continue */ - error = noErr; - } - } - else - { - /* If you don't handle the errors with an error handler, */ - /* then the copy stops here. */ - goto ErrorExit; - } - } - - /* dstDirID is now the newly created directory! */ - - /* Set up the globals we need to access from the recursive routine. */ - theGlobals.copyBuffer = (Ptr)copyBufferPtr; - theGlobals.bufferSize = copyBufferSize; - theGlobals.destinationVRefNum = dstVRefNum; /* so we can get to it always */ - theGlobals.myCPB.hFileInfo.ioNamePtr = (StringPtr)&theGlobals.itemName; - theGlobals.myCPB.hFileInfo.ioVRefNum = srcVRefNum; - theGlobals.errorHandler = copyErrHandler; - theGlobals.bailout = false; - theGlobals.copyFilterProc = copyFilterProc; - - /* Here we go into recursion land... */ - CopyLevel(srcDirID, dstDirID, &theGlobals); - error = theGlobals.error; /* get the result */ - - if ( !theGlobals.bailout ) - { - /* Copy comment from source to destination directory. */ - /* Ignore the result because we really don't care if it worked or not. */ - (void) DTCopyComment(srcVRefNum, srcDirID, NULL, dstVRefNum, dstDirID, NULL); - - /* Copy the File Manager attributes */ - error = CopyFileMgrAttributes(srcVRefNum, srcDirID, NULL, - dstVRefNum, dstDirID, NULL, true); - - /* handle any errors from CopyFileMgrAttributes */ - if ( (error != noErr) && (copyErrHandler != NULL) ) - { - theGlobals.bailout = CallCopyErrProc(copyErrHandler, error, copyDirFMAttributesOp, - srcVRefNum, srcDirID, NULL, - dstVRefNum, dstDirID, NULL); - } - } - -ErrorExit: - /* Get rid of the copy buffer if we allocated it. */ - if ( ourCopyBuffer ) - { - DisposePtr((Ptr)copyBufferPtr); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DirectoryCopy(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler) -{ - return ( FilteredDirectoryCopy(srcVRefNum, srcDirID, srcName, - dstVRefNum, dstDirID, dstName, - copyName, - copyBufferPtr, copyBufferSize, preflight, - copyErrHandler, NULL) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpFilteredDirectoryCopy(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler, - CopyFilterProcPtr copyFilterProc) -{ - return ( FilteredDirectoryCopy(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name, - copyName, - copyBufferPtr, copyBufferSize, preflight, - copyErrHandler, copyFilterProc) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpDirectoryCopy(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler) -{ - return ( FilteredDirectoryCopy(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name, - copyName, - copyBufferPtr, copyBufferSize, preflight, - copyErrHandler, NULL) ); -} - -/*****************************************************************************/ - diff --git a/src/mac/classic/morefile/DirectoryCopy.h b/src/mac/classic/morefile/DirectoryCopy.h deleted file mode 100644 index 14637e31aa..0000000000 --- a/src/mac/classic/morefile/DirectoryCopy.h +++ /dev/null @@ -1,559 +0,0 @@ -/* - File: DirectoryCopy.h - - Contains: A robust, general purpose directory copy routine. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __DIRECTORYCOPY__ -#define __DIRECTORYCOPY__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -enum { - getNextItemOp = 1, /* couldn't access items in this directory - no access privileges */ - copyDirCommentOp = 2, /* couldn't copy directory's Finder comment */ - copyDirAccessPrivsOp = 3, /* couldn't copy directory's AFP access privileges */ - copyDirFMAttributesOp = 4, /* couldn't copy directory's File Manager attributes */ - dirCreateOp = 5, /* couldn't create destination directory */ - fileCopyOp = 6 /* couldn't copy file */ -}; - - -/*****************************************************************************/ - -typedef CALLBACK_API( Boolean , CopyErrProcPtr )(OSErr error, short failedOperation, short srcVRefNum, long srcDirID, ConstStr255Param srcName, short dstVRefNum, long dstDirID, ConstStr255Param dstName); -/* - This is the prototype for the CopyErrProc function DirectoryCopy - calls if an error condition is detected sometime during the copy. If - CopyErrProc returns false, then DirectoryCopy attempts to continue with - the directory copy operation. If CopyErrProc returns true, then - DirectoryCopy stops the directory copy operation. - - error input: The error result code that caused CopyErrProc to - be called. - failedOperation input: The operation that returned an error to - DirectoryCopy. - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Source file or directory name, or nil if - srcDirID specifies the directory. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Destination file or directory name, or nil if - dstDirID specifies the directory. - - __________ - - Also see: FilteredDirectoryCopy, FSpFilteredDirectoryCopy, DirectoryCopy, FSpDirectoryCopy -*/ -#define CallCopyErrProc(userRoutine, error, failedOperation, srcVRefNum, srcDirID, srcName, dstVRefNum, dstDirID, dstName) \ - (*(userRoutine))((error), (failedOperation), (srcVRefNum), (srcDirID), (srcName), (dstVRefNum), (dstDirID), (dstName)) - -/*****************************************************************************/ - -typedef CALLBACK_API( Boolean , CopyFilterProcPtr )(const CInfoPBRec * cpbPtr); -/* - This is the prototype for the CopyFilterProc function called by - FilteredDirectoryCopy and GetLevelSize. If true is returned, - the file/folder is included in the copy, otherwise it is excluded. - - pb input: Points to the CInfoPBRec for the item under consideration. - - __________ - - Also see: FilteredDirectoryCopy, FSpFilteredDirectoryCopy -*/ -#define CallCopyFilterProc(userRoutine, cpbPtr) \ - (*(userRoutine))((cpbPtr)) - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FilteredDirectoryCopy( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler, - CopyFilterProcPtr copyFilterProc); - - -/* - The FilteredDirectoryCopy function makes a copy of a directory - structure in a new location. If copyBufferPtr <> NIL, it points to - a buffer of copyBufferSize that is used to copy files data. The - larger the supplied buffer, the faster the copy. If - copyBufferPtr = NIL, then this routine allocates a buffer in the - application heap. If you pass a copy buffer to this routine, make - its size a multiple of 512 ($200) bytes for optimum performance. - - The optional copyFilterProc parameter lets a routine you define - decide what files or directories are copied to the destination. - - FilteredDirectoryCopy normally creates a new directory *in* the - specified destination directory and copies the source directory's - content into the new directory. However, if root parent directory - (fsRtParID) is passed as the dstDirID parameter and NULL is - passed as the dstName parameter, DirectoryCopy renames the - destination volume to the source directory's name (truncating - if the name is longer than 27 characters) and copies the source - directory's content into the destination volume's root directory. - This special case is supported by FilteredDirectoryCopy, but - not by FSpFilteredDirectoryCopy since with FSpFilteredDirectoryCopy, - the dstName parameter can not be NULL. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Source directory name, or nil if - srcDirID specifies the directory. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Destination directory name, or nil if - dstDirID specifies the directory. - copyName input: Points to the new directory name if the directory - is to be renamed or nil if the directory isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want DirectoryCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, DirectoryCopy makes sure there are - enough allocation blocks on the destination - volume to hold the directory's files before - starting the copy. - copyErrHandler input: A pointer to the routine you want called if an - error condition is detected during the copy, or - nil if you don't want to handle error conditions. - If you don't handle error conditions, the first - error will cause the copy to quit and - DirectoryCopy will return the error. - Error handling is recommended... - copyFilterProc input: A pointer to the filter routine you want called - for each item in the source directory, or NULL - if you don't want to filter. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: CopyErrProcPtr, CopyFilterProcPtr, FSpFilteredDirectoryCopy, - DirectoryCopy, FSpDirectoryCopy, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpFilteredDirectoryCopy( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler, - CopyFilterProcPtr copyFilterProc); - - -/* - The FSpFilteredDirectoryCopy function makes a copy of a directory - structure in a new location. If copyBufferPtr <> NIL, it points to - a buffer of copyBufferSize that is used to copy files data. The - larger the supplied buffer, the faster the copy. If - copyBufferPtr = NIL, then this routine allocates a buffer in the - application heap. If you pass a copy buffer to this routine, make - its size a multiple of 512 ($200) bytes for optimum performance. - - The optional copyFilterProc parameter lets a routine you define - decide what files or directories are copied to the destination. - - srcSpec input: An FSSpec record specifying the directory to copy. - dstSpec input: An FSSpec record specifying destination directory - of the copy. - copyName input: Points to the new directory name if the directory - is to be renamed or nil if the directory isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want DirectoryCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, FSpDirectoryCopy makes sure there are - enough allocation blocks on the destination - volume to hold the directory's files before - starting the copy. - copyErrHandler input: A pointer to the routine you want called if an - error condition is detected during the copy, or - nil if you don't want to handle error conditions. - If you don't handle error conditions, the first - error will cause the copy to quit and - DirectoryCopy will return the error. - Error handling is recommended... - copyFilterProc input: A pointer to the filter routine you want called - for each item in the source directory, or NULL - if you don't want to filter. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: CopyErrProcPtr, CopyFilterProcPtr, FilteredDirectoryCopy, - DirectoryCopy, FSpDirectoryCopy, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DirectoryCopy( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler); - - -/* - The DirectoryCopy function makes a copy of a directory structure in a - new location. If copyBufferPtr <> NIL, it points to a buffer of - copyBufferSize that is used to copy files data. The larger the - supplied buffer, the faster the copy. If copyBufferPtr = NIL, then this - routine allocates a buffer in the application heap. If you pass a - copy buffer to this routine, make its size a multiple of 512 - ($200) bytes for optimum performance. - - DirectoryCopy normally creates a new directory *in* the specified - destination directory and copies the source directory's content into - the new directory. However, if root parent directory (fsRtParID) - is passed as the dstDirID parameter and NULL is passed as the - dstName parameter, DirectoryCopy renames the destination volume to - the source directory's name (truncating if the name is longer than - 27 characters) and copies the source directory's content into the - destination volume's root directory. This special case is supported - by DirectoryCopy, but not by FSpDirectoryCopy since with - FSpDirectoryCopy, the dstName parameter can not be NULL. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Source directory name, or nil if - srcDirID specifies the directory. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Destination directory name, or nil if - dstDirID specifies the directory. - copyName input: Points to the new directory name if the directory - is to be renamed or nil if the directory isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want DirectoryCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, DirectoryCopy makes sure there are - enough allocation blocks on the destination - volume to hold the directory's files before - starting the copy. - copyErrHandler input: A pointer to the routine you want called if an - error condition is detected during the copy, or - nil if you don't want to handle error conditions. - If you don't handle error conditions, the first - error will cause the copy to quit and - DirectoryCopy will return the error. - Error handling is recommended... - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: CopyErrProcPtr, FSpDirectoryCopy, FilteredDirectoryCopy, - FSpFilteredDirectoryCopy, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDirectoryCopy( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight, - CopyErrProcPtr copyErrHandler); - - -/* - The FSpDirectoryCopy function makes a copy of a directory structure in a - new location. If copyBufferPtr <> NIL, it points to a buffer of - copyBufferSize that is used to copy files data. The larger the - supplied buffer, the faster the copy. If copyBufferPtr = NIL, then this - routine allocates a buffer in the application heap. If you pass a - copy buffer to this routine, make its size a multiple of 512 - ($200) bytes for optimum performance. - - srcSpec input: An FSSpec record specifying the directory to copy. - dstSpec input: An FSSpec record specifying destination directory - of the copy. - copyName input: Points to the new directory name if the directory - is to be renamed or nil if the directory isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want DirectoryCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, FSpDirectoryCopy makes sure there are - enough allocation blocks on the destination - volume to hold the directory's files before - starting the copy. - copyErrHandler input: A pointer to the routine you want called if an - error condition is detected during the copy, or - nil if you don't want to handle error conditions. - If you don't handle error conditions, the first - error will cause the copy to quit and - DirectoryCopy will return the error. - Error handling is recommended... - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: CopyErrProcPtr, DirectoryCopy, FilteredDirectoryCopy, - FSpFilteredDirectoryCopy, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __DIRECTORYCOPY__ */ - diff --git a/src/mac/classic/morefile/FSpCompat.c b/src/mac/classic/morefile/FSpCompat.c deleted file mode 100644 index 17577684f6..0000000000 --- a/src/mac/classic/morefile/FSpCompat.c +++ /dev/null @@ -1,946 +0,0 @@ -/* - File: FSpCompat.c - - Contains: FSSpec compatibility functions. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. Updated - various routines to use new calling convention of the - MoreFilesExtras accessor functions. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -/* -** If building application 68K code, set GENERATENODATA to 0 for faster code. -** If building stand-alone 68K code, set GENERATENODATA to 1 so globals -** (static variables) are not used. -*/ -#ifndef GENERATENODATA -#define GENERATENODATA 0 -#endif - -#include -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFilesExtras.h" -#include "FSpCompat.h" - -/*****************************************************************************/ - -/* local constants */ - -enum { - gestaltBugFixAttrsTwo = 'bugy', - gestaltFSpExchangeFilesCompatibilityFix = 26, - gestaltBugFixAttrsThree = 'bugx', - gestaltFSpCreateScriptSupportFix = 1 -}; - -/*****************************************************************************/ - -/* static prototypes */ - - -#if !__MACOSSEVENORLATER -static Boolean FSHasFSSpecCalls(void); - -static Boolean QTHasFSSpecCalls(void); -#endif /* !__MACOSSEVENORLATER */ - -#if !__MACOSSEVENFIVEORLATER -static Boolean HasFSpExchangeFilesCompatibilityFix(void); - -static OSErr GenerateUniqueName(short volume, - long *startSeed, - long dir1, - long dir2, - StringPtr uniqueName); -#endif /* !__MACOSSEVENFIVEORLATER */ - -#if !__MACOSSEVENFIVEONEORLATER -static Boolean HasFSpCreateScriptSupportFix(void); -#endif /* !__MACOSSEVENFIVEONEORLATER */ - -/*****************************************************************************/ - -/* FSHasFSSpecCalls returns true if the file system provides FSSpec calls. */ - -#if !__MACOSSEVENORLATER -static Boolean FSHasFSSpecCalls(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else - Boolean result = false; -#endif - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif - if ( Gestalt(gestaltFSAttr, &response) == noErr ) - { - result = ((response & (1L << gestaltHasFSSpecCalls)) != 0); - } -#if !GENERATENODATA - } -#endif - return ( result ); -} -#endif /* !__MACOSSEVENORLATER */ - -/*****************************************************************************/ - -/* QTHasFSSpecCalls returns true if QuickTime provides FSSpec calls */ -/* except for FSpExchangeFiles. */ - -#if !__MACOSSEVENORLATER -static Boolean QTHasFSSpecCalls(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else - Boolean result = false; -#endif - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif - result = (Gestalt(gestaltQuickTimeVersion, &response) == noErr); -#if !GENERATENODATA - } -#endif - return ( result ); -} -#endif /* !__MACOSSEVENORLATER */ - -/*****************************************************************************/ - -/* HasFSpExchangeFilesCompatibilityFix returns true if FSpExchangeFiles */ -/* compatibility code has been fixed in system software. */ -/* This was fixed by System Update 3.0, so if SystemSevenFiveOrLater */ -/* is true, then we know the fix is in. */ - -#if !__MACOSSEVENFIVEORLATER -static Boolean HasFSpExchangeFilesCompatibilityFix(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else /* !GENERATENODATA */ - Boolean result = false; -#endif /* !GENERATENODATA */ - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif /* !GENERATENODATA */ - if ( Gestalt(gestaltBugFixAttrsTwo, &response) == noErr ) - { - result = ((response & (1L << gestaltFSpExchangeFilesCompatibilityFix)) != 0); - } -#if !GENERATENODATA - } -#endif /* !GENERATENODATA */ - return ( result ); -} -#endif /* !__MACOSSEVENFIVEORLATER */ - -/*****************************************************************************/ - -/* HasFSpCreateScriptSupportFix returns true if FSpCreate and */ -/* FSpCreateResFile have been fixed in system software to correctly set */ -/* the scriptCode in the volume's catalog. */ -/* This was fixed by System 7.5 Update 1.0 */ - -#if !__MACOSSEVENFIVEONEORLATER -static Boolean HasFSpCreateScriptSupportFix(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else - Boolean result = false; -#endif /* !GENERATENODATA */ - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif /* !GENERATENODATA */ - if ( Gestalt(gestaltBugFixAttrsThree, &response) == noErr ) - { - result = ((response & (1L << gestaltFSpCreateScriptSupportFix)) != 0); - } -#if !GENERATENODATA - } -#endif /* !GENERATENODATA */ - return ( result ); -} -#endif /* !__MACOSSEVENFIVEONEORLATER */ - -/*****************************************************************************/ - -/* -** File Manager FSp calls -*/ - -/*****************************************************************************/ - -pascal OSErr FSMakeFSSpecCompat(short vRefNum, - long dirID, - ConstStr255Param fileName, - FSSpec *spec) -{ - OSErr result; - -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - Boolean isDirectory; - - result = GetObjectLocation(vRefNum, dirID, fileName, - &(spec->vRefNum), &(spec->parID), spec->name, - &isDirectory); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - /* Let the file system create the FSSpec if it can since it does the job */ - /* much more efficiently than I can. */ - result = FSMakeFSSpec(vRefNum, dirID, fileName, spec); - - /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */ - /* returned in the parID field when making an FSSpec to the volume's */ - /* root directory by passing a full pathname in MakeFSSpec's */ - /* fileName parameter. Fixed in Mac OS 8.1 */ - if ( (result == noErr) && (spec->parID == 0) ) - spec->parID = fsRtParID; - } - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr FSpOpenDFCompat(const FSSpec *spec, - char permission, - short *refNum) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - OSErr result; - HParamBlockRec pb; - - pb.ioParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.ioParam.ioNamePtr = (StringPtr) &(spec->name); - pb.ioParam.ioVersNum = 0; - pb.ioParam.ioPermssn = permission; - pb.ioParam.ioMisc = NULL; - result = PBHOpenSync(&pb); /* OpenDF not supported by System 6, so use Open */ - *refNum = pb.ioParam.ioRefNum; - return ( result ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpOpenDF(spec, permission, refNum) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpOpenRFCompat(const FSSpec *spec, - char permission, - short *refNum) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - OSErr result; - HParamBlockRec pb; - - pb.ioParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.ioParam.ioNamePtr = (StringPtr) &(spec->name); - pb.ioParam.ioVersNum = 0; - pb.ioParam.ioPermssn = permission; - pb.ioParam.ioMisc = NULL; - result = PBHOpenRFSync(&pb); - *refNum = pb.ioParam.ioRefNum; - return ( result ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpOpenRF(spec, permission, refNum) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpCreateCompat(const FSSpec *spec, - OSType creator, - OSType fileType, - ScriptCode scriptTag) -{ -#if !__MACOSSEVENFIVEONEORLATER - OSErr result; - UniversalFMPB pb; - - - if ( -#if !__MACOSSEVENORLATER - (!FSHasFSSpecCalls() && !QTHasFSSpecCalls()) || -#endif /* !__MACOSSEVENORLATER */ - !HasFSpCreateScriptSupportFix() ) - { - /* If FSpCreate isn't called, this code will be executed */ - pb.hPB.fileParam.ioVRefNum = spec->vRefNum; - pb.hPB.fileParam.ioDirID = spec->parID; - pb.hPB.fileParam.ioNamePtr = (StringPtr) &(spec->name); - pb.hPB.fileParam.ioFVersNum = 0; - result = PBHCreateSync(&(pb.hPB)); - if ( result == noErr ) - { - /* get info on created item */ - pb.ciPB.hFileInfo.ioFDirIndex = 0; - result = PBGetCatInfoSync(&(pb.ciPB)); - if ( result == noErr ) - { - /* Set fdScript in FXInfo */ - /* The negative script constants (smSystemScript, smCurrentScript, and smAllScripts) */ - /* don't make sense on disk, so only use scriptTag if scriptTag >= smRoman */ - /* (smRoman is 0). fdScript is valid if high bit is set (see IM-6, page 9-38) */ - pb.ciPB.hFileInfo.ioFlXFndrInfo.fdScript = (scriptTag >= smRoman) ? - ((char)scriptTag | (char)0x80) : - (smRoman); - /* Set creator/fileType */ - pb.ciPB.hFileInfo.ioFlFndrInfo.fdCreator = creator; - pb.ciPB.hFileInfo.ioFlFndrInfo.fdType = fileType; - /* Restore ioDirID field in pb which was changed by PBGetCatInfo */ - pb.ciPB.hFileInfo.ioDirID = spec->parID; - result = PBSetCatInfoSync(&(pb.ciPB)); - } - } - return ( result ); - } - else -#endif /* !__MACOSSEVENFIVEONEORLATER */ - { - return ( FSpCreate(spec, creator, fileType, scriptTag) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpDirCreateCompat(const FSSpec *spec, - ScriptCode scriptTag, - long *createdDirID) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - OSErr result; - UniversalFMPB pb; - - pb.hPB.fileParam.ioVRefNum = spec->vRefNum; - pb.hPB.fileParam.ioDirID = spec->parID; - pb.hPB.fileParam.ioNamePtr = (StringPtr) &(spec->name); - result = PBDirCreateSync(&(pb.hPB)); - *createdDirID = pb.hPB.fileParam.ioDirID; - if ( result == noErr ) - { - /* get info on created item */ - pb.ciPB.dirInfo.ioFDirIndex = 0; - pb.ciPB.dirInfo.ioDrDirID = spec->parID; - result = PBGetCatInfoSync(&(pb.ciPB)); - if ( result == noErr ) - { - /* Set frScript in DXInfo */ - /* The negative script constants (smSystemScript, smCurrentScript, and smAllScripts) */ - /* don't make sense on disk, so only use scriptTag if scriptTag >= smRoman */ - /* (smRoman is 0). frScript is valid if high bit is set (see IM-6, page 9-38) */ - pb.ciPB.dirInfo.ioDrFndrInfo.frScript = (scriptTag >= smRoman) ? - ((char)scriptTag | (char)0x80) : - (smRoman); - /* Restore ioDirID field in pb which was changed by PBGetCatInfo */ - pb.ciPB.dirInfo.ioDrDirID = spec->parID; - result = PBSetCatInfoSync(&(pb.ciPB)); - } - } - return ( result ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpDirCreate(spec, scriptTag, createdDirID) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpDeleteCompat(const FSSpec *spec) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - HParamBlockRec pb; - - pb.ioParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.ioParam.ioNamePtr = (StringPtr) &(spec->name); - pb.ioParam.ioVersNum = 0; - return ( PBHDeleteSync(&pb) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpDelete(spec) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpGetFInfoCompat(const FSSpec *spec, - FInfo *fndrInfo) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - OSErr result; - HParamBlockRec pb; - - pb.fileParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.fileParam.ioNamePtr = (StringPtr) &(spec->name); - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioFDirIndex = 0; - result = PBHGetFInfoSync(&pb); - *fndrInfo = pb.fileParam.ioFlFndrInfo; - return ( result ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpGetFInfo(spec, fndrInfo) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpSetFInfoCompat(const FSSpec *spec, - const FInfo *fndrInfo) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - OSErr result; - HParamBlockRec pb; - - pb.fileParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.fileParam.ioNamePtr = (StringPtr) &(spec->name); - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioFDirIndex = 0; - result = PBHGetFInfoSync(&pb); - if ( result == noErr ) - { - pb.fileParam.ioFlFndrInfo = *fndrInfo; - pb.fileParam.ioDirID = spec->parID; - result = PBHSetFInfoSync(&pb); - } - return ( result ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpSetFInfo(spec, fndrInfo) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpSetFLockCompat(const FSSpec *spec) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - HParamBlockRec pb; - - pb.fileParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.fileParam.ioNamePtr = (StringPtr) &(spec->name); - pb.fileParam.ioFVersNum = 0; - return ( PBHSetFLockSync(&pb) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpSetFLock(spec) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpRstFLockCompat(const FSSpec *spec) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - HParamBlockRec pb; - - pb.fileParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.fileParam.ioNamePtr = (StringPtr) &(spec->name); - pb.fileParam.ioFVersNum = 0; - return ( PBHRstFLockSync(&pb) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpRstFLock(spec) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpRenameCompat(const FSSpec *spec, - ConstStr255Param newName) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - HParamBlockRec pb; - - pb.ioParam.ioVRefNum = spec->vRefNum; - pb.fileParam.ioDirID = spec->parID; - pb.ioParam.ioNamePtr = (StringPtr) &(spec->name); - pb.ioParam.ioVersNum = 0; - pb.ioParam.ioMisc = (Ptr) newName; - return ( PBHRenameSync(&pb) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpRename(spec, newName) ); - } -} - -/*****************************************************************************/ - -pascal OSErr FSpCatMoveCompat(const FSSpec *source, - const FSSpec *dest) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - CMovePBRec pb; - - /* source and destination volume must be the same */ - if ( source->vRefNum != dest->vRefNum ) - return ( paramErr ); - - pb.ioNamePtr = (StringPtr) &(source->name); - pb.ioVRefNum = source->vRefNum; - pb.ioDirID = source->parID; - pb.ioNewDirID = dest->parID; - pb.ioNewName = (StringPtr) &(dest->name); - return ( PBCatMoveSync(&pb) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpCatMove(source, dest) ); - } -} - -/*****************************************************************************/ - -/* GenerateUniqueName generates a name that is unique in both dir1 and dir2 */ -/* on the specified volume. Ripped off from Feldman's code. */ - -#if !__MACOSSEVENFIVEORLATER -static OSErr GenerateUniqueName(short volume, - long *startSeed, - long dir1, - long dir2, - StringPtr uniqueName) -{ - OSErr error = noErr; - long i; - CInfoPBRec cinfo; - unsigned char hexStr[16]; - - for ( i = 0; i < 16; ++i ) - { - if ( i < 10 ) - { - hexStr[i] = 0x30 + i; - } - else - { - hexStr[i] = 0x37 + i; - } - } - - cinfo.hFileInfo.ioVRefNum = volume; - cinfo.hFileInfo.ioFDirIndex = 0; - cinfo.hFileInfo.ioNamePtr = uniqueName; - - while ( error != fnfErr ) - { - (*startSeed)++; - cinfo.hFileInfo.ioNamePtr[0] = 8; - for ( i = 1; i <= 8; i++ ) - { - cinfo.hFileInfo.ioNamePtr[i] = hexStr[((*startSeed >> ((8-i)*4)) & 0xf)]; - } - cinfo.hFileInfo.ioDirID = dir1; - error = fnfErr; - for ( i = 1; i <= 2; i++ ) - { - error = error & PBGetCatInfoSync(&cinfo); - cinfo.hFileInfo.ioDirID = dir2; - if ( (error != fnfErr) && (error != noErr) ) - { - return ( error ); - } - } - } - return ( noErr ); -} -#endif /* !__MACOSSEVENFIVEORLATER */ - -/*****************************************************************************/ - -pascal OSErr FSpExchangeFilesCompat(const FSSpec *source, - const FSSpec *dest) -{ -#if !__MACOSSEVENFIVEORLATER - if ( -#if !__MACOSSEVENORLATER - !FSHasFSSpecCalls() || -#endif /* !__MACOSSEVENORLATER */ - !HasFSpExchangeFilesCompatibilityFix() ) - { - HParamBlockRec pb; - CInfoPBRec catInfoSource, catInfoDest; - OSErr result, result2; - Str31 unique1, unique2; - StringPtr unique1Ptr, unique2Ptr, swapola; - GetVolParmsInfoBuffer volInfo; - long theSeed, temp; - - /* Make sure the source and destination are on the same volume */ - if ( source->vRefNum != dest->vRefNum ) - { - result = diffVolErr; - goto errorExit3; - } - - /* Try PBExchangeFiles first since it preserves the file ID reference */ - pb.fidParam.ioNamePtr = (StringPtr) &(source->name); - pb.fidParam.ioVRefNum = source->vRefNum; - pb.fidParam.ioDestNamePtr = (StringPtr) &(dest->name); - pb.fidParam.ioDestDirID = dest->parID; - pb.fidParam.ioSrcDirID = source->parID; - - result = PBExchangeFilesSync(&pb); - - /* Note: The compatibility case won't work for files with *Btree control blocks. */ - /* Right now the only *Btree files are created by the system. */ - if ( result != noErr ) - { - pb.ioParam.ioNamePtr = NULL; - pb.ioParam.ioBuffer = (Ptr) &volInfo; - pb.ioParam.ioReqCount = sizeof(volInfo); - result2 = PBHGetVolParmsSync(&pb); - - /* continue if volume has no fileID support (or no GetVolParms support) */ - if ( (result2 == noErr) && hasFileIDs(&volInfo) ) - { - goto errorExit3; - } - - /* Get the catalog information for each file */ - /* and make sure both files are *really* files */ - catInfoSource.hFileInfo.ioVRefNum = source->vRefNum; - catInfoSource.hFileInfo.ioFDirIndex = 0; - catInfoSource.hFileInfo.ioNamePtr = (StringPtr) &(source->name); - catInfoSource.hFileInfo.ioDirID = source->parID; - catInfoSource.hFileInfo.ioACUser = 0; /* ioACUser used to be filler2 */ - result = PBGetCatInfoSync(&catInfoSource); - if ( result != noErr ) - { - goto errorExit3; - } - if ( (catInfoSource.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - result = notAFileErr; - goto errorExit3; - } - - catInfoDest.hFileInfo.ioVRefNum = dest->vRefNum; - catInfoDest.hFileInfo.ioFDirIndex = 0; - catInfoDest.hFileInfo.ioNamePtr = (StringPtr) &(dest->name); - catInfoDest.hFileInfo.ioDirID = dest->parID; - catInfoDest.hFileInfo.ioACUser = 0; /* ioACUser used to be filler2 */ - result = PBGetCatInfoSync(&catInfoDest); - if ( result != noErr ) - { - goto errorExit3; - } - if ( (catInfoDest.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - result = notAFileErr; - goto errorExit3; - } - - /* generate 2 filenames that are unique in both directories */ - theSeed = 0x64666A6C; /* a fine unlikely filename */ - unique1Ptr = (StringPtr)&unique1; - unique2Ptr = (StringPtr)&unique2; - - result = GenerateUniqueName(source->vRefNum, &theSeed, source->parID, dest->parID, unique1Ptr); - if ( result != noErr ) - { - goto errorExit3; - } - - GenerateUniqueName(source->vRefNum, &theSeed, source->parID, dest->parID, unique2Ptr); - if ( result != noErr ) - { - goto errorExit3; - } - - /* rename source to unique1 */ - pb.fileParam.ioNamePtr = (StringPtr) &(source->name); - pb.ioParam.ioMisc = (Ptr) unique1Ptr; - pb.ioParam.ioVersNum = 0; - result = PBHRenameSync(&pb); - if ( result != noErr ) - { - goto errorExit3; - } - - /* rename dest to unique2 */ - pb.ioParam.ioMisc = (Ptr) unique2Ptr; - pb.ioParam.ioVersNum = 0; - pb.fileParam.ioNamePtr = (StringPtr) &(dest->name); - pb.fileParam.ioDirID = dest->parID; - result = PBHRenameSync(&pb); - if ( result != noErr ) - { - goto errorExit2; /* back out gracefully by renaming unique1 back to source */ - } - - /* If files are not in same directory, swap their locations */ - if ( source->parID != dest->parID ) - { - /* move source file to dest directory */ - pb.copyParam.ioNamePtr = unique1Ptr; - pb.copyParam.ioNewName = NULL; - pb.copyParam.ioNewDirID = dest->parID; - pb.copyParam.ioDirID = source->parID; - result = PBCatMoveSync((CMovePBPtr) &pb); - if ( result != noErr ) - { - goto errorExit1; /* back out gracefully by renaming both files to original names */ - } - - /* move dest file to source directory */ - pb.copyParam.ioNamePtr = unique2Ptr; - pb.copyParam.ioNewDirID = source->parID; - pb.copyParam.ioDirID = dest->parID; - result = PBCatMoveSync((CMovePBPtr) &pb); - if ( result != noErr) - { - /* life is very bad. We'll at least try to move source back */ - pb.copyParam.ioNamePtr = unique1Ptr; - pb.copyParam.ioNewName = NULL; - pb.copyParam.ioNewDirID = source->parID; - pb.copyParam.ioDirID = dest->parID; - (void) PBCatMoveSync((CMovePBPtr) &pb); /* ignore errors */ - goto errorExit1; /* back out gracefully by renaming both files to original names */ - } - } - - /* Make unique1Ptr point to file in source->parID */ - /* and unique2Ptr point to file in dest->parID */ - /* This lets us fall through to the rename code below */ - swapola = unique1Ptr; - unique1Ptr = unique2Ptr; - unique2Ptr = swapola; - - /* At this point, the files are in their new locations (if they were moved) */ - /* Source is named Unique1 (name pointed to by unique2Ptr) and is in dest->parID */ - /* Dest is named Unique2 (name pointed to by unique1Ptr) and is in source->parID */ - /* Need to swap attributes except mod date and swap names */ - - /* swap the catalog info by re-aiming the CInfoPB's */ - catInfoSource.hFileInfo.ioNamePtr = unique1Ptr; - catInfoDest.hFileInfo.ioNamePtr = unique2Ptr; - - catInfoSource.hFileInfo.ioDirID = source->parID; - catInfoDest.hFileInfo.ioDirID = dest->parID; - - /* Swap the original mod dates with each file */ - temp = catInfoSource.hFileInfo.ioFlMdDat; - catInfoSource.hFileInfo.ioFlMdDat = catInfoDest.hFileInfo.ioFlMdDat; - catInfoDest.hFileInfo.ioFlMdDat = temp; - - /* Here's the swap (ignore errors) */ - (void) PBSetCatInfoSync(&catInfoSource); - (void) PBSetCatInfoSync(&catInfoDest); - - /* rename unique2 back to dest */ -errorExit1: - pb.ioParam.ioMisc = (Ptr) &(dest->name); - pb.ioParam.ioVersNum = 0; - pb.fileParam.ioNamePtr = unique2Ptr; - pb.fileParam.ioDirID = dest->parID; - (void) PBHRenameSync(&pb); /* ignore errors */ - - /* rename unique1 back to source */ -errorExit2: - pb.ioParam.ioMisc = (Ptr) &(source->name); - pb.ioParam.ioVersNum = 0; - pb.fileParam.ioNamePtr = unique1Ptr; - pb.fileParam.ioDirID = source->parID; - (void) PBHRenameSync(&pb); /* ignore errors */ - } -errorExit3: { /* null statement */ } - return ( result ); - } - else -#endif /* !__MACOSSEVENFIVEORLATER */ - { - return ( FSpExchangeFiles(source, dest) ); - } -} - -/*****************************************************************************/ - -/* -** Resource Manager FSp calls -*/ - -/*****************************************************************************/ - -pascal short FSpOpenResFileCompat(const FSSpec *spec, - SignedByte permission) -{ -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - return ( HOpenResFile(spec->vRefNum, spec->parID, spec->name, permission) ); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - return ( FSpOpenResFile(spec, permission) ); - } -} - -/*****************************************************************************/ - -pascal void FSpCreateResFileCompat(const FSSpec *spec, - OSType creator, - OSType fileType, - ScriptCode scriptTag) -{ -#if !__MACOSSEVENFIVEONEORLATER - if ( -#if !__MACOSSEVENORLATER - (!FSHasFSSpecCalls() && !QTHasFSSpecCalls()) || -#endif /* !__MACOSSEVENORLATER */ - !HasFSpCreateScriptSupportFix() ) - { - OSErr result; - CInfoPBRec pb; - - HCreateResFile(spec->vRefNum, spec->parID, spec->name); - if ( ResError() == noErr ) - { - /* get info on created item */ - pb.hFileInfo.ioVRefNum = spec->vRefNum; - pb.hFileInfo.ioDirID = spec->parID; - pb.hFileInfo.ioNamePtr = (StringPtr) &(spec->name); - pb.hFileInfo.ioFDirIndex = 0; - result = PBGetCatInfoSync(&pb); - if ( result == noErr ) - { - /* Set fdScript in FXInfo */ - /* The negative script constants (smSystemScript, smCurrentScript, and smAllScripts) */ - /* don't make sense on disk, so only use scriptTag if scriptTag >= smRoman */ - /* (smRoman is 0). fdScript is valid if high bit is set (see IM-6, page 9-38) */ - pb.hFileInfo.ioFlXFndrInfo.fdScript = (scriptTag >= smRoman) ? - ((char)scriptTag | (char)0x80) : - (smRoman); - /* Set creator/fileType */ - pb.hFileInfo.ioFlFndrInfo.fdCreator = creator; - pb.hFileInfo.ioFlFndrInfo.fdType = fileType; - - /* Restore ioDirID field in pb which was changed by PBGetCatInfo */ - pb.hFileInfo.ioDirID = spec->parID; - result = PBSetCatInfoSync(&pb); - } - /* Set ResErr low memory global to result */ - LMSetResErr(result); - } - return; - } - else -#endif /* !__MACOSSEVENFIVEONEORLATER */ - { - FSpCreateResFile(spec, creator, fileType, scriptTag); - return; - } -} - -/*****************************************************************************/ diff --git a/src/mac/classic/morefile/FSpCompat.h b/src/mac/classic/morefile/FSpCompat.h deleted file mode 100644 index 1014cb8e58..0000000000 --- a/src/mac/classic/morefile/FSpCompat.h +++ /dev/null @@ -1,586 +0,0 @@ -/* - File: FSpCompat.h - - Contains: FSSpec compatibility functions. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __FSPCOMPAT__ -#define __FSPCOMPAT__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSMakeFSSpecCompat( - short vRefNum, - long dirID, - ConstStr255Param fileName, - FSSpec * spec); - - -/* - The FSMakeFSSpecCompat function fills in the fields of an FSSpec record. - If the file system can't create the FSSpec, then the compatibility code - creates a FSSpec that is exactly like an FSSpec except that spec.name - for a file may not have the same capitalization as the file's catalog - entry on the disk volume. That is because fileName is parsed to get the - name instead of getting the name back from the file system. This works - fine with System 6 where FSMakeSpec isn't available. - - vRefNum input: Volume specification. - dirID input: Directory ID. - fileName input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - spec output: A file system specification to be filled in by - FSMakeFSSpecCompat. - - Result Codes - noErr 0 No error - nsvErr -35 Volume doesnÕt exist - fnfErr -43 File or directory does not exist - (FSSpec is still valid) -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpOpenDFCompat( - const FSSpec * spec, - char permission, - short * refNum); - - -/* - The FSpOpenDFCompat function opens the data fork of the file specified - by spec. - Differences from FSpOpenDF: If FSpOpenDF isn't available, - FSpOpenDFCompat uses PHBOpen because System 6 doesn't support PBHOpenDF. - This means FSpOpenDFCompat could accidentally open a driver if the - spec->name begins with a period. - - spec input: An FSSpec record specifying the file whose data - fork is to be opened. - permission input: A constant indicating the desired file access - permissions. - refNum output: A reference number of an access path to the file's - data fork. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 File not found - opWrErr -49 File already open for writing - permErr -54 Attempt to open locked file for writing - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access to - the file - - __________ - - See also: FSpOpenAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpOpenRFCompat( - const FSSpec * spec, - char permission, - short * refNum); - - -/* - The FSpOpenRFCompat function opens the resource fork of the file - specified by spec. - - spec input: An FSSpec record specifying the file whose resource - fork is to be opened. - permission input: A constant indicating the desired file access - permissions. - refNum output: A reference number of an access path to the file's - resource fork. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 File not found - opWrErr -49 File already open for writing - permErr -54 Attempt to open locked file for writing - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access to - the file - - __________ - - See also: FSpOpenRFAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCreateCompat( - const FSSpec * spec, - OSType creator, - OSType fileType, - ScriptCode scriptTag); - - -/* - The FSpCreateCompat function creates a new file with the specified - type, creator, and script code. - Differences from FSpCreate: FSpCreateCompat correctly sets the - fdScript in the file's FXInfo record to scriptTag if the problem - isn't fixed in the File Manager code. - - spec input: An FSSpec record specifying the file to create. - creator input: The creator of the new file. - fileType input The file type of the new file. - scriptCode input: The code of the script system in which the file - name is to be displayed. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 Directory not found or incomplete pathname - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 A directory exists with that name -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDirCreateCompat( - const FSSpec * spec, - ScriptCode scriptTag, - long * createdDirID); - - -/* - The FSpDirCreateCompat function creates a new directory and returns the - directory ID of the newDirectory. - - spec input: An FSSpec record specifying the directory to - create. - scriptCode input: The code of the script system in which the - directory name is to be displayed. - createdDirID output: The directory ID of the directory that was - created. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 Directory not found or incomplete pathname - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Not an HFS volume - afpAccessDenied -5000 User does not have the correct access -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDeleteCompat(const FSSpec * spec); - - -/* - The FSpDeleteCompat function deletes a file or directory. - - spec input: An FSSpec record specifying the file or - directory to delete. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - fBsyErr -47 File busy, directory not empty, or - working directory control block open - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetFInfoCompat( - const FSSpec * spec, - FInfo * fndrInfo); - - -/* - The FSpGetFInfoCompat function gets the finder information for a file. - - spec input: An FSSpec record specifying the file. - fndrInfo output: If the object is a file, then its FInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpGetDInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetFInfoCompat( - const FSSpec * spec, - const FInfo * fndrInfo); - - -/* - The FSpSetFInfoCompat function sets the finder information for a file. - - spec input: An FSSpec record specifying the file. - fndrInfo input: The FInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Object was a directory - - __________ - - Also see: FSpSetDInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetFLockCompat(const FSSpec * spec); - - -/* - The FSpSetFLockCompat function locks a file. - - spec input: An FSSpec record specifying the file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access to - the file - afpObjectTypeErr -5025 Folder locking not supported by volume -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpRstFLockCompat(const FSSpec * spec); - - -/* - The FSpRstFLockCompat function unlocks a file. - - spec input: An FSSpec record specifying the file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access to - the file - afpObjectTypeErr -5025 Folder locking not supported by volume -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpRenameCompat( - const FSSpec * spec, - ConstStr255Param newName); - - -/* - The FSpRenameCompat function renames a file or directory. - - spec input: An FSSpec record specifying the file. - newName input: The new name of the file or directory. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - paramErr -50 No default volume - fsRnErr -59 Problem during rename - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access to - the file -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCatMoveCompat( - const FSSpec * source, - const FSSpec * dest); - - -/* - The FSpCatMoveCompat function moves a file or directory to a different - location on on the same volume. - - source input: An FSSpec record specifying the file or directory. - dest input: An FSSpec record specifying the name and location - of the directory into which the source file or - directory is to be moved. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename or attempt to move into - a file - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 Target directory is locked - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - paramErr -50 No default volume - badMovErr -122 Attempt to move into offspring - wrgVolTypErr -123 Not an HFS volume - afpAccessDenied -5000 User does not have the correct access to - the file -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpExchangeFilesCompat( - const FSSpec * source, - const FSSpec * dest); - - -/* - The FSpExchangeFilesCompat function swaps the data in two files by - changing the information in the volume's catalog and, if the files - are open, in the file control blocks. - Differences from FSpExchangeFiles: Correctly exchanges files on volumes - that don't support PBExchangeFiles. FSpExchangeFiles attempts to support - volumes that don't support PBExchangeFiles, but in System 7, 7.0.1, 7.1, - and 7 Pro, the compatibility code just doesn't work on volumes that - don't support PBExchangeFiles (even though you may get a noErr result). - System Update 3.0 and System 7.5 and later have the problems in - FSpExchangeFiles corrected. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - wrgVolTypErr -123 Not an HFS volume - diffVolErr -1303 Files on different volumes - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Object is a directory, not a file - afpSameObjectErr -5038 Source and destination files are the same -*/ - -/*****************************************************************************/ - -EXTERN_API( short ) -FSpOpenResFileCompat( - const FSSpec * spec, - SignedByte permission); - - -/* - The FSpOpenResFileCompat function opens the resource file specified - by spec. - - spec input: An FSSpec record specifying the file whose - resource file is to be opened. - permission input: A constant indicating the desired file access - permissions. - function result output: A resource file reference number, or if there's - an error -1. - - Result Codes - noErr 0 No error - nsvErr Ð35 No such volume - ioErr Ð36 I/O error - bdNamErr Ð37 Bad filename or volume name (perhaps zero - length) - eofErr Ð39 End of file - tmfoErr Ð42 Too many files open - fnfErr Ð43 File not found - opWrErr Ð49 File already open with write permission - permErr Ð54 Permissions error (on file open) - extFSErr Ð58 Volume belongs to an external file system - memFullErr Ð108 Not enough room in heap zone - dirNFErr Ð120 Directory not found - mapReadErr Ð199 Map inconsistent with operation -*/ - -/*****************************************************************************/ - -EXTERN_API( void ) -FSpCreateResFileCompat( - const FSSpec * spec, - OSType creator, - OSType fileType, - ScriptCode scriptTag); - - -/* - The FSpCreateResFileCompat function creates a new resource file with - the specified type, creator, and script code. - Differences from FSpCreateResFile: FSpCreateResFileCompat correctly - sets the fdScript in the file's FXInfo record to scriptTag if the - problem isn't fixed in the File Manager code. - - spec input: An FSSpec record specifying the resource file to create. - creator input: The creator of the new file. - fileType input The file type of the new file. - scriptCode input: The code of the script system in which the file - name is to be displayed. - - Result Codes - noErr 0 No error - dirFulErr Ð33 Directory full - dskFulErr Ð34 Disk full - nsvErr Ð35 No such volume - ioErr Ð36 I/O error - bdNamErr Ð37 Bad filename or volume name (perhaps zero - length) - tmfoErr Ð42 Too many files open - wPrErrw Ð44 Disk is write-protected - fLckdErr Ð45 File is locked -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __FSPCOMPAT__ */ - diff --git a/src/mac/classic/morefile/FileCopy.c b/src/mac/classic/morefile/FileCopy.c deleted file mode 100644 index 4848613b51..0000000000 --- a/src/mac/classic/morefile/FileCopy.c +++ /dev/null @@ -1,611 +0,0 @@ -/* - File: FileCopy.c - - Contains: A robust, general purpose file copy routine. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. Updated - various routines to use new calling convention of the - MoreFilesExtras accessor functions. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreFilesExtras.h" -#include "MoreDesktopMgr.h" -#include "FileCopy.h" - -/*****************************************************************************/ - -/* local constants */ - -/* The deny-mode privileges to use when opening the source and destination files. */ - -enum -{ - srcCopyMode = dmRdDenyWr, - dstCopyMode = dmWrDenyRdWr -}; - -/* The largest (16K) and smallest (.5K) copy buffer to use if the caller doesn't supply -** their own copy buffer. */ - -enum -{ - bigCopyBuffSize = 0x00004000, - minCopyBuffSize = 0x00000200 -}; - -/*****************************************************************************/ - -/* static prototypes */ - -static OSErr GetDestinationDirInfo(short vRefNum, - long dirID, - ConstStr255Param name, - long *theDirID, - Boolean *isDirectory, - Boolean *isDropBox); -/* GetDestinationDirInfo tells us if the destination is a directory, it's - directory ID, and if it's an AppleShare drop box (write privileges only -- - no read or search privileges). - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - theDirID output: If the object is a file, then its parent directory - ID. If the object is a directory, then its ID. - isDirectory output: True if object is a directory; false if - object is a file. - isDropBox output: True if directory is an AppleShare drop box. -*/ - -static OSErr CheckForForks(short vRefNum, - long dirID, - ConstStr255Param name, - Boolean *hasDataFork, - Boolean *hasResourceFork); -/* CheckForForks tells us if there is a data or resource fork to copy. - vRefNum input: Volume specification of the file's current - location. - dirID input: Directory ID of the file's current location. - name input: The name of the file. -*/ - -static OSErr PreflightFileCopySpace(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - ConstStr255Param dstVolName, - short dstVRefNum, - Boolean *spaceOK); -/* PreflightFileCopySpace determines if there's enough space on a - volume to copy the specified file to that volume. - Note: The results of this routine are not perfect. For example if the - volume's catalog or extents overflow file grows when the new file is - created, more allocation blocks may be needed beyond those needed for - the file's data and resource forks. - - srcVRefNum input: Volume specification of the file's current - location. - srcDirID input: Directory ID of the file's current location. - srcName input: The name of the file. - dstVolName input: A pointer to the name of the volume where - the file will be copied or NULL. - dstVRefNum input: Volume specification indicating the volume - where the file will be copied. - spaceOK output: true if there's enough space on the volume for - the file's data and resource forks. -*/ - -/*****************************************************************************/ - -static OSErr GetDestinationDirInfo(short vRefNum, - long dirID, - ConstStr255Param name, - long *theDirID, - Boolean *isDirectory, - Boolean *isDropBox) -{ - CInfoPBRec pb; - OSErr error; - - pb.dirInfo.ioACUser = 0; /* ioACUser used to be filler2, clear it before calling GetCatInfo */ - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - *theDirID = pb.dirInfo.ioDrDirID; - *isDirectory = (pb.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0; - /* see if access priviledges are make changes, not see folder, and not see files (drop box) */ - *isDropBox = userHasDropBoxAccess(pb.dirInfo.ioACUser); - - return ( error ); -} - -/*****************************************************************************/ - -static OSErr CheckForForks(short vRefNum, - long dirID, - ConstStr255Param name, - Boolean *hasDataFork, - Boolean *hasResourceFork) -{ - HParamBlockRec pb; - OSErr error; - - pb.fileParam.ioNamePtr = (StringPtr)name; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioDirID = dirID; - pb.fileParam.ioFDirIndex = 0; - error = PBHGetFInfoSync(&pb); - *hasDataFork = (pb.fileParam.ioFlLgLen != 0); - *hasResourceFork = (pb.fileParam.ioFlRLgLen != 0); - - return ( error ); -} - -/*****************************************************************************/ - -static OSErr PreflightFileCopySpace(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - ConstStr255Param dstVolName, - short dstVRefNum, - Boolean *spaceOK) -{ - UniversalFMPB pb; - OSErr error; - unsigned long dstFreeBlocks; - unsigned long dstBlksPerAllocBlk; - unsigned long srcDataBlks; - unsigned long srcResourceBlks; - - error = XGetVolumeInfoNoName(dstVolName, dstVRefNum, &pb.xPB); - if ( error == noErr ) - { - /* get allocation block size (always multiple of 512) and divide by 512 - to get number of 512-byte blocks per allocation block */ - dstBlksPerAllocBlk = ((unsigned long)pb.xPB.ioVAlBlkSiz >> 9); - - /* Convert freeBytes to free disk blocks (512-byte blocks) */ - dstFreeBlocks = U32SetU(U64ShiftRight(pb.xPB.ioVFreeBytes, 9)); - - /* Now, get the size of the file's data resource forks */ - pb.hPB.fileParam.ioNamePtr = (StringPtr)srcName; - pb.hPB.fileParam.ioVRefNum = srcVRefNum; - pb.hPB.fileParam.ioFVersNum = 0; - pb.hPB.fileParam.ioDirID = srcDirID; - pb.hPB.fileParam.ioFDirIndex = 0; - error = PBHGetFInfoSync(&pb.hPB); - if ( error == noErr ) - { - /* Since space on Mac OS disks is always allocated in allocation blocks, */ - /* this code takes into account rounding up to the end of an allocation block. */ - - /* get number of 512-byte blocks needed for data fork */ - if ( ((unsigned long)pb.hPB.fileParam.ioFlLgLen & 0x000001ff) != 0 ) - { - srcDataBlks = ((unsigned long)pb.hPB.fileParam.ioFlLgLen >> 9) + 1; - } - else - { - srcDataBlks = (unsigned long)pb.hPB.fileParam.ioFlLgLen >> 9; - } - - /* now, calculate number of new allocation blocks needed */ - if ( srcDataBlks % dstBlksPerAllocBlk ) - { - srcDataBlks = (srcDataBlks / dstBlksPerAllocBlk) + 1; - } - else - { - srcDataBlks /= dstBlksPerAllocBlk; - } - - /* get number of 512-byte blocks needed for resource fork */ - if ( ((unsigned long)pb.hPB.fileParam.ioFlRLgLen & 0x000001ff) != 0 ) - { - srcResourceBlks = ((unsigned long)pb.hPB.fileParam.ioFlRLgLen >> 9) + 1; - } - else - { - srcResourceBlks = (unsigned long)pb.hPB.fileParam.ioFlRLgLen >> 9; - } - - /* now, calculate number of new allocation blocks needed */ - if ( srcResourceBlks % dstBlksPerAllocBlk ) - { - srcResourceBlks = (srcResourceBlks / dstBlksPerAllocBlk) + 1; - } - else - { - srcResourceBlks /= dstBlksPerAllocBlk; - } - - /* Is there enough room on the destination volume for the source file? */ - *spaceOK = ( ((srcDataBlks + srcResourceBlks) * dstBlksPerAllocBlk) <= dstFreeBlocks ); - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FileCopy(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstPathname, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight) -{ - OSErr err; - - short srcRefNum = 0, /* 0 when source data and resource fork are closed */ - dstDataRefNum = 0, /* 0 when destination data fork is closed */ - dstRsrcRefNum = 0; /* 0 when destination resource fork is closed */ - - Str63 dstName; /* The filename of the destination. It might be the - ** source filename, it might be a new name... */ - - GetVolParmsInfoBuffer infoBuffer; /* Where PBGetVolParms dumps its info */ - long srcServerAdr; /* AppleTalk server address of source (if any) */ - - Boolean dstCreated = false, /* true when destination file has been created */ - ourCopyBuffer = false, /* true if we had to allocate the copy buffer */ - isDirectory, /* true if destination is really a directory */ - isDropBox; /* true if destination is an AppleShare drop box */ - - long tempLong; - short tempInt; - - Boolean spaceOK; /* true if there's enough room to copy the file to the destination volume */ - - Boolean hasDataFork; - Boolean hasResourceFork; - - /* Preflight for size */ - if ( preflight ) - { - err = PreflightFileCopySpace(srcVRefNum, srcDirID, srcName, - dstPathname, dstVRefNum, &spaceOK); - if ( err != noErr ) - { - return ( err ); - } - - if ( !spaceOK ) - { - return ( dskFulErr ); - } - } - - /* get the destination's real dirID and make sure it really is a directory */ - err = GetDestinationDirInfo(dstVRefNum, dstDirID, dstPathname, - &dstDirID, &isDirectory, &isDropBox); - if ( err != noErr ) - { - goto ErrorExit; - } - - if ( !isDirectory ) - { - return ( dirNFErr ); - } - - /* get the destination's real vRefNum */ - err = DetermineVRefNum(dstPathname, dstVRefNum, &dstVRefNum); - if ( err != noErr ) - { - goto ErrorExit; - } - - /* See if PBHCopyFile can be used. Using PBHCopyFile saves time by letting the file server - ** copy the file if the source and destination locations are on the same file server. */ - tempLong = sizeof(infoBuffer); - err = HGetVolParms(srcName, srcVRefNum, &infoBuffer, &tempLong); - if ( (err != noErr) && (err != paramErr) ) - { - return ( err ); - } - - if ( (err != paramErr) && hasCopyFile(&infoBuffer) ) - { - /* The source volume supports PBHCopyFile. */ - srcServerAdr = infoBuffer.vMServerAdr; - - /* Now, see if the destination volume is on the same file server. */ - tempLong = sizeof(infoBuffer); - err = HGetVolParms(NULL, dstVRefNum, &infoBuffer, &tempLong); - if ( (err != noErr) && (err != paramErr) ) - { - return ( err ); - } - if ( (err != paramErr) && (srcServerAdr == infoBuffer.vMServerAdr) ) - { - /* Source and Dest are on same server and PBHCopyFile is supported. Copy with CopyFile. */ - err = HCopyFile(srcVRefNum, srcDirID, srcName, dstVRefNum, dstDirID, NULL, copyName); - if ( err != noErr ) - { - return ( err ); - } - - /* AppleShare's CopyFile clears the isAlias bit, so I still need to attempt to copy - the File's attributes to attempt to get things right. */ - if ( copyName != NULL ) /* Did caller supply copy file name? */ - { - /* Yes, use the caller supplied copy file name. */ - (void) CopyFileMgrAttributes(srcVRefNum, srcDirID, srcName, - dstVRefNum, dstDirID, copyName, true); - } - else - { - /* They didn't, so get the source file name and use it. */ - if ( GetFilenameFromPathname(srcName, dstName) == noErr ) - { - /* */ - (void) CopyFileMgrAttributes(srcVRefNum, srcDirID, srcName, - dstVRefNum, dstDirID, dstName, true); - } - } - return ( err ); - } - } - - /* If we're here, then PBHCopyFile couldn't be used so we have to copy the file by hand. */ - - /* Make sure a copy buffer is allocated. */ - if ( copyBufferPtr == NULL ) - { - /* The caller didn't supply a copy buffer so grab one from the application heap. - ** Try to get a big copy buffer, if we can't, try for a 512-byte buffer. - ** If 512 bytes aren't available, we're in trouble. */ - copyBufferSize = bigCopyBuffSize; - copyBufferPtr = NewPtr(copyBufferSize); - if ( copyBufferPtr == NULL ) - { - copyBufferSize = minCopyBuffSize; - copyBufferPtr = NewPtr(copyBufferSize); - if ( copyBufferPtr == NULL ) - { - return ( memFullErr ); - } - } - ourCopyBuffer = true; - } - - /* Open the source data fork. */ - err = HOpenAware(srcVRefNum, srcDirID, srcName, srcCopyMode, &srcRefNum); - if ( err != noErr ) - return ( err ); - - /* Once a file is opened, we have to exit via ErrorExit to make sure things are cleaned up */ - - /* See if the copy will be renamed. */ - if ( copyName != NULL ) /* Did caller supply copy file name? */ - BlockMoveData(copyName, dstName, copyName[0] + 1); /* Yes, use the caller supplied copy file name. */ - else - { /* They didn't, so get the source file name and use it. */ - err = GetFileLocation(srcRefNum, &tempInt, &tempLong, dstName); - if ( err != noErr ) - { - goto ErrorExit; - } - } - - /* Create the destination file. */ - err = HCreateMinimum(dstVRefNum, dstDirID, dstName); - if ( err != noErr ) - { - goto ErrorExit; - } - dstCreated = true; /* After creating the destination file, any - ** error conditions should delete the destination file */ - - /* An AppleShare dropbox folder is a folder for which the user has the Make Changes - ** privilege (write access), but not See Files (read access) and See Folders (search access). - ** Copying a file into an AppleShare dropbox presents some special problems. Here are the - ** rules we have to follow to copy a file into a dropbox: - ** ¥ File attributes can be changed only when both forks of a file are empty. - ** ¥ DeskTop Manager comments can be added to a file only when both forks of a file - ** are empty. - ** ¥ A fork can be opened for write access only when both forks of a file are empty. - ** So, with those rules to live with, we'll do those operations now while both forks - ** are empty. */ - - if ( isDropBox ) - { - /* We only set the file attributes now if the file is being copied into a - ** drop box. In all other cases, it is better to set the attributes last - ** so that if FileCopy is modified to give up time to other processes - ** periodicly, the Finder won't try to read any bundle information (because - ** the bundle-bit will still be clear) from a partially copied file. If the - ** copy is into a drop box, we have to set the attributes now, but since the - ** destination forks are opened with write/deny-read/deny-write permissions, - ** any Finder that might see the file in the drop box won't be able to open - ** its resource fork until the resource fork is closed. - ** - ** Note: if you do modify FileCopy to give up time to other processes, don't - ** give up time between the time the destination file is created (above) and - ** the time both forks are opened (below). That way, you stand the best chance - ** of making sure the Finder doesn't read a partially copied resource fork. - */ - /* Copy attributes but don't lock the destination. */ - err = CopyFileMgrAttributes(srcVRefNum, srcDirID, srcName, - dstVRefNum, dstDirID, dstName, false); - if ( err != noErr ) - { - goto ErrorExit; - } - } - - /* Attempt to copy the comments while both forks are empty. - ** Ignore the result because we really don't care if it worked or not. */ - (void) DTCopyComment(srcVRefNum, srcDirID, srcName, dstVRefNum, dstDirID, dstName); - - /* See which forks we need to copy. By doing this, we won't create a data or resource fork - ** for the destination unless it's really needed (some foreign file systems such as - ** the ProDOS File System and Macintosh PC Exchange have to create additional disk - ** structures to support resource forks). */ - err = CheckForForks(srcVRefNum, srcDirID, srcName, &hasDataFork, &hasResourceFork); - if ( err != noErr ) - { - goto ErrorExit; - } - - if ( hasDataFork ) - { - /* Open the destination data fork. */ - err = HOpenAware(dstVRefNum, dstDirID, dstName, dstCopyMode, &dstDataRefNum); - if ( err != noErr ) - { - goto ErrorExit; - } - } - - if ( hasResourceFork ) - { - /* Open the destination resource fork. */ - err = HOpenRFAware(dstVRefNum, dstDirID, dstName, dstCopyMode, &dstRsrcRefNum); - if ( err != noErr ) - { - goto ErrorExit; - } - } - - if ( hasDataFork ) - { - /* Copy the data fork. */ - err = CopyFork(srcRefNum, dstDataRefNum, copyBufferPtr, copyBufferSize); - if ( err != noErr ) - { - goto ErrorExit; - } - - /* Close both data forks and clear reference numbers. */ - (void) FSClose(srcRefNum); - (void) FSClose(dstDataRefNum); - srcRefNum = dstDataRefNum = 0; - } - else - { - /* Close the source data fork since it was opened earlier */ - (void) FSClose(srcRefNum); - srcRefNum = 0; - } - - if ( hasResourceFork ) - { - /* Open the source resource fork. */ - err = HOpenRFAware(srcVRefNum, srcDirID, srcName, srcCopyMode, &srcRefNum); - if ( err != noErr ) - { - goto ErrorExit; - } - - /* Copy the resource fork. */ - err = CopyFork(srcRefNum, dstRsrcRefNum, copyBufferPtr, copyBufferSize); - if ( err != noErr ) - { - goto ErrorExit; - } - - /* Close both resource forks and clear reference numbers. */ - (void) FSClose(srcRefNum); - (void) FSClose(dstRsrcRefNum); - srcRefNum = dstRsrcRefNum = 0; - } - - /* Get rid of the copy buffer if we allocated it. */ - if ( ourCopyBuffer ) - { - DisposePtr((Ptr)copyBufferPtr); - } - - /* Attempt to copy attributes again to set mod date. Copy lock condition this time - ** since we're done with the copy operation. This operation will fail if we're copying - ** into an AppleShare dropbox, so we don't check for error conditions. */ - CopyFileMgrAttributes(srcVRefNum, srcDirID, srcName, - dstVRefNum, dstDirID, dstName, true); - - /* Hey, we did it! */ - return ( noErr ); - -ErrorExit: - if ( srcRefNum != 0 ) - { - (void) FSClose(srcRefNum); /* Close the source file */ - } - if ( dstDataRefNum != 0 ) - { - (void) FSClose(dstDataRefNum); /* Close the destination file data fork */ - } - if ( dstRsrcRefNum != 0 ) - { - (void) FSClose(dstRsrcRefNum); /* Close the destination file resource fork */ - } - if ( dstCreated ) - { - (void) HDelete(dstVRefNum, dstDirID, dstName); /* Delete dest file. This may fail if the file - is in a "drop folder" */ - } - if ( ourCopyBuffer ) /* dispose of any memory we allocated */ - { - DisposePtr((Ptr)copyBufferPtr); - } - - return ( err ); -} - -/*****************************************************************************/ - -pascal OSErr FSpFileCopy(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName, - void *copyBufferPtr, - long copyBufferSize, - Boolean preflight) -{ - return ( FileCopy(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name, - copyName, copyBufferPtr, copyBufferSize, preflight) ); -} - -/*****************************************************************************/ - diff --git a/src/mac/classic/morefile/FileCopy.h b/src/mac/classic/morefile/FileCopy.h deleted file mode 100644 index a855f1f96f..0000000000 --- a/src/mac/classic/morefile/FileCopy.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - File: FileCopy.h - - Contains: A robust, general purpose file copy routine. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __FILECOPY__ -#define __FILECOPY__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FileCopy( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstPathname, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight); - - -/* - The FileCopy function duplicates a file and optionally renames it. - Since the PBHCopyFile routine is only available on some - AFP server volumes under specific conditions, this routine - either uses PBHCopyFile, or does all of the work PBHCopyFile - does. The srcVRefNum, srcDirID and srcName are used to - determine the location of the file to copy. The dstVRefNum - dstDirID and dstPathname are used to determine the location of - the destination directory. If copyName <> NIL, then it points - to the name of the new file. If copyBufferPtr <> NIL, it - points to a buffer of copyBufferSize that is used to copy - the file's data. The larger the supplied buffer, the - faster the copy. If copyBufferPtr = NIL, then this routine - allocates a buffer in the application heap. If you pass a - copy buffer to this routine, make its size a multiple of 512 - ($200) bytes for optimum performance. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Source file name. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstPathname input: Pointer to destination directory name, or - nil when dstDirID specifies a directory. - copyName input: Points to the new file name if the file is - to be renamed or nil if the file isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want FileCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, FileCopy makes sure there are enough - allocation blocks on the destination volume to - hold both the data and resource forks before - starting the copy. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: FSpFileCopy, DirectoryCopy, FSpDirectoryCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpFileCopy( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName, - void * copyBufferPtr, - long copyBufferSize, - Boolean preflight); - - -/* - The FSpFileCopy function duplicates a file and optionally renames it. - Since the PBHCopyFile routine is only available on some - AFP server volumes under specific conditions, this routine - either uses PBHCopyFile, or does all of the work PBHCopyFile - does. The srcSpec is used to - determine the location of the file to copy. The dstSpec is - used to determine the location of the - destination directory. If copyName <> NIL, then it points - to the name of the new file. If copyBufferPtr <> NIL, it - points to a buffer of copyBufferSize that is used to copy - the file's data. The larger the supplied buffer, the - faster the copy. If copyBufferPtr = NIL, then this routine - allocates a buffer in the application heap. If you pass a - copy buffer to this routine, make its size a multiple of 512 - ($200) bytes for optimum performance. - - srcSpec input: An FSSpec record specifying the source file. - dstSpec input: An FSSpec record specifying the destination - directory. - copyName input: Points to the new file name if the file is - to be renamed or nil if the file isn't to - be renamed. - copyBufferPtr input: Points to a buffer of copyBufferSize that - is used the i/o buffer for the copy or - nil if you want FileCopy to allocate its - own buffer in the application heap. - copyBufferSize input: The size of the buffer pointed to - by copyBufferPtr. - preflight input: If true, FSpFileCopy makes sure there are - enough allocation blocks on the destination - volume to hold both the data and resource forks - before starting the copy. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Destination volume is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - tmfoErr -42 Too many files open - fnfErr -43 Source file not found, or destination - directory does not exist - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - opWrErr -49 File already open for writing - paramErr -50 No default volume or function not - supported by volume - permErr -54 File is already open and cannot be opened using specified deny modes - memFullErr -108 Copy buffer could not be allocated - dirNFErr -120 Directory not found or incomplete pathname - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory, directory not found - or incomplete pathname - - __________ - - Also see: FileCopy, DirectoryCopy, FSpDirectoryCopy -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __FILECOPY__ */ - diff --git a/src/mac/classic/morefile/FullPath.c b/src/mac/classic/morefile/FullPath.c deleted file mode 100644 index 32ccb9977b..0000000000 --- a/src/mac/classic/morefile/FullPath.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - File: FullPath.c - - Contains: Routines for dealing with full pathnames... if you really must. - - Version: MoreFiles - - Copyright: © 1995-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "FSpCompat.h" -#include "FullPath.h" - -/* - IMPORTANT NOTE: - - The use of full pathnames is strongly discouraged. Full pathnames are - particularly unreliable as a means of identifying files, directories - or volumes within your application, for two primary reasons: - - ¥ The user can change the name of any element in the path at virtually - any time. - ¥ Volume names on the Macintosh are *not* unique. Multiple - mounted volumes can have the same name. For this reason, the use of - a full pathname to identify a specific volume may not produce the - results you expect. If more than one volume has the same name and - a full pathname is used, the File Manager currently uses the first - mounted volume it finds with a matching name in the volume queue. - - In general, you should use a fileÕs name, parent directory ID, and - volume reference number to identify a file you want to open, delete, - or otherwise manipulate. - - If you need to remember the location of a particular file across - subsequent system boots, use the Alias Manager to create an alias record - describing the file. If the Alias Manager is not available, you can save - the fileÕs name, its parent directory ID, and the name of the volume on - which itÕs located. Although none of these methods is foolproof, they are - much more reliable than using full pathnames to identify files. - - Nonetheless, it is sometimes useful to display a fileÕs full pathname to - the user. For example, a backup utility might display a list of full - pathnames of files as it copies them onto the backup medium. Or, a - utility might want to display a dialog box showing the full pathname of - a file when it needs the userÕs confirmation to delete the file. No - matter how unreliable full pathnames may be from a file-specification - viewpoint, users understand them more readily than volume reference - numbers or directory IDs. (Hint: Use the TruncString function from - TextUtils.h with truncMiddle as the truncWhere argument to shorten - full pathnames to a displayable length.) - - The following technique for constructing the full pathname of a file is - intended for display purposes only. Applications that depend on any - particular structure of a full pathname are likely to fail on alternate - foreign file systems or under future system software versions. -*/ - -/*****************************************************************************/ - -pascal OSErr GetFullPath(short vRefNum, - long dirID, - ConstStr255Param name, - short *fullPathLength, - Handle *fullPath) -{ - OSErr result; - FSSpec spec; - - *fullPathLength = 0; - *fullPath = NULL; - - result = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); - if ( (result == noErr) || (result == fnfErr) ) - { - result = FSpGetFullPath(&spec, fullPathLength, fullPath); - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetFullPath(const FSSpec *spec, - short *fullPathLength, - Handle *fullPath) -{ - OSErr result; - OSErr realResult; - FSSpec tempSpec; - CInfoPBRec pb; - - *fullPathLength = 0; - *fullPath = NULL; - - - /* Default to noErr */ - realResult = result = noErr; - - /* work around Nav Services "bug" (it returns invalid FSSpecs with empty names) */ - if ( spec->name[0] == 0 ) - { - result = FSMakeFSSpecCompat(spec->vRefNum, spec->parID, spec->name, &tempSpec); - } - else - { - /* Make a copy of the input FSSpec that can be modified */ - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - } - - if ( result == noErr ) - { - if ( tempSpec.parID == fsRtParID ) - { - /* The object is a volume */ - - /* Add a colon to make it a full pathname */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* We're done */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - } - else - { - /* The object isn't a volume */ - - /* Is the object a file or a directory? */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrDirID = tempSpec.parID; - pb.dirInfo.ioFDirIndex = 0; - result = PBGetCatInfoSync(&pb); - // Allow file/directory name at end of path to not exist. - realResult = result; - if ( (result == noErr) || (result == fnfErr) ) - { - /* if the object is a directory, append a colon so full pathname ends with colon */ - if ( (result == noErr) && (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - } - - /* Put the object name in first */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - if ( result == noErr ) - { - /* Get the ancestor directory names */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrParID = tempSpec.parID; - do /* loop until we have an error or find the root directory */ - { - pb.dirInfo.ioFDirIndex = -1; - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - result = PBGetCatInfoSync(&pb); - if ( result == noErr ) - { - /* Append colon to directory name */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* Add directory name to beginning of fullPath */ - (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], tempSpec.name[0]); - result = MemError(); - } - } while ( (result == noErr) && (pb.dirInfo.ioDrDirID != fsRtDirID) ); - } - } - } - } - - if ( result == noErr ) - { - /* Return the length */ - *fullPathLength = GetHandleSize(*fullPath); - result = realResult; // return realResult in case it was fnfErr - } - else - { - /* Dispose of the handle and return NULL and zero length */ - if ( *fullPath != NULL ) - { - DisposeHandle(*fullPath); - } - *fullPath = NULL; - *fullPathLength = 0; - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr FSpLocationFromFullPath(short fullPathLength, - const void *fullPath, - FSSpec *spec) -{ - AliasHandle alias; - OSErr result; - Boolean wasChanged; - Str32 nullString; - - /* Create a minimal alias from the full pathname */ - nullString[0] = 0; /* null string to indicate no zone or server name */ - result = NewAliasMinimalFromFullPath(fullPathLength, fullPath, nullString, nullString, &alias); - if ( result == noErr ) - { - /* Let the Alias Manager resolve the alias. */ - result = ResolveAlias(NULL, alias, spec, &wasChanged); - - /* work around Alias Mgr sloppy volume matching bug */ - if ( spec->vRefNum == 0 ) - { - /* invalidate wrong FSSpec */ - spec->parID = 0; - spec->name[0] = 0; - result = nsvErr; - } - DisposeHandle((Handle)alias); /* Free up memory used */ - } - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr LocationFromFullPath(short fullPathLength, - const void *fullPath, - short *vRefNum, - long *parID, - Str31 name) -{ - OSErr result; - FSSpec spec; - - result = FSpLocationFromFullPath(fullPathLength, fullPath, &spec); - if ( result == noErr ) - { - *vRefNum = spec.vRefNum; - *parID = spec.parID; - BlockMoveData(&spec.name[0], &name[0], spec.name[0] + 1); - } - return ( result ); -} - -/*****************************************************************************/ - diff --git a/src/mac/classic/morefile/FullPath.h b/src/mac/classic/morefile/FullPath.h deleted file mode 100644 index e1710c12bc..0000000000 --- a/src/mac/classic/morefile/FullPath.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - File: FullPath.h - - Contains: Routines for dealing with full pathnames... if you really must. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1995-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -/* - IMPORTANT NOTE: - - The use of full pathnames is strongly discouraged. Full pathnames are - particularly unreliable as a means of identifying files, directories - or volumes within your application, for two primary reasons: - - ¥ The user can change the name of any element in the path at - virtually any time. - ¥ Volume names on the Macintosh are *not* unique. Multiple - mounted volumes can have the same name. For this reason, the use of - a full pathname to identify a specific volume may not produce the - results you expect. If more than one volume has the same name and - a full pathname is used, the File Manager currently uses the first - mounted volume it finds with a matching name in the volume queue. - - In general, you should use a fileÕs name, parent directory ID, and - volume reference number to identify a file you want to open, delete, - or otherwise manipulate. - - If you need to remember the location of a particular file across - subsequent system boots, use the Alias Manager to create an alias - record describing the file. If the Alias Manager is not available, you - can save the fileÕs name, its parent directory ID, and the name of the - volume on which itÕs located. Although none of these methods is - foolproof, they are much more reliable than using full pathnames to - identify files. - - Nonetheless, it is sometimes useful to display a fileÕs full pathname - to the user. For example, a backup utility might display a list of full - pathnames of files as it copies them onto the backup medium. Or, a - utility might want to display a dialog box showing the full pathname of - a file when it needs the userÕs confirmation to delete the file. No - matter how unreliable full pathnames may be from a file-specification - viewpoint, users understand them more readily than volume reference - numbers or directory IDs. (Hint: Use the TruncString function from - TextUtils.h with truncMiddle as the truncWhere argument to shorten - full pathnames to a displayable length.) - - The following technique for constructing the full pathname of a file is - intended for display purposes only. Applications that depend on any - particular structure of a full pathname are likely to fail on alternate - foreign file systems or under future system software versions. -*/ - -#ifndef __FULLPATH__ -#define __FULLPATH__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetFullPath( - short vRefNum, - long dirID, - ConstStr255Param name, - short * fullPathLength, - Handle * fullPath); - - -/* - The GetFullPath function builds a full pathname to the specified - object. The full pathname is returned in the newly created handle - fullPath and the length of the full pathname is returned in - fullPathLength. Your program is responsible for disposing of the - fullPath handle. - - Note that a full pathname can be made to a file/directory that does not - yet exist if all directories up to that file/directory exist. In this case, - GetFullPath will return a fnfErr. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - fullPathLength output: The number of characters in the full pathname. - If the function fails to create a full - pathname, it sets fullPathLength to 0. - fullPath output: A handle to the newly created full pathname - buffer. If the function fails to create a - full pathname, it sets fullPath to NULL. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File or directory does not exist (fullPath - and fullPathLength are still valid) - paramErr -50 No default volume - memFullErr -108 Not enough memory - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpGetFullPath -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetFullPath( - const FSSpec * spec, - short * fullPathLength, - Handle * fullPath); - - -/* - The GetFullPath function builds a full pathname to the specified - object. The full pathname is returned in the newly created handle - fullPath and the length of the full pathname is returned in - fullPathLength. Your program is responsible for disposing of the - fullPath handle. - - Note that a full pathname can be made to a file/directory that does not - yet exist if all directories up to that file/directory exist. In this case, - FSpGetFullPath will return a fnfErr. - - IMPORTANT: The definition of a FSSpec is a volume reference number (not a - drive number, working directory number, or 0), a parent directory ID (not 0), - and the name of a file or folder (not an empty name, a full pathname, or - a partial pathname containing one or more colon (:) characters). - FSpGetFullPath assumes it is getting a FSSpec that matches the rules. - If you have an FSSpec record that wasn't created by FSMakeFSSpec (or - FSMakeFSSpecCompat from FSpCompat in MoreFiles which correctly builds - FSSpecs), you should call GetFullPath instead of FSpGetFullPath. - - spec input: An FSSpec record specifying the object. - fullPathLength output: The number of characters in the full pathname. - If the function fails to create a full pathname, - it sets fullPathLength to 0. - fullPath output: A handle to the newly created full pathname - buffer. If the function fails to create a - full pathname, it sets fullPath to NULL. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File or directory does not exist (fullPath - and fullPathLength are still valid) - paramErr -50 No default volume - memFullErr -108 Not enough memory - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: GetFullPath -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpLocationFromFullPath( - short fullPathLength, - const void * fullPath, - FSSpec * spec); - - -/* - The FSpLocationFromFullPath function returns a FSSpec to the object - specified by full pathname. This function requires the Alias Manager. - - fullPathLength input: The number of characters in the full pathname - of the target. - fullPath input: A pointer to a buffer that contains the full - pathname of the target. The full pathname - starts with the name of the volume, includes - all of the directory names in the path to the - target, and ends with the target name. - spec output: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 The volume is not mounted - fnfErr -43 Target not found, but volume and parent - directory found - paramErr -50 Parameter error - usrCanceledErr -128 The user canceled the operation - - __________ - - See also: LocationFromFullPath -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -LocationFromFullPath( - short fullPathLength, - const void * fullPath, - short * vRefNum, - long * parID, - Str31 name); - - -/* - The LocationFromFullPath function returns the volume reference number, - parent directory ID and name of the object specified by full pathname. - This function requires the Alias Manager. - - fullPathLength input: The number of characters in the full pathname - of the target. - fullPath input: A pointer to a buffer that contains the full - pathname of the target. The full pathname starts - with the name of the volume, includes all of - the directory names in the path to the target, - and ends with the target name. - vRefNum output: The volume reference number. - parID output: The parent directory ID of the specified object. - name output: The name of the specified object. - - Result Codes - noErr 0 No error - nsvErr -35 The volume is not mounted - fnfErr -43 Target not found, but volume and parent - directory found - paramErr -50 Parameter error - usrCanceledErr -128 The user canceled the operation - - __________ - - See also: FSpLocationFromFullPath -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __FULLPATH__ */ - diff --git a/src/mac/classic/morefile/IterateDirectory.c b/src/mac/classic/morefile/IterateDirectory.c deleted file mode 100644 index e748829ff5..0000000000 --- a/src/mac/classic/morefile/IterateDirectory.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - File: IterateDirectory.c - - Contains: File Manager directory iterator routines. - - Version: MoreFiles - - Copyright: © 1995-2001 by Jim Luther and Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFilesExtras.h" -#include "IterateDirectory.h" - -/* -** Type definitions -*/ - -/* The IterateGlobals structure is used to minimize the amount of -** stack space used when recursively calling IterateDirectoryLevel -** and to hold global information that might be needed at any time. -*/ -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif -struct IterateGlobals -{ - IterateFilterProcPtr iterateFilter; /* pointer to IterateFilterProc */ - CInfoPBRec cPB; /* the parameter block used for PBGetCatInfo calls */ - Str63 itemName; /* the name of the current item */ - OSErr result; /* temporary holder of results - saves 2 bytes of stack each level */ - Boolean quitFlag; /* set to true if filter wants to kill interation */ - unsigned short maxLevels; /* Maximum levels to iterate through */ - unsigned short currentLevel; /* The current level IterateLevel is on */ - void *yourDataPtr; /* A pointer to caller data the filter may need to access */ -}; -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif - -typedef struct IterateGlobals IterateGlobals; -typedef IterateGlobals *IterateGlobalsPtr; - -/*****************************************************************************/ - -/* Static Prototype */ - -static void IterateDirectoryLevel(long dirID, - IterateGlobals *theGlobals); - -/*****************************************************************************/ - -/* -** Functions -*/ - -static void IterateDirectoryLevel(long dirID, - IterateGlobals *theGlobals) -{ - if ( (theGlobals->maxLevels == 0) || /* if maxLevels is zero, we aren't checking levels */ - (theGlobals->currentLevel < theGlobals->maxLevels) ) /* if currentLevel < maxLevels, look at this level */ - { - short index = 1; - - ++theGlobals->currentLevel; /* go to next level */ - - do - { /* Isn't C great... What I'd give for a "WITH theGlobals DO" about now... */ - - /* Get next source item at the current directory level */ - - theGlobals->cPB.dirInfo.ioFDirIndex = index; - theGlobals->cPB.dirInfo.ioDrDirID = dirID; - theGlobals->result = PBGetCatInfoSync((CInfoPBPtr)&theGlobals->cPB); - - if ( theGlobals->result == noErr ) - { - /* Call the IterateFilterProc */ - CallIterateFilterProc(theGlobals->iterateFilter, &theGlobals->cPB, &theGlobals->quitFlag, theGlobals->yourDataPtr); - - /* Is it a directory? */ - if ( (theGlobals->cPB.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* We have a directory */ - if ( !theGlobals->quitFlag ) - { - /* Dive again if the IterateFilterProc didn't say "quit" */ - IterateDirectoryLevel(theGlobals->cPB.dirInfo.ioDrDirID, theGlobals); - } - } - } - - ++index; /* prepare to get next item */ - } while ( (theGlobals->result == noErr) && (!theGlobals->quitFlag) ); /* time to fall back a level? */ - - if ( (theGlobals->result == fnfErr) || /* fnfErr is OK - it only means we hit the end of this level */ - (theGlobals->result == afpAccessDenied) ) /* afpAccessDenied is OK, too - it only means we cannot see inside a directory */ - { - theGlobals->result = noErr; - } - - --theGlobals->currentLevel; /* return to previous level as we leave */ - } -} - -/*****************************************************************************/ - -pascal OSErr IterateDirectory(short vRefNum, - long dirID, - ConstStr255Param name, - unsigned short maxLevels, - IterateFilterProcPtr iterateFilter, - void *yourDataPtr) -{ - IterateGlobals theGlobals; - OSErr result; - long theDirID; - short theVRefNum; - Boolean isDirectory; - - /* Make sure there is a IterateFilter */ - if ( iterateFilter != NULL ) - { - /* Get the real directory ID and make sure it is a directory */ - result = GetDirectoryID(vRefNum, dirID, name, &theDirID, &isDirectory); - if ( result == noErr ) - { - if ( isDirectory == true ) - { - /* Get the real vRefNum */ - result = DetermineVRefNum(name, vRefNum, &theVRefNum); - if ( result == noErr ) - { - /* Set up the globals we need to access from the recursive routine. */ - theGlobals.iterateFilter = iterateFilter; - theGlobals.cPB.hFileInfo.ioNamePtr = (StringPtr)&theGlobals.itemName; - theGlobals.cPB.hFileInfo.ioVRefNum = theVRefNum; - theGlobals.itemName[0] = 0; - theGlobals.result = noErr; - theGlobals.quitFlag = false; - theGlobals.maxLevels = maxLevels; - theGlobals.currentLevel = 0; /* start at level 0 */ - theGlobals.yourDataPtr = yourDataPtr; - - /* Here we go into recursion land... */ - IterateDirectoryLevel(theDirID, &theGlobals); - - result = theGlobals.result; /* set the result */ - } - } - else - { - result = dirNFErr; /* a file was passed instead of a directory */ - } - } - } - else - { - result = paramErr; /* iterateFilter was NULL */ - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr FSpIterateDirectory(const FSSpec *spec, - unsigned short maxLevels, - IterateFilterProcPtr iterateFilter, - void *yourDataPtr) -{ - return ( IterateDirectory(spec->vRefNum, spec->parID, spec->name, - maxLevels, iterateFilter, yourDataPtr) ); -} - -/*****************************************************************************/ diff --git a/src/mac/classic/morefile/IterateDirectory.h b/src/mac/classic/morefile/IterateDirectory.h deleted file mode 100644 index ef6b113eea..0000000000 --- a/src/mac/classic/morefile/IterateDirectory.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - File: IterateDirectory.h - - Contains: File Manager directory iterator routines. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1995-2001 by Jim Luther and Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __ITERATEDIRECTORY__ -#define __ITERATEDIRECTORY__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -typedef CALLBACK_API( void , IterateFilterProcPtr )(const CInfoPBRec *cpbPtr, Boolean *quitFlag, void *yourDataPtr); -/* - This is the prototype for the IterateFilterProc function which is - called once for each file and directory found by IterateDirectory. The - IterateFilterProc gets a pointer to the CInfoPBRec that IterateDirectory - used to call PBGetCatInfo. The IterateFilterProc can use the read-only - data in the CInfoPBRec for whatever it wants. - - If the IterateFilterProc wants to stop IterateDirectory, it can set - quitFlag to true (quitFlag will be passed to the IterateFilterProc - false). - - The yourDataPtr parameter can point to whatever data structure you might - want to access from within the IterateFilterProc. - - cpbPtr input: A pointer to the CInfoPBRec that IterateDirectory - used to call PBGetCatInfo. The CInfoPBRec and the - data it points to must not be changed by your - IterateFilterProc. - quitFlag output: Your IterateFilterProc can set quitFlag to true - if it wants to stop IterateDirectory. - yourDataPtr input: A pointer to whatever data structure you might - want to access from within the IterateFilterProc. - - __________ - - Also see: IterateDirectory, FSpIterateDirectory -*/ -#define CallIterateFilterProc(userRoutine, cpbPtr, quitFlag, yourDataPtr) \ - (*(userRoutine))((cpbPtr), (quitFlag), (yourDataPtr)) - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -IterateDirectory( - short vRefNum, - long dirID, - ConstStr255Param name, - unsigned short maxLevels, - IterateFilterProcPtr iterateFilter, - void * yourDataPtr); - - -/* - The IterateDirectory function performs a recursive iteration (scan) of - the specified directory and calls your IterateFilterProc function once - for each file and directory found. - - The maxLevels parameter lets you control how deep the recursion goes. - If maxLevels is 1, IterateDirectory only scans the specified directory; - if maxLevels is 2, IterateDirectory scans the specified directory and - one subdirectory below the specified directory; etc. Set maxLevels to - zero to scan all levels. - - The yourDataPtr parameter can point to whatever data structure you might - want to access from within the IterateFilterProc. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - maxLevels input: Maximum number of directory levels to scan or - zero to scan all directory levels. - iterateFilter input: A pointer to the routine you want called once - for each file and directory found by - IterateDirectory. - yourDataPtr input: A pointer to whatever data structure you might - want to access from within the IterateFilterProc. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume or iterateFilter was NULL - dirNFErr -120 Directory not found or incomplete pathname - or a file was passed instead of a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: IterateFilterProcPtr, FSpIterateDirectory -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpIterateDirectory( - const FSSpec * spec, - unsigned short maxLevels, - IterateFilterProcPtr iterateFilter, - void * yourDataPtr); - - -/* - The FSpIterateDirectory function performs a recursive iteration (scan) - of the specified directory and calls your IterateFilterProc function once - for each file and directory found. - - The maxLevels parameter lets you control how deep the recursion goes. - If maxLevels is 1, FSpIterateDirectory only scans the specified directory; - if maxLevels is 2, FSpIterateDirectory scans the specified directory and - one subdirectory below the specified directory; etc. Set maxLevels to - zero to scan all levels. - - The yourDataPtr parameter can point to whatever data structure you might - want to access from within the IterateFilterProc. - - spec input: An FSSpec record specifying the directory to scan. - maxLevels input: Maximum number of directory levels to scan or - zero to scan all directory levels. - iterateFilter input: A pointer to the routine you want called once - for each file and directory found by - FSpIterateDirectory. - yourDataPtr input: A pointer to whatever data structure you might - want to access from within the IterateFilterProc. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume or iterateFilter was NULL - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: IterateFilterProcPtr, IterateDirectory -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __ITERATEDIRECTORY__ */ - diff --git a/src/mac/classic/morefile/MoreDesktopMgr.c b/src/mac/classic/morefile/MoreDesktopMgr.c deleted file mode 100644 index 880ed263f0..0000000000 --- a/src/mac/classic/morefile/MoreDesktopMgr.c +++ /dev/null @@ -1,1270 +0,0 @@ -/* - File: MoreDesktopMgr.c - - Contains: A collection of useful high-level Desktop Manager routines. - If the Desktop Manager is not available, use the Desktop file - for 'read' operations. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - (NG) Nitin Ganatra - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. Updated - various routines to use new calling convention of the - MoreFilesExtras accessor functions. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreFilesExtras.h" -#include "Search.h" -#include "MoreDesktopMgr.h" - -/*****************************************************************************/ - -/* Desktop file notes: -** -** ¥ The Desktop file is owned by the Finder and is normally open by the -** Finder. That means that we only have read-only access to the Desktop -** file. -** ¥ Since the Resource Manager doesn't support shared access to resource -** files and we're using read-only access, we don't ever leave the -** Desktop file open. We open a path to it, get the data we want out -** of it, and then close the open path. This is the only safe way to -** open a resource file with read-only access since some other program -** could have it open with write access. -** ¥ The bundle related resources in the Desktop file are normally -** purgable, so when we're looking through them, we don't bother to -** release resources we're done looking at - closing the resource file -** (which we always do) will release them. -** ¥ Since we can't assume the Desktop file is named "Desktop" -** (it probably is everywhere but France), we get the Desktop -** file's name by searching the volume's root directory for a file -** with fileType == 'FNDR' and creator == 'ERIK'. The only problem with -** this scheme is that someone could create another file with that type -** and creator in the root directory and we'd find the wrong file. -** The chances of this are very slim. -*/ - -/*****************************************************************************/ - -/* local defines */ - -enum -{ - kBNDLResType = 'BNDL', - kFREFResType = 'FREF', - kIconFamResType = 'ICN#', - kFCMTResType = 'FCMT', - kAPPLResType = 'APPL' -}; - -/*****************************************************************************/ - -/* local data structures */ - -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif - -struct IDRec -{ - short localID; - short rsrcID; -}; -typedef struct IDRec IDRec; -typedef IDRec *IDRecPtr; - -struct BundleType -{ - OSType type; /* 'ICN#' or 'FREF' */ - short count; /* number of IDRecs - 1 */ - IDRec idArray[1]; -}; -typedef struct BundleType BundleType; -typedef BundleType *BundleTypePtr; - -struct BNDLRec -{ - OSType signature; /* creator type signature */ - short versionID; /* version - should always be 0 */ - short numTypes; /* number of elements in typeArray - 1 */ - BundleType typeArray[1]; -}; -typedef struct BNDLRec BNDLRec; -typedef BNDLRec **BNDLRecHandle; - -struct FREFRec -{ - OSType fileType; /* file type */ - short iconID; /* icon local ID */ - Str255 fileName; /* file name */ -}; -typedef struct FREFRec FREFRec; -typedef FREFRec **FREFRecHandle; - -struct APPLRec -{ - OSType creator; /* creator type signature */ - long parID; /* parent directory ID */ - Str255 applName; /* application name */ -}; -typedef struct APPLRec APPLRec; -typedef APPLRec *APPLRecPtr; - -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif - -/*****************************************************************************/ - -/* static prototypes */ - -static OSErr GetDesktopFileName(short vRefNum, - Str255 desktopName); - -static OSErr GetAPPLFromDesktopFile(ConstStr255Param volName, - short vRefNum, - OSType creator, - short *applVRefNum, - long *applParID, - Str255 applName); - -static OSErr FindBundleGivenCreator(OSType creator, - BNDLRecHandle *returnBndl); - -static OSErr FindTypeInBundle(OSType typeToFind, - BNDLRecHandle theBndl, - BundleTypePtr *returnBundleType); - -static OSErr GetLocalIDFromFREF(BundleTypePtr theBundleType, - OSType fileType, - short *iconLocalID); - -static OSErr GetIconRsrcIDFromLocalID(BundleTypePtr theBundleType, - short iconLocalID, - short *iconRsrcID); - -static OSType DTIconToResIcon(short iconType); - -static OSErr GetIconFromDesktopFile(ConstStr255Param volName, - short vRefNum, - short iconType, - OSType fileCreator, - OSType fileType, - Handle *iconHandle); - -static OSErr GetCommentID(short vRefNum, - long dirID, - ConstStr255Param name, - short *commentID); - -static OSErr GetCommentFromDesktopFile(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment); - -/*****************************************************************************/ - -/* -** GetDesktopFileName -** -** Get the name of the Desktop file. -*/ -static OSErr GetDesktopFileName(short vRefNum, - Str255 desktopName) -{ - OSErr error; - HParamBlockRec pb; - short index; - Boolean found; - - pb.fileParam.ioNamePtr = desktopName; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioFVersNum = 0; - index = 1; - found = false; - do - { - pb.fileParam.ioDirID = fsRtDirID; - pb.fileParam.ioFDirIndex = index; - error = PBHGetFInfoSync(&pb); - if ( error == noErr ) - { - if ( (pb.fileParam.ioFlFndrInfo.fdType == 'FNDR') && - (pb.fileParam.ioFlFndrInfo.fdCreator == 'ERIK') ) - { - found = true; - } - } - ++index; - } while ( (error == noErr) && !found ); - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DTOpen(ConstStr255Param volName, - short vRefNum, - short *dtRefNum, - Boolean *newDTDatabase) -{ - OSErr error; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize; - DTPBRec pb; - - /* Check for volume Desktop Manager support before calling */ - infoSize = sizeof(GetVolParmsInfoBuffer); - error = HGetVolParms(volName, vRefNum, &volParmsInfo, &infoSize); - if ( error == noErr ) - { - if ( hasDesktopMgr(&volParmsInfo) ) - { - pb.ioNamePtr = (StringPtr)volName; - pb.ioVRefNum = vRefNum; - error = PBDTOpenInform(&pb); - /* PBDTOpenInform informs us if the desktop was just created */ - /* by leaving the low bit of ioTagInfo clear (0) */ - *newDTDatabase = ((pb.ioTagInfo & 1L) == 0); - if ( error == paramErr ) - { - error = PBDTGetPath(&pb); - /* PBDTGetPath doesn't tell us if the database is new */ - /* so assume it is not new */ - *newDTDatabase = false; - } - *dtRefNum = pb.ioDTRefNum; - } - else - { - error = paramErr; - } - } - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetAPPLFromDesktopFile -** -** Get a application's location from the -** Desktop file's 'APPL' resources. -*/ -static OSErr GetAPPLFromDesktopFile(ConstStr255Param volName, - short vRefNum, - OSType creator, - short *applVRefNum, - long *applParID, - Str255 applName) -{ - OSErr error; - short realVRefNum; - Str255 desktopName; - short savedResFile; - short dfRefNum; - Handle applResHandle; - Boolean foundCreator; - Ptr applPtr; - long applSize; - - error = DetermineVRefNum(volName, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = GetDesktopFileName(realVRefNum, desktopName); - if ( error == noErr ) - { - savedResFile = CurResFile(); - /* - ** Open the 'Desktop' file in the root directory. (because - ** opening the resource file could preload unwanted resources, - ** bracket the call with SetResLoad(s)) - */ - SetResLoad(false); - dfRefNum = HOpenResFile(realVRefNum, fsRtDirID, desktopName, fsRdPerm); - SetResLoad(true); - - if ( dfRefNum != -1) - { - /* Get 'APPL' resource ID 0 */ - applResHandle = Get1Resource(kAPPLResType, 0); - if ( applResHandle != NULL ) - { - applSize = GetHandleSize((Handle)applResHandle); - if ( applSize != 0 ) /* make sure the APPL resource isn't empty */ - { - foundCreator = false; - applPtr = *applResHandle; - - /* APPL's don't have a count so I have to use the size as the bounds */ - while ( (foundCreator == false) && - (applPtr < (*applResHandle + applSize)) ) - { - if ( ((APPLRecPtr)applPtr)->creator == creator ) - { - foundCreator = true; - } - else - { - /* fun with pointer math... */ - applPtr += sizeof(OSType) + - sizeof(long) + - ((APPLRecPtr)applPtr)->applName[0] + 1; - /* application mappings are word aligned within the resource */ - if ( ((unsigned long)applPtr % 2) != 0 ) - { - applPtr += 1; - } - } - } - if ( foundCreator == true ) - { - *applVRefNum = realVRefNum; - *applParID = ((APPLRecPtr)applPtr)->parID; - BlockMoveData(((APPLRecPtr)applPtr)->applName, - applName, - ((APPLRecPtr)applPtr)->applName[0] + 1); - /* error is already noErr */ - } - else - { - error = afpItemNotFound; /* didn't find a creator match */ - } - } - else - { - error = afpItemNotFound; /* no APPL mapping available */ - } - } - else - { - error = afpItemNotFound; /* no APPL mapping available */ - } - - /* restore the resource chain and close the Desktop file */ - UseResFile(savedResFile); - CloseResFile(dfRefNum); - } - else - { - error = afpItemNotFound; - } - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DTXGetAPPL(ConstStr255Param volName, - short vRefNum, - OSType creator, - Boolean searchCatalog, - short *applVRefNum, - long *applParID, - Str255 applName) -{ - OSErr error; - UniversalFMPB pb; - short dtRefNum; - Boolean newDTDatabase; - short realVRefNum; - short index; - Boolean applFound; - FSSpec spec; - long actMatchCount; - - /* get the real vRefNum */ - error = DetermineVRefNum(volName, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = DTOpen(volName, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - if ( !newDTDatabase ) - { - index = 0; - applFound = false; - do - { - pb.dtPB.ioNamePtr = applName; - pb.dtPB.ioDTRefNum = dtRefNum; - pb.dtPB.ioIndex = index; - pb.dtPB.ioFileCreator = creator; - error = PBDTGetAPPLSync(&pb.dtPB); - if ( error == noErr ) - { - /* got a match - see if it is valid */ - - *applVRefNum = realVRefNum; /* get the vRefNum now */ - *applParID = pb.dtPB.ioAPPLParID; /* get the parent ID now */ - - /* pb.hPB.fileParam.ioNamePtr is already set */ - pb.hPB.fileParam.ioVRefNum = realVRefNum; - pb.hPB.fileParam.ioFVersNum = 0; - pb.hPB.fileParam.ioDirID = *applParID; - pb.hPB.fileParam.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - if ( PBHGetFInfoSync(&pb.hPB) == noErr ) - { - if ( (pb.hPB.fileParam.ioFlFndrInfo.fdCreator == creator) && - (pb.hPB.fileParam.ioFlFndrInfo.fdType == 'APPL') ) - { - applFound = true; - } - } - } - ++index; - } while ( (error == noErr) && !applFound ); - if ( error != noErr ) - { - error = afpItemNotFound; - } - } - else - { - /* Desktop database is empty (new), set error to try CatSearch */ - error = afpItemNotFound; - } - } - /* acceptable errors from Desktop Manager to continue are paramErr or afpItemNotFound */ - if ( error == paramErr ) - { - /* if paramErr, the volume didn't support the Desktop Manager */ - /* try the Desktop file */ - - error = GetAPPLFromDesktopFile(volName, vRefNum, creator, - applVRefNum, applParID, applName); - if ( error == noErr ) - { - /* got a match - see if it is valid */ - - pb.hPB.fileParam.ioNamePtr = applName; - pb.hPB.fileParam.ioVRefNum = *applVRefNum; - pb.hPB.fileParam.ioFVersNum = 0; - pb.hPB.fileParam.ioDirID = *applParID; - pb.hPB.fileParam.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - if ( PBHGetFInfoSync(&pb.hPB) == noErr ) - { - if ( (pb.hPB.fileParam.ioFlFndrInfo.fdCreator != creator) || - (pb.hPB.fileParam.ioFlFndrInfo.fdType != 'APPL') ) - { - error = afpItemNotFound; - } - } - else if ( error == fnfErr ) - { - error = afpItemNotFound; - } - } - } - /* acceptable error from DesktopFile code to continue is afpItemNotFound */ - if ( (error == afpItemNotFound) && searchCatalog) - { - /* Couldn't be found in the Desktop file either, */ - /* try searching with CatSearch if requested */ - - error = CreatorTypeFileSearch(NULL, realVRefNum, creator, kAPPLResType, &spec, 1, - &actMatchCount, true); - if ( (error == noErr) || (error == eofErr) ) - { - if ( actMatchCount > 0 ) - { - *applVRefNum = spec.vRefNum; - *applParID = spec.parID; - BlockMoveData(spec.name, applName, spec.name[0] + 1); - } - else - { - error = afpItemNotFound; - } - } - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTXGetAPPL(ConstStr255Param volName, - short vRefNum, - OSType creator, - Boolean searchCatalog, - FSSpec *spec) -{ - return ( DTXGetAPPL(volName, vRefNum, creator, searchCatalog, - &(spec->vRefNum), &(spec->parID), spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr DTGetAPPL(ConstStr255Param volName, - short vRefNum, - OSType creator, - short *applVRefNum, - long *applParID, - Str255 applName) -{ - /* Call DTXGetAPPL with the "searchCatalog" parameter true */ - return ( DTXGetAPPL(volName, vRefNum, creator, true, - applVRefNum, applParID, applName) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTGetAPPL(ConstStr255Param volName, - short vRefNum, - OSType creator, - FSSpec *spec) -{ - /* Call DTXGetAPPL with the "searchCatalog" parameter true */ - return ( DTXGetAPPL(volName, vRefNum, creator, true, - &(spec->vRefNum), &(spec->parID), spec->name) ); -} - -/*****************************************************************************/ - -/* -** FindBundleGivenCreator -** -** Search the current resource file for the 'BNDL' resource with the given -** creator and return a handle to it. -*/ -static OSErr FindBundleGivenCreator(OSType creator, - BNDLRecHandle *returnBndl) -{ - OSErr error; - short numOfBundles; - short index; - BNDLRecHandle theBndl; - - error = afpItemNotFound; /* default to not found */ - - /* Search each BNDL resource until we find the one with a matching creator. */ - - numOfBundles = Count1Resources(kBNDLResType); - index = 1; - *returnBndl = NULL; - - while ( (index <= numOfBundles) && (*returnBndl == NULL) ) - { - theBndl = (BNDLRecHandle)Get1IndResource(kBNDLResType, index); - - if ( theBndl != NULL ) - { - if ( (*theBndl)->signature == creator ) - { - /* numTypes and typeArray->count will always be the actual count minus 1, */ - /* so 0 in both fields is valid. */ - if ( ((*theBndl)->numTypes >= 0) && ((*theBndl)->typeArray->count >= 0) ) - { - /* got it */ - *returnBndl = theBndl; - error = noErr; - } - } - } - - index ++; - } - - return ( error ); -} - -/*****************************************************************************/ - -/* -** FindTypeInBundle -** -** Given a Handle to a BNDL return a pointer to the desired type -** in it. If the type is not found, or if the type's count < 0, -** return afpItemNotFound. -*/ -static OSErr FindTypeInBundle(OSType typeToFind, - BNDLRecHandle theBndl, - BundleTypePtr *returnBundleType) -{ - OSErr error; - short index; - Ptr ptrIterator; /* use a Ptr so we can do ugly pointer math */ - - error = afpItemNotFound; /* default to not found */ - - ptrIterator = (Ptr)((*theBndl)->typeArray); - index = 0; - *returnBundleType = NULL; - - while ( (index < ((*theBndl)->numTypes + 1)) && - (*returnBundleType == NULL) ) - { - if ( (((BundleTypePtr)ptrIterator)->type == typeToFind) && - (((BundleTypePtr)ptrIterator)->count >= 0) ) - { - *returnBundleType = (BundleTypePtr)ptrIterator; - error = noErr; - } - else - { - ptrIterator += ( sizeof(OSType) + - sizeof(short) + - ( sizeof(IDRec) * (((BundleTypePtr)ptrIterator)->count + 1) ) ); - ++index; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetLocalIDFromFREF -** -** Given a pointer to a 'FREF' BundleType record, load each 'FREF' resource -** looking for a matching fileType. If a matching fileType is found, return -** its icon local ID. If no match is found, return afpItemNotFound as the -** function result. -*/ -static OSErr GetLocalIDFromFREF(BundleTypePtr theBundleType, - OSType fileType, - short *iconLocalID) -{ - OSErr error; - short index; - IDRecPtr idIterator; - FREFRecHandle theFref; - - error = afpItemNotFound; /* default to not found */ - - /* For each localID in this type, get the FREF resource looking for fileType */ - index = 0; - idIterator = &theBundleType->idArray[0]; - *iconLocalID = 0; - - while ( (index <= theBundleType->count) && (*iconLocalID == 0) ) - { - theFref = (FREFRecHandle)Get1Resource(kFREFResType, idIterator->rsrcID); - if ( theFref != NULL ) - { - if ( (*theFref)->fileType == fileType ) - { - *iconLocalID = (*theFref)->iconID; - error = noErr; - } - } - - ++idIterator; - ++index; - } - - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetIconRsrcIDFromLocalID -** -** Given a pointer to a 'ICN#' BundleType record, look for the IDRec with -** the localID that matches iconLocalID. If a matching IDRec is found, -** return the IDRec's rsrcID field value. If no match is found, return -** afpItemNotFound as the function result. -*/ -static OSErr GetIconRsrcIDFromLocalID(BundleTypePtr theBundleType, - short iconLocalID, - short *iconRsrcID) -{ - OSErr error; - short index; - IDRecPtr idIterator; - - error = afpItemNotFound; /* default to not found */ - - /* Find the rsrcID of the icon family type, given the localID */ - index = 0; - idIterator = &theBundleType->idArray[0]; - *iconRsrcID = 0; - - while ( (index <= theBundleType->count) && (*iconRsrcID == 0) ) - { - if ( idIterator->localID == iconLocalID ) - { - *iconRsrcID = idIterator->rsrcID; - error = noErr; - } - - idIterator ++; - index ++; - } - - return ( error ); -} - -/*****************************************************************************/ - -/* -** DTIconToResIcon -** -** Map a Desktop Manager icon type to the corresponding resource type. -** Return (OSType)0 if there is no corresponding resource type. -*/ -static OSType DTIconToResIcon(short iconType) -{ - OSType resType; - - switch ( iconType ) - { - case kLargeIcon: - resType = large1BitMask; - break; - case kLarge4BitIcon: - resType = large4BitData; - break; - case kLarge8BitIcon: - resType = large8BitData; - break; - case kSmallIcon: - resType = small1BitMask; - break; - case kSmall4BitIcon: - resType = small4BitData; - break; - case kSmall8BitIcon: - resType = small8BitData; - break; - default: - resType = (OSType)0; - break; - } - - return ( resType ); -} - -/*****************************************************************************/ - -/* -** GetIconFromDesktopFile -** -** INPUT a pointer to a non-existent Handle, because we'll allocate one -** -** search each BNDL resource for the right fileCreator and once we get it -** find the 'FREF' type in BNDL -** for each localID in the type, open the FREF resource -** if the FREF is the desired fileType -** get its icon localID -** get the ICN# type in BNDL -** get the icon resource number from the icon localID -** get the icon resource type from the desktop mgr's iconType -** get the icon of that type and number -*/ -static OSErr GetIconFromDesktopFile(ConstStr255Param volName, - short vRefNum, - short iconType, - OSType fileCreator, - OSType fileType, - Handle *iconHandle) -{ - OSErr error; - short realVRefNum; - Str255 desktopName; - short savedResFile; - short dfRefNum; - BNDLRecHandle theBndl = NULL; - BundleTypePtr theBundleType; - short iconLocalID; - short iconRsrcID; - OSType iconRsrcType; - Handle returnIconHandle; - char bndlState; - - *iconHandle = NULL; - - error = DetermineVRefNum(volName, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = GetDesktopFileName(realVRefNum, desktopName); - if ( error == noErr ) - { - savedResFile = CurResFile(); - - /* - ** Open the 'Desktop' file in the root directory. (because - ** opening the resource file could preload unwanted resources, - ** bracket the call with SetResLoad(s)) - */ - SetResLoad(false); - dfRefNum = HOpenResFile(realVRefNum, fsRtDirID, desktopName, fsRdPerm); - SetResLoad(true); - - if ( dfRefNum != -1 ) - { - /* - ** Find the BNDL resource with the specified creator. - */ - error = FindBundleGivenCreator(fileCreator, &theBndl); - if ( error == noErr ) - { - /* Lock the BNDL resource so it won't be purged when other resources are loaded */ - bndlState = HGetState((Handle)theBndl); - HLock((Handle)theBndl); - - /* Find the 'FREF' BundleType record in the BNDL resource. */ - error = FindTypeInBundle(kFREFResType, theBndl, &theBundleType); - if ( error == noErr ) - { - /* Find the local ID in the 'FREF' resource with the specified fileType */ - error = GetLocalIDFromFREF(theBundleType, fileType, &iconLocalID); - if ( error == noErr ) - { - /* Find the 'ICN#' BundleType record in the BNDL resource. */ - error = FindTypeInBundle(kIconFamResType, theBndl, &theBundleType); - if ( error == noErr ) - { - /* Find the icon's resource ID in the 'ICN#' BundleType record */ - error = GetIconRsrcIDFromLocalID(theBundleType, iconLocalID, &iconRsrcID); - if ( error == noErr ) - { - /* Map Desktop Manager icon type to resource type */ - iconRsrcType = DTIconToResIcon(iconType); - - if ( iconRsrcType != (OSType)0 ) - { - /* Load the icon */ - returnIconHandle = Get1Resource(iconRsrcType, iconRsrcID); - if ( returnIconHandle != NULL ) - { - /* Copy the resource handle, and return the copy */ - HandToHand(&returnIconHandle); - if ( MemError() == noErr ) - { - *iconHandle = returnIconHandle; - } - else - { - error = afpItemNotFound; - } - } - else - { - error = afpItemNotFound; - } - } - } - } - } - } - /* Restore the state of the BNDL resource */ - HSetState((Handle)theBndl, bndlState); - } - /* Restore the resource chain and close the Desktop file */ - UseResFile(savedResFile); - CloseResFile(dfRefNum); - } - else - { - error = ResError(); /* could not open Desktop file */ - } - } - if ( (error != noErr) && (error != memFullErr) ) - { - error = afpItemNotFound; /* force an error we should return */ - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DTGetIcon(ConstStr255Param volName, - short vRefNum, - short iconType, - OSType fileCreator, - OSType fileType, - Handle *iconHandle) -{ - OSErr error; - DTPBRec pb; - short dtRefNum; - Boolean newDTDatabase; - Size bufferSize; - - *iconHandle = NULL; - error = DTOpen(volName, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - /* there was a desktop database and it's now open */ - - if ( !newDTDatabase ) /* don't bother to look in a new (empty) database */ - { - /* get the buffer size for the requested icon type */ - switch ( iconType ) - { - case kLargeIcon: - bufferSize = kLargeIconSize; - break; - case kLarge4BitIcon: - bufferSize = kLarge4BitIconSize; - break; - case kLarge8BitIcon: - bufferSize = kLarge8BitIconSize; - break; - case kSmallIcon: - bufferSize = kSmallIconSize; - break; - case kSmall4BitIcon: - bufferSize = kSmall4BitIconSize; - break; - case kSmall8BitIcon: - bufferSize = kSmall8BitIconSize; - break; - default: - iconType = 0; - bufferSize = 0; - break; - } - if ( bufferSize != 0 ) - { - *iconHandle = NewHandle(bufferSize); - if ( *iconHandle != NULL ) - { - HLock(*iconHandle); - - pb.ioDTRefNum = dtRefNum; - pb.ioTagInfo = 0; - pb.ioDTBuffer = **iconHandle; - pb.ioDTReqCount = bufferSize; - pb.ioIconType = iconType; - pb.ioFileCreator = fileCreator; - pb.ioFileType = fileType; - error = PBDTGetIconSync(&pb); - - HUnlock(*iconHandle); - - if ( error != noErr ) - { - DisposeHandle(*iconHandle); /* dispose of the allocated memory */ - *iconHandle = NULL; - } - } - else - { - error = memFullErr; /* handle could not be allocated */ - } - } - else - { - error = paramErr; /* unknown icon type requested */ - } - } - else - { - error = afpItemNotFound; /* the desktop database was empty - nothing to return */ - } - } - else - { - /* There is no desktop database - try the Desktop file */ - - error = GetIconFromDesktopFile(volName, vRefNum, iconType, - fileCreator, fileType, iconHandle); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DTSetComment(short vRefNum, - long dirID, - ConstStr255Param name, - ConstStr255Param comment) -{ - DTPBRec pb; - OSErr error; - short dtRefNum; - Boolean newDTDatabase; - - error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - pb.ioDTRefNum = dtRefNum; - pb.ioNamePtr = (StringPtr)name; - pb.ioDirID = dirID; - pb.ioDTBuffer = (Ptr)&comment[1]; - /* Truncate the comment to 200 characters just in case */ - /* some file system doesn't range check */ - if ( comment[0] <= 200 ) - { - pb.ioDTReqCount = comment[0]; - } - else - { - pb.ioDTReqCount = 200; - } - error = PBDTSetCommentSync(&pb); - } - return (error); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTSetComment(const FSSpec *spec, - ConstStr255Param comment) -{ - return (DTSetComment(spec->vRefNum, spec->parID, spec->name, comment)); -} - -/*****************************************************************************/ - -/* -** GetCommentID -** -** Get the comment ID number for the Desktop file's 'FCMT' resource ID from -** the file or folders fdComment (frComment) field. -*/ -static OSErr GetCommentID(short vRefNum, - long dirID, - ConstStr255Param name, - short *commentID) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - *commentID = pb.hFileInfo.ioFlXFndrInfo.fdComment; - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetCommentFromDesktopFile -** -** Get a file or directory's Finder comment field (if any) from the -** Desktop file's 'FCMT' resources. -*/ -static OSErr GetCommentFromDesktopFile(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment) -{ - OSErr error; - short commentID; - short realVRefNum; - Str255 desktopName; - short savedResFile; - short dfRefNum; - StringHandle commentHandle; - - /* Get the comment ID number */ - error = GetCommentID(vRefNum, dirID, name, &commentID); - if ( error == noErr ) - { - if ( commentID != 0 ) /* commentID == 0 means there's no comment */ - { - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = GetDesktopFileName(realVRefNum, desktopName); - if ( error == noErr ) - { - savedResFile = CurResFile(); - /* - ** Open the 'Desktop' file in the root directory. (because - ** opening the resource file could preload unwanted resources, - ** bracket the call with SetResLoad(s)) - */ - SetResLoad(false); - dfRefNum = HOpenResFile(realVRefNum, fsRtDirID, desktopName, fsRdPerm); - SetResLoad(true); - - if ( dfRefNum != -1) - { - /* Get the comment resource */ - commentHandle = (StringHandle)Get1Resource(kFCMTResType,commentID); - if ( commentHandle != NULL ) - { - if ( GetHandleSize((Handle)commentHandle) > 0 ) - { - BlockMoveData(*commentHandle, comment, *commentHandle[0] + 1); - } - else - { - error = afpItemNotFound; /* no comment available */ - } - } - else - { - error = afpItemNotFound; /* no comment available */ - } - - /* restore the resource chain and close the Desktop file */ - UseResFile(savedResFile); - CloseResFile(dfRefNum); - } - else - { - error = afpItemNotFound; - } - } - else - { - error = afpItemNotFound; - } - } - } - else - { - error = afpItemNotFound; /* no comment available */ - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DTGetComment(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment) -{ - DTPBRec pb; - OSErr error; - short dtRefNum; - Boolean newDTDatabase; - - if (comment != NULL) - { - comment[0] = 0; /* return nothing by default */ - - /* attempt to open the desktop database */ - error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - /* There was a desktop database and it's now open */ - - if ( !newDTDatabase ) - { - pb.ioDTRefNum = dtRefNum; - pb.ioNamePtr = (StringPtr)name; - pb.ioDirID = dirID; - pb.ioDTBuffer = (Ptr)&comment[1]; - /* - ** IMPORTANT NOTE #1: Inside Macintosh says that comments - ** are up to 200 characters. While that may be correct for - ** the HFS file system's Desktop Manager, other file - ** systems (such as Apple Photo Access) return up to - ** 255 characters. Make sure the comment buffer is a Str255 - ** or you'll regret it. - ** - ** IMPORTANT NOTE #2: Although Inside Macintosh doesn't - ** mention it, ioDTReqCount is a input field to - ** PBDTGetCommentSync. Some file systems (like HFS) ignore - ** ioDTReqCount and always return the full comment -- - ** others (like AppleShare) respect ioDTReqCount and only - ** return up to ioDTReqCount characters of the comment. - */ - pb.ioDTReqCount = sizeof(Str255) - 1; - error = PBDTGetCommentSync(&pb); - if (error == noErr) - { - comment[0] = (unsigned char)pb.ioDTActCount; - } - } - } - else - { - /* There is no desktop database - try the Desktop file */ - error = GetCommentFromDesktopFile(vRefNum, dirID, name, comment); - if ( error != noErr ) - { - error = afpItemNotFound; /* return an expected error */ - } - } - } - else - { - error = paramErr; - } - - return (error); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTGetComment(const FSSpec *spec, - Str255 comment) -{ - return (DTGetComment(spec->vRefNum, spec->parID, spec->name, comment)); -} - -/*****************************************************************************/ - -pascal OSErr DTCopyComment(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName) -/* The destination volume must support the Desktop Manager for this to work */ -{ - OSErr error; - Str255 comment; - - error = DTGetComment(srcVRefNum, srcDirID, srcName, comment); - if ( (error == noErr) && (comment[0] > 0) ) - { - error = DTSetComment(dstVRefNum, dstDirID, dstName, comment); - } - return (error); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTCopyComment(const FSSpec *srcSpec, - const FSSpec *dstSpec) -/* The destination volume must support the Desktop Manager for this to work */ -{ - return (DTCopyComment(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name)); -} - -/*****************************************************************************/ diff --git a/src/mac/classic/morefile/MoreDesktopMgr.h b/src/mac/classic/morefile/MoreDesktopMgr.h deleted file mode 100644 index 110c673403..0000000000 --- a/src/mac/classic/morefile/MoreDesktopMgr.h +++ /dev/null @@ -1,628 +0,0 @@ -/* - File: MoreDesktopMgr.h - - Contains: A collection of useful high-level Desktop Manager routines. If the Desktop Manager is not available, use the Desktop file for 'read' operations. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __MOREDESKTOPMGR__ -#define __MOREDESKTOPMGR__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTOpen( - ConstStr255Param volName, - short vRefNum, - short * dtRefNum, - Boolean * newDTDatabase); - - -/* - The DTOpen function opens a volume's desktop database. It returns - the reference number of the desktop database and indicates if the - desktop database was created as a result of this call (if it was created, - then it is empty). - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - dtRefNum output: The reference number of Desktop Manager's - desktop database on the specified volume. - newDTDatabase output: true if the desktop database was created as a - result of this call and thus empty. - false if the desktop database was already created, - or if it could not be determined if it was already - created. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 Volume doesn't support this function - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTXGetAPPL( - ConstStr255Param volName, - short vRefNum, - OSType creator, - Boolean searchCatalog, - short * applVRefNum, - long * applParID, - Str255 applName); - - -/* - The DTXGetAPPL function finds an application (file type 'APPL') with - the specified creator on the specified volume. It first tries to get - the application mapping from the desktop database. If that fails, - then it tries to find an application in the Desktop file. If that - fails and searchCatalog is true, then it tries to find an application - with the specified creator using the File Manager's CatSearch routine. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - creator input: The file's creator type. - searchCatalog input: If true, search the catalog for the application - if it isn't found in the desktop database. - applVRefNum output: The volume reference number of the volume the - application is on. - applParID output: The parent directory ID of the application. - applName output: The name of the application. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 No default volume - rfNumErr -51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: FSpDTGetAPPL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDTXGetAPPL( - ConstStr255Param volName, - short vRefNum, - OSType creator, - Boolean searchCatalog, - FSSpec * spec); - - -/* - The FSpDTXGetAPPL function finds an application (file type 'APPL') with - the specified creator on the specified volume. It first tries to get - the application mapping from the desktop database. If that fails, - then it tries to find an application in the Desktop file. If that - fails and searchCatalog is true, then it tries to find an application - with the specified creator using the File Manager's CatSearch routine. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - creator input: The file's creator type. - searchCatalog input: If true, search the catalog for the application - if it isn't found in the desktop database. - spec output: FSSpec record containing the application name and - location. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 No default volume - rfNumErr -51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: FSpDTGetAPPL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTGetAPPL( - ConstStr255Param volName, - short vRefNum, - OSType creator, - short * applVRefNum, - long * applParID, - Str255 applName); - - -/* - The DTGetAPPL function finds an application (file type 'APPL') with - the specified creator on the specified volume. It first tries to get - the application mapping from the desktop database. If that fails, - then it tries to find an application in the Desktop file. If that - fails, then it tries to find an application with the specified creator - using the File Manager's CatSearch routine. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - creator input: The file's creator type. - applVRefNum output: The volume reference number of the volume the - application is on. - applParID output: The parent directory ID of the application. - applName output: The name of the application. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 No default volume - rfNumErr -51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: FSpDTGetAPPL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDTGetAPPL( - ConstStr255Param volName, - short vRefNum, - OSType creator, - FSSpec * spec); - - -/* - The FSpDTGetAPPL function finds an application (file type 'APPL') with - the specified creator on the specified volume. It first tries to get - the application mapping from the desktop database. If that fails, - then it tries to find an application in the Desktop file. If that - fails, then it tries to find an application with the specified creator - using the File Manager's CatSearch routine. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - creator input: The file's creator type. - spec output: FSSpec record containing the application name and - location. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 No default volume - rfNumErr -51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: DTGetAPPL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTGetIcon( - ConstStr255Param volName, - short vRefNum, - short iconType, - OSType fileCreator, - OSType fileType, - Handle * iconHandle); - - -/* - The DTGetIcon function retrieves the specified icon and returns it in - a newly created handle. The icon is retrieves from the Desktop Manager - or if the Desktop Manager is not available, from the Finder's Desktop - file. Your program is responsible for disposing of the handle when it is - done using the icon. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - iconType input: The icon type as defined in Files.h. Valid values are: - kLargeIcon - kLarge4BitIcon - kLarge8BitIcon - kSmallIcon - kSmall4BitIcon - kSmall8BitIcon - fileCreator input: The icon's creator type. - fileType input: The icon's file type. - iconHandle output: A Handle containing the newly created icon. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - paramErr -50 Volume doesn't support this function - rfNumErr -51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call - memFullErr -108 iconHandle could not be allocated - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTSetComment( - short vRefNum, - long dirID, - ConstStr255Param name, - ConstStr255Param comment); - - -/* - The DTSetComment function sets a file or directory's Finder comment - field. The volume must support the Desktop Manager because you only - have read access to the Desktop file. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - comment input: The comment to add. Comments are limited to 200 characters; - longer comments are truncated. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr Ð43 File or directory doesnÕt exist - paramErr -50 Volume doesn't support this function - wPrErr Ð44 Volume is locked through hardware - vLckdErr Ð46 Volume is locked through software - rfNumErr Ð51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - - __________ - - Also see: DTCopyComment, FSpDTCopyComment, FSpDTSetComment, DTGetComment, - FSpDTGetComment -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDTSetComment( - const FSSpec * spec, - ConstStr255Param comment); - - -/* - The FSpDTSetComment function sets a file or directory's Finder comment - field. The volume must support the Desktop Manager because you only - have read access to the Desktop file. - - spec input: An FSSpec record specifying the file or directory. - comment input: The comment to add. Comments are limited to 200 characters; - longer comments are truncated. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr Ð43 File or directory doesnÕt exist - wPrErr Ð44 Volume is locked through hardware - vLckdErr Ð46 Volume is locked through software - rfNumErr Ð51 Reference number invalid - paramErr -50 Volume doesn't support this function - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - - __________ - - Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, DTGetComment, - FSpDTGetComment -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTGetComment( - short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment); - - -/* - The DTGetComment function gets a file or directory's Finder comment - field (if any) from the Desktop Manager or if the Desktop Manager is - not available, from the Finder's Desktop file. - - IMPORTANT NOTE: Inside Macintosh says that comments are up to - 200 characters. While that may be correct for the HFS file system's - Desktop Manager, other file systems (such as Apple Photo Access) return - up to 255 characters. Make sure the comment buffer is a Str255 or you'll - regret it. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - comment output: A Str255 where the comment is to be returned. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - paramErr -50 Volume doesn't support this function - rfNumErr Ð51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment, - FSpDTGetComment -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDTGetComment( - const FSSpec * spec, - Str255 comment); - - -/* - The FSpDTGetComment function gets a file or directory's Finder comment - field (if any) from the Desktop Manager or if the Desktop Manager is - not available, from the Finder's Desktop file. - - IMPORTANT NOTE: Inside Macintosh says that comments are up to - 200 characters. While that may be correct for the HFS file system's - Desktop Manager, other file systems (such as Apple Photo Access) return - up to 255 characters. Make sure the comment buffer is a Str255 or you'll - regret it. - - spec input: An FSSpec record specifying the file or directory. - comment output: A Str255 where the comment is to be returned. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - paramErr -50 Volume doesn't support this function - rfNumErr Ð51 Reference number invalid - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment, - DTGetComment -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DTCopyComment( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName); - - -/* - The DTCopyComment function copies the file or folder comment from the - source to the destination object. The destination volume must support - the Desktop Manager because you only have read access to the Desktop file. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Pointer to source object name, or nil when srcDirID - specifies a directory that's the object. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Pointer to destination object name, or nil when - dstDirID specifies a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr Ð43 File or directory doesnÕt exist - wPrErr Ð44 Volume is locked through hardware - vLckdErr Ð46 Volume is locked through software - paramErr -50 Volume doesn't support this function - rfNumErr Ð51 Reference number invalid - paramErr -50 Volume doesn't support this function - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: FSpDTCopyComment, DTSetComment, FSpDTSetComment, DTGetComment, - FSpDTGetComment -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpDTCopyComment( - const FSSpec * srcSpec, - const FSSpec * dstSpec); - - -/* - The FSpDTCopyComment function copies the desktop database comment from - the source to the destination object. Both the source and the - destination volumes must support the Desktop Manager. - - srcSpec input: An FSSpec record specifying the source object. - dstSpec input: An FSSpec record specifying the destination object. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr Ð43 File or directory doesnÕt exist - wPrErr Ð44 Volume is locked through hardware - vLckdErr Ð46 Volume is locked through software - paramErr -50 Volume doesn't support this function - rfNumErr Ð51 Reference number invalid - paramErr -50 Volume doesn't support this function - extFSErr -58 External file system error - no file - system claimed this call. - desktopDamagedErr -1305 The desktop database has become corrupted - - the Finder will fix this, but if your - application is not running with the - Finder, use PBDTReset or PBDTDelete - afpItemNotFound -5012 Information not found - - __________ - - Also see: DTCopyComment, DTSetComment, FSpDTSetComment, DTGetComment, - FSpDTGetComment -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __MOREDESKTOPMGR__ */ - diff --git a/src/mac/classic/morefile/MoreFiles.c b/src/mac/classic/morefile/MoreFiles.c deleted file mode 100644 index 8426bdaffe..0000000000 --- a/src/mac/classic/morefile/MoreFiles.c +++ /dev/null @@ -1,643 +0,0 @@ -/* - File: MoreFiles.c - - Contains: The long lost high-level and FSSpec File Manager functions. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreFilesExtras.h" - -/*****************************************************************************/ - -pascal OSErr HGetVolParms(ConstStr255Param volName, - short vRefNum, - GetVolParmsInfoBuffer *volParmsInfo, - long *infoSize) -{ - HParamBlockRec pb; - OSErr error; - - pb.ioParam.ioNamePtr = (StringPtr)volName; - pb.ioParam.ioVRefNum = vRefNum; - pb.ioParam.ioBuffer = (Ptr)volParmsInfo; - pb.ioParam.ioReqCount = *infoSize; - error = PBHGetVolParmsSync(&pb); - if ( error == noErr ) - { - *infoSize = pb.ioParam.ioActCount; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr HCreateMinimum(short vRefNum, - long dirID, - ConstStr255Param fileName) -{ - HParamBlockRec pb; - - pb.fileParam.ioNamePtr = (StringPtr)fileName; - pb.fileParam.ioVRefNum = vRefNum; - pb.ioParam.ioVersNum = 0; - pb.fileParam.ioDirID = dirID; - return ( PBHCreateSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCreateMinimum(const FSSpec *spec) -{ - return ( HCreateMinimum(spec->vRefNum, spec->parID, spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr ExchangeFiles(short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstName) -{ - HParamBlockRec pb; - - pb.fidParam.ioVRefNum = vRefNum; - pb.fidParam.ioSrcDirID = srcDirID; - pb.fidParam.ioNamePtr = (StringPtr)srcName; - pb.fidParam.ioDestDirID = dstDirID; - pb.fidParam.ioDestNamePtr = (StringPtr)dstName; - return ( PBExchangeFilesSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr ResolveFileIDRef(ConstStr255Param volName, - short vRefNum, - long fileID, - long *parID, - StringPtr fileName) -{ - HParamBlockRec pb; - OSErr error; - Str255 tempStr; - - tempStr[0] = 0; - if ( volName != NULL ) - { - BlockMoveData(volName, tempStr, volName[0] + 1); - } - pb.fidParam.ioNamePtr = (StringPtr)tempStr; - pb.fidParam.ioVRefNum = vRefNum; - pb.fidParam.ioFileID = fileID; - error = PBResolveFileIDRefSync(&pb); - if ( error == noErr ) - { - *parID = pb.fidParam.ioSrcDirID; - if ( fileName != NULL ) - { - BlockMoveData(tempStr, fileName, tempStr[0] + 1); - } - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpResolveFileIDRef(ConstStr255Param volName, - short vRefNum, - long fileID, - FSSpec *spec) -{ - OSErr error; - - error = DetermineVRefNum(volName, vRefNum, &(spec->vRefNum)); - if ( error == noErr ) - { - error = ResolveFileIDRef(volName, vRefNum, fileID, &(spec->parID), spec->name); - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr CreateFileIDRef(short vRefNum, - long parID, - ConstStr255Param fileName, - long *fileID) -{ - HParamBlockRec pb; - OSErr error; - - pb.fidParam.ioNamePtr = (StringPtr)fileName; - pb.fidParam.ioVRefNum = vRefNum; - pb.fidParam.ioSrcDirID = parID; - error = PBCreateFileIDRefSync(&pb); - if ( (error == noErr) || (error == fidExists) || (error == afpIDExists) ) - { - *fileID = pb.fidParam.ioFileID; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCreateFileIDRef(const FSSpec *spec, - long *fileID) -{ - return ( CreateFileIDRef(spec->vRefNum, spec->parID, spec->name, fileID) ); -} - -/*****************************************************************************/ - -pascal OSErr DeleteFileIDRef(ConstStr255Param volName, - short vRefNum, - long fileID) -{ - HParamBlockRec pb; - - pb.fidParam.ioNamePtr = (StringPtr)volName; - pb.fidParam.ioVRefNum = vRefNum; - pb.fidParam.ioFileID = fileID; - return ( PBDeleteFileIDRefSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FlushFile(short refNum) -{ - ParamBlockRec pb; - - pb.ioParam.ioRefNum = refNum; - return ( PBFlushFileSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr LockRange(short refNum, - long rangeLength, - long rangeStart) -{ - ParamBlockRec pb; - - pb.ioParam.ioRefNum = refNum; - pb.ioParam.ioReqCount = rangeLength; - pb.ioParam.ioPosMode = fsFromStart; - pb.ioParam.ioPosOffset = rangeStart; - return ( PBLockRangeSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr UnlockRange(short refNum, - long rangeLength, - long rangeStart) -{ - ParamBlockRec pb; - - pb.ioParam.ioRefNum = refNum; - pb.ioParam.ioReqCount = rangeLength; - pb.ioParam.ioPosMode = fsFromStart; - pb.ioParam.ioPosOffset = rangeStart; - return ( PBUnlockRangeSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr GetForeignPrivs(short vRefNum, - long dirID, - ConstStr255Param name, - void *foreignPrivBuffer, - long *foreignPrivSize, - long *foreignPrivInfo1, - long *foreignPrivInfo2, - long *foreignPrivInfo3, - long *foreignPrivInfo4) -{ - HParamBlockRec pb; - OSErr error; - - pb.foreignPrivParam.ioNamePtr = (StringPtr)name; - pb.foreignPrivParam.ioVRefNum = vRefNum; - pb.foreignPrivParam.ioForeignPrivDirID = dirID; - pb.foreignPrivParam.ioForeignPrivBuffer = (Ptr)foreignPrivBuffer; - pb.foreignPrivParam.ioForeignPrivReqCount = *foreignPrivSize; - error = PBGetForeignPrivsSync(&pb); - *foreignPrivSize = pb.foreignPrivParam.ioForeignPrivActCount; - *foreignPrivInfo1 = pb.foreignPrivParam.ioForeignPrivInfo1; - *foreignPrivInfo2 = pb.foreignPrivParam.ioForeignPrivInfo2; - *foreignPrivInfo3 = pb.foreignPrivParam.ioForeignPrivInfo3; - *foreignPrivInfo4 = pb.foreignPrivParam.ioForeignPrivInfo4; - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetForeignPrivs(const FSSpec *spec, - void *foreignPrivBuffer, - long *foreignPrivSize, - long *foreignPrivInfo1, - long *foreignPrivInfo2, - long *foreignPrivInfo3, - long *foreignPrivInfo4) -{ - return ( GetForeignPrivs(spec->vRefNum, spec->parID, spec->name, - foreignPrivBuffer, foreignPrivSize, - foreignPrivInfo1, foreignPrivInfo2, - foreignPrivInfo3, foreignPrivInfo4) ); -} - -/*****************************************************************************/ - -pascal OSErr SetForeignPrivs(short vRefNum, - long dirID, - ConstStr255Param name, - const void *foreignPrivBuffer, - long *foreignPrivSize, - long foreignPrivInfo1, - long foreignPrivInfo2, - long foreignPrivInfo3, - long foreignPrivInfo4) -{ - HParamBlockRec pb; - OSErr error; - - pb.foreignPrivParam.ioNamePtr = (StringPtr)name; - pb.foreignPrivParam.ioVRefNum = vRefNum; - pb.foreignPrivParam.ioForeignPrivDirID = dirID; - pb.foreignPrivParam.ioForeignPrivBuffer = (Ptr)foreignPrivBuffer; - pb.foreignPrivParam.ioForeignPrivReqCount = *foreignPrivSize; - pb.foreignPrivParam.ioForeignPrivInfo1 = foreignPrivInfo1; - pb.foreignPrivParam.ioForeignPrivInfo2 = foreignPrivInfo2; - pb.foreignPrivParam.ioForeignPrivInfo3 = foreignPrivInfo3; - pb.foreignPrivParam.ioForeignPrivInfo4 = foreignPrivInfo4; - error = PBSetForeignPrivsSync(&pb); - if ( error == noErr ) - { - *foreignPrivSize = pb.foreignPrivParam.ioForeignPrivActCount; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetForeignPrivs(const FSSpec *spec, - const void *foreignPrivBuffer, - long *foreignPrivSize, - long foreignPrivInfo1, - long foreignPrivInfo2, - long foreignPrivInfo3, - long foreignPrivInfo4) -{ - return ( SetForeignPrivs(spec->vRefNum, spec->parID, spec->name, - foreignPrivBuffer, foreignPrivSize, - foreignPrivInfo1, foreignPrivInfo2, - foreignPrivInfo3, foreignPrivInfo4) ); -} - -/*****************************************************************************/ - -pascal OSErr HGetLogInInfo(ConstStr255Param volName, - short vRefNum, - short *loginMethod, - StringPtr userName) -{ - HParamBlockRec pb; - OSErr error; - - pb.objParam.ioNamePtr = (StringPtr)volName; - pb.objParam.ioVRefNum = vRefNum; - pb.objParam.ioObjNamePtr = userName; - error = PBHGetLogInInfoSync(&pb); - if ( error == noErr ) - { - *loginMethod = pb.objParam.ioObjType; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr HGetDirAccess(short vRefNum, - long dirID, - ConstStr255Param name, - long *ownerID, - long *groupID, - long *accessRights) -{ - HParamBlockRec pb; - OSErr error; - - pb.accessParam.ioNamePtr = (StringPtr)name; - pb.accessParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - error = PBHGetDirAccessSync(&pb); - if ( error == noErr ) - { - *ownerID = pb.accessParam.ioACOwnerID; - *groupID = pb.accessParam.ioACGroupID; - *accessRights = pb.accessParam.ioACAccess; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetDirAccess(const FSSpec *spec, - long *ownerID, - long *groupID, - long *accessRights) -{ - return ( HGetDirAccess(spec->vRefNum, spec->parID, spec->name, - ownerID, groupID, accessRights) ); -} - -/*****************************************************************************/ - -pascal OSErr HSetDirAccess(short vRefNum, - long dirID, - ConstStr255Param name, - long ownerID, - long groupID, - long accessRights) -{ - HParamBlockRec pb; - - pb.accessParam.ioNamePtr = (StringPtr)name; - pb.accessParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - pb.accessParam.ioACOwnerID = ownerID; - pb.accessParam.ioACGroupID = groupID; - pb.accessParam.ioACAccess = accessRights; - return ( PBHSetDirAccessSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetDirAccess(const FSSpec *spec, - long ownerID, - long groupID, - long accessRights) -{ - return ( HSetDirAccess(spec->vRefNum, spec->parID, spec->name, - ownerID, groupID, accessRights) ); -} - -/*****************************************************************************/ - -pascal OSErr HMapID(ConstStr255Param volName, - short vRefNum, - long ugID, - short objType, - StringPtr name) -{ - HParamBlockRec pb; - - pb.objParam.ioNamePtr = (StringPtr)volName; - pb.objParam.ioVRefNum = vRefNum; - pb.objParam.ioObjType = objType; - pb.objParam.ioObjNamePtr = name; - pb.objParam.ioObjID = ugID; - return ( PBHMapIDSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr HMapName(ConstStr255Param volName, - short vRefNum, - ConstStr255Param name, - short objType, - long *ugID) -{ - HParamBlockRec pb; - OSErr error; - - pb.objParam.ioNamePtr = (StringPtr)volName; - pb.objParam.ioVRefNum = vRefNum; - pb.objParam.ioObjType = objType; - pb.objParam.ioObjNamePtr = (StringPtr)name; - error = PBHMapNameSync(&pb); - if ( error == noErr ) - { - *ugID = pb.objParam.ioObjID; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr HCopyFile(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstPathname, - ConstStr255Param copyName) -{ - HParamBlockRec pb; - - pb.copyParam.ioVRefNum = srcVRefNum; - pb.copyParam.ioDirID = srcDirID; - pb.copyParam.ioNamePtr = (StringPtr)srcName; - pb.copyParam.ioDstVRefNum = dstVRefNum; - pb.copyParam.ioNewDirID = dstDirID; - pb.copyParam.ioNewName = (StringPtr)dstPathname; - pb.copyParam.ioCopyName = (StringPtr)copyName; - return ( PBHCopyFileSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCopyFile(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName) -{ - return ( HCopyFile(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, - dstSpec->name, copyName) ); -} - -/*****************************************************************************/ - -pascal OSErr HMoveRename(short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstpathName, - ConstStr255Param copyName) -{ - HParamBlockRec pb; - - pb.copyParam.ioVRefNum = vRefNum; - pb.copyParam.ioDirID = srcDirID; - pb.copyParam.ioNamePtr = (StringPtr)srcName; - pb.copyParam.ioNewDirID = dstDirID; - pb.copyParam.ioNewName = (StringPtr)dstpathName; - pb.copyParam.ioCopyName = (StringPtr)copyName; - return ( PBHMoveRenameSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpMoveRename(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName) -{ - OSErr error; - - /* make sure the FSSpecs refer to the same volume */ - if ( srcSpec->vRefNum != dstSpec->vRefNum ) - { - error = diffVolErr; - } - else - { - error = HMoveRename(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->parID, dstSpec->name, copyName); - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetVolMountInfoSize(ConstStr255Param volName, - short vRefNum, - short *size) -{ - ParamBlockRec pb; - - pb.ioParam.ioNamePtr = (StringPtr)volName; - pb.ioParam.ioVRefNum = vRefNum; - pb.ioParam.ioBuffer = (Ptr)size; - return ( PBGetVolMountInfoSize(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr GetVolMountInfo(ConstStr255Param volName, - short vRefNum, - void *volMountInfo) -{ - ParamBlockRec pb; - - pb.ioParam.ioNamePtr = (StringPtr)volName; - pb.ioParam.ioVRefNum = vRefNum; - pb.ioParam.ioBuffer = (Ptr)volMountInfo; - return ( PBGetVolMountInfo(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr VolumeMount(const void *volMountInfo, - short *vRefNum) -{ - ParamBlockRec pb; - OSErr error; - - pb.ioParam.ioBuffer = (Ptr)volMountInfo; - error = PBVolumeMount(&pb); - if ( error == noErr ) - { - *vRefNum = pb.ioParam.ioVRefNum; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr Share(short vRefNum, - long dirID, - ConstStr255Param name) -{ - HParamBlockRec pb; - - pb.fileParam.ioNamePtr = (StringPtr)name; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - return ( PBShareSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpShare(const FSSpec *spec) -{ - return ( Share(spec->vRefNum, spec->parID, spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr Unshare(short vRefNum, - long dirID, - ConstStr255Param name) -{ - HParamBlockRec pb; - - pb.fileParam.ioNamePtr = (StringPtr)name; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - return ( PBUnshareSync(&pb) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpUnshare(const FSSpec *spec) -{ - return ( Unshare(spec->vRefNum, spec->parID, spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr GetUGEntry(short objType, - StringPtr objName, - long *objID) -{ - HParamBlockRec pb; - OSErr error; - - pb.objParam.ioObjType = objType; - pb.objParam.ioObjNamePtr = objName; - pb.objParam.ioObjID = *objID; - error = PBGetUGEntrySync(&pb); - if ( error == noErr ) - { - *objID = pb.objParam.ioObjID; - } - return ( error ); -} - -/*****************************************************************************/ diff --git a/src/mac/classic/morefile/MoreFiles.h b/src/mac/classic/morefile/MoreFiles.h deleted file mode 100644 index 25b1fcf13e..0000000000 --- a/src/mac/classic/morefile/MoreFiles.h +++ /dev/null @@ -1,1420 +0,0 @@ -/* - File: MoreFiles.h - - Contains: The long lost high-level and FSSpec File Manager functions. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __MOREFILES__ -#define __MOREFILES__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HGetVolParms( - ConstStr255Param volName, - short vRefNum, - GetVolParmsInfoBuffer * volParmsInfo, - long * infoSize); - - -/* - The HGetVolParms function returns information about the characteristics - of a volume. A result of paramErr usually just means the volume doesn't - support PBHGetVolParms and the feature you were going to check - for isn't available. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - volParmsInfo input: Pointer to GetVolParmsInfoBuffer where the - volume attributes information is returned. - output: Atributes information. - infoSize input: Size of buffer pointed to by volParmsInfo. - output: Size of data actually returned. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Volume doesn't support this function - - __________ - - Also see the macros for checking attribute bits in MoreFilesExtras.h -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HCreateMinimum( - short vRefNum, - long dirID, - ConstStr255Param fileName); - - -/* - The HCreateMinimum function creates a new file without attempting to set - the creator and file type of the new file. This function is needed to - create a file in an AppleShare "drop box" where the user can make - changes, but cannot see folder or files. - - vRefNum input: Volume specification. - dirID input: Directory ID. - fileName input: The name of the new file. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 Directory not found or incomplete pathname - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 A directory exists with that name - - __________ - - Also see: FSpCreateMinimum -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCreateMinimum(const FSSpec * spec); - - -/* - The FSpCreateMinimum function creates a new file without attempting to set - the the creator and file type of the new file. This function is needed to - create a file in an AppleShare "dropbox" where the user can make - changes, but cannot see folder or files. - - spec input: An FSSpec record specifying the file to create. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 Directory not found or incomplete pathname - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - dupFNErr -48 Duplicate filename and version - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 A directory exists with that name - - __________ - - Also see: HCreateMinimum -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ExchangeFiles( - short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstName); - - -/* - The ExchangeFiles function swaps the data in two files on the same - volume by changing some of the information in the volume catalog and, - if the files are open, in the file control blocks. - - vRefNum input: Volume specification. - srcDirID input: Source directory ID. - srcName input: Source file name. - dstDirID input: Destination directory ID. - dstName input: Destination file name. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - wrgVolTypErr -123 Not an HFS volume - diffVolErr -1303 Files on different volumes - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Object is a directory, not a file - afpSameObjectErr -5038 Source and destination are the same - - __________ - - Also see: FSpExchangeFilesCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ResolveFileIDRef( - ConstStr255Param volName, - short vRefNum, - long fileID, - long * parID, - StringPtr fileName); - - -/* - The ResolveFileIDRef function returns the filename and parent directory ID - of the file with the specified file ID reference. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - fileID input: The file ID reference. - parID output: The parent directory ID of the file. - name input: Points to a buffer (minimum Str63) where the filename - is to be returned or must be nil. - output: The filename. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - extFSErr -58 External file system error - no file - system claimed this call. - wrgVolTypErr -123 Not an HFS volume - fidNotFoundErr -1300 File ID reference not found - notAFileErr -1302 Specified file is a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Specified file is a directory - afpIDNotFound -5034 File ID reference not found - afpBadIDErr -5039 File ID reference not found - - __________ - - Also see: FSpResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef, - DeleteFileIDRef -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpResolveFileIDRef( - ConstStr255Param volName, - short vRefNum, - long fileID, - FSSpecPtr spec); - - -/* - The FSpResolveFileIDRef function fills in an FSSpec with the location - of the file with the specified file ID reference. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - fileID input: The file ID reference. - spec input: A pointer to a FSSpec record. - output: A file system specification to be filled in by - FSpResolveFileIDRef. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - paramErr -50 Function not supported by volume or - no default volume - volOfflinErr -53 Volume is offline - extFSErr -58 External file system error - no file - system claimed this call. - wrgVolTypErr -123 Not an HFS volume - fidNotFoundErr -1300 File ID reference not found - notAFileErr -1302 Specified file is a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Specified file is a directory - afpIDNotFound -5034 File ID reference not found - afpBadIDErr -5039 File ID reference not found - - __________ - - Also see: ResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef, - DeleteFileIDRef -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CreateFileIDRef( - short vRefNum, - long parID, - ConstStr255Param fileName, - long * fileID); - - -/* - The CreateFileIDRef function creates a file ID reference for the - specified file, or if a file ID reference already exists, supplies - the file ID reference and returns the result code fidExists or afpIDExists. - - vRefNum input: Volume specification. - parID input: Directory ID. - fileName input: The name of the file. - fileID output: The file ID reference (if result is noErr, - fidExists, or afpIDExists). - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - extFSErr -58 External file system error - no file - system claimed this call. - wrgVolTypErr -123 Not an HFS volume - fidExists -1301 File ID reference already exists - notAFileErrn -1302 Specified file is a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Specified file is a directory - afpIDExists -5035 File ID reference already exists - - __________ - - Also see: FSpResolveFileIDRef, ResolveFileIDRef, FSpCreateFileIDRef, - DeleteFileIDRef -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCreateFileIDRef( - const FSSpec * spec, - long * fileID); - - -/* - The FSpCreateFileIDRef function creates a file ID reference for the - specified file, or if a file ID reference already exists, supplies - the file ID reference and returns the result code fidExists or afpIDExists. - - spec input: An FSSpec record specifying the file. - fileID output: The file ID reference (if result is noErr, - fidExists, or afpIDExists). - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - extFSErr -58 External file system error - no file - system claimed this call. - wrgVolTypErr -123 Not an HFS volume - fidExists -1301 File ID reference already exists - notAFileErrn -1302 Specified file is a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Specified file is a directory - afpIDExists -5035 File ID reference already exists - - __________ - - Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef, - DeleteFileIDRef -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DeleteFileIDRef( - ConstStr255Param volName, - short vRefNum, - long fileID); - - -/* - The DeleteFileIDRef function deletes a file ID reference. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - fileID input: The file ID reference. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - vLckdErr -46 Software volume lock - paramErr -50 Function not supported by volume - volOfflinErr -53 Volume is offline - extFSErr -58 External file system error - no file - system claimed this call. - wrgVolTypErr -123 Function is not supported by volume - fidNotFoundErr -1300 File ID reference not found - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Specified file is a directory - afpIDNotFound -5034 File ID reference not found - - __________ - - Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef, - FSpCreateFileIDRef -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FlushFile(short refNum); - - -/* - The FlushFile function writes the contents of a file's access path - buffer (the fork data) to the volume. Note: some of the file's catalog - information stored on the volume may not be correct until FlushVol - is called. - - refNum input: The file reference number of an open file. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - fnOpnErr -38 File not open - fnfErr -43 File not found - rfNumErr -51 Bad reference number - extFSErr -58 External file system error - no file - system claimed this call. -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -LockRange( - short refNum, - long rangeLength, - long rangeStart); - - -/* - The LockRange function locks (denies access to) a portion of a file - that was opened with shared read/write permission. - - refNum input: The file reference number of an open file. - rangeLength input: The number of bytes in the range. - rangeStart input: The starting byte in the range to lock. - - Result Codes - noErr 0 No error - ioErr -36 I/O error - fnOpnErr -38 File not open - eofErr -39 Logical end-of-file reached - fLckdErr -45 File is locked by another user - paramErr -50 Negative ioReqCount - rfNumErr -51 Bad reference number - extFSErr -58 External file system error - no file - system claimed this call. - volGoneErr -124 Server volume has been disconnected - afpNoMoreLocks -5015 No more ranges can be locked - afpRangeOverlap -5021 Part of range is already locked - - __________ - - Also see: UnlockRange -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -UnlockRange( - short refNum, - long rangeLength, - long rangeStart); - - -/* - The UnlockRange function unlocks (allows access to) a previously locked - portion of a file that was opened with shared read/write permission. - - refNum input: The file reference number of an open file. - rangeLength input: The number of bytes in the range. - rangeStart input: The starting byte in the range to unlock. - - Result Codes - noErr 0 No error - ioErr -36 I/O error - fnOpnErr -38 File not open - eofErr -39 Logical end-of-file reached - paramErr -50 Negative ioReqCount - rfNumErr -51 Bad reference number - extFSErr -58 External file system error - no file - system claimed this call. - volGoneErr -124 Server volume has been disconnected - afpRangeNotLocked -5020 Specified range was not locked - - __________ - - Also see: LockRange -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetForeignPrivs( - short vRefNum, - long dirID, - ConstStr255Param name, - void * foreignPrivBuffer, - long * foreignPrivSize, - long * foreignPrivInfo1, - long * foreignPrivInfo2, - long * foreignPrivInfo3, - long * foreignPrivInfo4); - - -/* - The GetForeignPrivs function retrieves the native access-control - information for a file or directory stored on a volume managed by - a foreign file system. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - foreignPrivBuffer input: Pointer to buffer where the privilege - information is returned. - output: Privilege information. - foreignPrivSize input: Size of buffer pointed to by - foreignPrivBuffer. - output: Amount of buffer actually used. - foreignPrivInfo1 output: Information specific to privilege model. - foreignPrivInfo2 output: Information specific to privilege model. - foreignPrivInfo3 output: Information specific to privilege model. - foreignPrivInfo4 output: Information specific to privilege model. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Volume is HFS or MFS (that is, it has - no foreign privilege model), or foreign - volume does not support these calls - - __________ - - Also see: FSpGetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetForeignPrivs( - const FSSpec * spec, - void * foreignPrivBuffer, - long * foreignPrivSize, - long * foreignPrivInfo1, - long * foreignPrivInfo2, - long * foreignPrivInfo3, - long * foreignPrivInfo4); - - -/* - The FSpGetForeignPrivs function retrieves the native access-control - information for a file or directory stored on a volume managed by - a foreign file system. - - spec input: An FSSpec record specifying the object. - foreignPrivBuffer input: Pointer to buffer where the privilege - information is returned. - output: Privilege information. - foreignPrivSize input: Size of buffer pointed to by - foreignPrivBuffer. - output: Amount of buffer actually used. - foreignPrivInfo1 output: Information specific to privilege model. - foreignPrivInfo2 output: Information specific to privilege model. - foreignPrivInfo3 output: Information specific to privilege model. - foreignPrivInfo4 output: Information specific to privilege model. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Volume is HFS or MFS (that is, it has - no foreign privilege model), or foreign - volume does not support these calls - - __________ - - Also see: GetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetForeignPrivs( - short vRefNum, - long dirID, - ConstStr255Param name, - const void * foreignPrivBuffer, - long * foreignPrivSize, - long foreignPrivInfo1, - long foreignPrivInfo2, - long foreignPrivInfo3, - long foreignPrivInfo4); - - -/* - The SetForeignPrivs function changes the native access-control - information for a file or directory stored on a volume managed by - a foreign file system. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - foreignPrivBuffer input: Pointer to privilege information buffer. - foreignPrivSize input: Size of buffer pointed to by - foreignPrivBuffer. - output: Amount of buffer actually used. - foreignPrivInfo1 input: Information specific to privilege model. - foreignPrivInfo2 input: Information specific to privilege model. - foreignPrivInfo3 input: Information specific to privilege model. - foreignPrivInfo4 input: Information specific to privilege model. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Volume is HFS or MFS (that is, it has - no foreign privilege model), or foreign - volume does not support these calls - - __________ - - Also see: GetForeignPrivs, FSpGetForeignPrivs, FSpSetForeignPrivs -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetForeignPrivs( - const FSSpec * spec, - const void * foreignPrivBuffer, - long * foreignPrivSize, - long foreignPrivInfo1, - long foreignPrivInfo2, - long foreignPrivInfo3, - long foreignPrivInfo4); - - -/* - The FSpSetForeignPrivs function changes the native access-control - information for a file or directory stored on a volume managed by - a foreign file system. - - spec input: An FSSpec record specifying the object. - foreignPrivBuffer input: Pointer to privilege information buffer. - foreignPrivSize input: Size of buffer pointed to by - foreignPrivBuffer. - output: Amount of buffer actually used. - foreignPrivInfo1 input: Information specific to privilege model. - foreignPrivInfo2 input: Information specific to privilege model. - foreignPrivInfo3 input: Information specific to privilege model. - foreignPrivInfo4 input: Information specific to privilege model. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Volume is HFS or MFS (that is, it has - no foreign privilege model), or foreign - volume does not support these calls - - __________ - - Also see: GetForeignPrivs, FSpGetForeignPrivs, SetForeignPrivs -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HGetLogInInfo( - ConstStr255Param volName, - short vRefNum, - short * loginMethod, - StringPtr userName); - - -/* - The HGetLogInInfo function retrieves the login method and user name - used to log on to a particular shared volume. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: The volume reference number. - loginMethod output: The login method used (kNoUserAuthentication, - kPassword, kEncryptPassword, or - kTwoWayEncryptPassword). - userName input: Points to a buffer (minimum Str31) where the user - name is to be returned or must be nil. - output: The user name. - - Result Codes - noErr 0 No error - nsvErr -35 Specified volume doesnÕt exist - paramErr -50 Function not supported by volume - - __________ - - Also see: HGetDirAccess, FSpGetDirAccess, HSetDirAccess, - FSpSetDirAccess, HMapName, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HGetDirAccess( - short vRefNum, - long dirID, - ConstStr255Param name, - long * ownerID, - long * groupID, - long * accessRights); - - -/* - The HGetDirAccess function retrieves the directory access control - information for a directory on a shared volume. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil if dirID - specifies the directory. - ownerID output: The directory's owner ID. - groupID output: The directory's group ID or - 0 if no group affiliation. - accessRights output: The directory's access rights. - - Result Codes - noErr 0 No error - fnfErr -43 Directory not found - paramErr -50 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - to the directory - - __________ - - Also see: HGetLogInInfo, FSpGetDirAccess, HSetDirAccess, - FSpSetDirAccess, HMapName, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetDirAccess( - const FSSpec * spec, - long * ownerID, - long * groupID, - long * accessRights); - - -/* - The FSpGetDirAccess function retrieves the directory access control - information for a directory on a shared volume. - - spec input: An FSSpec record specifying the directory. - ownerID output: The directory's owner ID. - groupID output: The directory's group ID or - 0 if no group affiliation. - accessRights output: The directory's access rights. - - Result Codes - noErr 0 No error - fnfErr -43 Directory not found - paramErr -50 Function not supported by volume - afpAccessDenied -5000 User does not have the correct access - to the directory - - __________ - - Also see: HGetLogInInfo, HGetDirAccess, HSetDirAccess, - FSpSetDirAccess, HMapName, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HSetDirAccess( - short vRefNum, - long dirID, - ConstStr255Param name, - long ownerID, - long groupID, - long accessRights); - - -/* - The HSetDirAccess function changes the directory access control - information for a directory on a shared volume. You must own a directory - to change its access control information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil if dirID - specifies the directory. - ownerID input: The directory's owner ID. - groupID input: The directory's group ID or - 0 if no group affiliation. - accessRights input: The directory's access rights. - - Result Codes - noErr 0 No error - fnfErr -43 Directory not found - vLckdErr -46 Volume is locked or read-only - paramErr -50 Parameter error - afpAccessDenied -5000 User does not have the correct access - to the directory - afpObjectTypeErr -5025 Object is a file, not a directory - - __________ - - Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, - FSpSetDirAccess, HMapName, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetDirAccess( - const FSSpec * spec, - long ownerID, - long groupID, - long accessRights); - - -/* - The FSpSetDirAccess function changes the directory access control - information for a directory on a shared volume. You must own a directory - to change its access control information. - - spec input: An FSSpec record specifying the directory. - ownerID input: The directory's owner ID. - groupID input: The directory's group ID or - 0 if no group affiliation. - accessRights input: The directory's access rights. - - Result Codes - noErr 0 No error - fnfErr -43 Directory not found - vLckdErr -46 Volume is locked or read-only - paramErr -50 Parameter error - afpAccessDenied -5000 User does not have the correct access - to the directory - afpObjectTypeErr -5025 Object is a file, not a directory - - __________ - - Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess, - HMapName, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HMapID( - ConstStr255Param volName, - short vRefNum, - long ugID, - short objType, - StringPtr name); - - -/* - The HMapID function determines the name of a user or group if you know - the user or group ID. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - objType input: The mapping function code: 1 if you're mapping a - user ID to a user name or 2 if you're mapping a - group ID to a group name. - name input: Points to a buffer (minimum Str31) where the user - or group name is to be returned or must be nil. - output: The user or group name. - - Result Codes - noErr 0 No error - fnfErr -43 Unrecognizable owner or group name - paramErr -50 Function not supported by volume - - __________ - - Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess, - FSpSetDirAccess, HMapName -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HMapName( - ConstStr255Param volName, - short vRefNum, - ConstStr255Param name, - short objType, - long * ugID); - - -/* - The HMapName function determines the user or group ID if you know the - user or group name. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - name input: The user or group name. - objType input: The mapping function code: 3 if you're mapping a - user name to a user ID or 4 if you're mapping a - group name to a group ID. - ugID output: The user or group ID. - - Result Codes - noErr 0 No error - fnfErr -43 Unrecognizable owner or group name - paramErr -50 Function not supported by volume - - __________ - - Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess, - FSpSetDirAccess, HMapID -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HCopyFile( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstPathname, - ConstStr255Param copyName); - - -/* - The HCopyFile function duplicates a file and optionally renames it. - The source and destination volumes must be on the same file server. - This function instructs the server to copy the file. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Source file name. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstPathname input: Pointer to destination directory name, or - nil when dstDirID specifies a directory. - copyName input: Points to the new file name if the file is to be - renamed or nil if the file isn't to be renamed. - - Result Codes - noErr 0 No error - dskFulErr -34 Destination volume is full - fnfErr -43 Source file not found, or destination - directory does not exist - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - paramErr -50 Function not supported by volume - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 The user does not have the right to - read the source or write to the - destination - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory - - __________ - - Also see: FSpCopyFile, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCopyFile( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName); - - -/* - The FSpCopyFile function duplicates a file and optionally renames it. - The source and destination volumes must be on the same file server. - This function instructs the server to copy the file. - - srcSpec input: An FSSpec record specifying the source file. - dstSpec input: An FSSpec record specifying the destination - directory. - copyName input: Points to the new file name if the file is to be - renamed or nil if the file isn't to be renamed. - - Result Codes - noErr 0 No error - dskFulErr -34 Destination volume is full - fnfErr -43 Source file not found, or destination - directory does not exist - vLckdErr -46 Destination volume is read-only - fBsyErr -47 The source or destination file could - not be opened with the correct access - modes - dupFNErr -48 Destination file already exists - paramErr -50 Function not supported by volume - wrgVolTypErr -123 Function not supported by volume - afpAccessDenied -5000 The user does not have the right to - read the source or write to the - destination - afpDenyConflict -5006 The source or destination file could - not be opened with the correct access - modes - afpObjectTypeErr -5025 Source is a directory - - __________ - - Also see: HCopyFile, FileCopy, FSpFileCopy -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HMoveRename( - short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstpathName, - ConstStr255Param copyName); - - -/* - The HMoveRename function moves a file or directory and optionally - renames it. The source and destination locations must be on the same - shared volume. - - vRefNum input: Volume specification. - srcDirID input: Source directory ID. - srcName input: The source object name. - dstDirID input: Destination directory ID. - dstName input: Pointer to destination directory name, or - nil when dstDirID specifies a directory. - copyName input: Points to the new name if the object is to be - renamed or nil if the object isn't to be renamed. - - Result Codes - noErr 0 No error - fnfErr -43 Source file or directory not found - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - dupFNErr -48 Destination already exists - paramErr -50 Function not supported by volume - badMovErr -122 Attempted to move directory into - offspring - afpAccessDenied -5000 The user does not have the right to - move the file or directory - - __________ - - Also see: FSpMoveRename, HMoveRenameCompat, FSpMoveRenameCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpMoveRename( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName); - - -/* - The FSpMoveRename function moves a file or directory and optionally - renames it. The source and destination locations must be on the same - shared volume. - - srcSpec input: An FSSpec record specifying the source object. - dstSpec input: An FSSpec record specifying the destination - directory. - copyName input: Points to the new name if the object is to be - renamed or nil if the object isn't to be renamed. - - Result Codes - noErr 0 No error - fnfErr -43 Source file or directory not found - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - dupFNErr -48 Destination already exists - paramErr -50 Function not supported by volume - badMovErr -122 Attempted to move directory into - offspring - afpAccessDenied -5000 The user does not have the right to - move the file or directory - - __________ - - Also see: HMoveRename, HMoveRenameCompat, FSpMoveRenameCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetVolMountInfoSize( - ConstStr255Param volName, - short vRefNum, - short * size); - - -/* - The GetVolMountInfoSize function determines the how much space the - program needs to allocate for a volume mounting information record. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - size output: The space needed (in bytes) of the volume mounting - information record. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Parameter error - extFSErr -58 External file system error - no file - system claimed this call. - - __________ - - Also see: GetVolMountInfo, VolumeMount BuildAFPVolMountInfo, - RetrieveAFPVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetVolMountInfo( - ConstStr255Param volName, - short vRefNum, - void * volMountInfo); - - -/* - The GetVolMountInfo function retrieves a volume mounting information - record containing all the information needed to mount the volume, - except for passwords. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - volMountInfo output: Points to a volume mounting information - record where the mounting information is to - be returned. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - paramErr -50 Parameter error - extFSErr -58 External file system error - no file - system claimed this call. - - __________ - - Also see: GetVolMountInfoSize, VolumeMount, BuildAFPVolMountInfo, - RetrieveAFPVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -VolumeMount( - const void * volMountInfo, - short * vRefNum); - - -/* - The VolumeMount function mounts a volume using a volume mounting - information record. - - volMountInfo input: Points to a volume mounting information record. - vRefNum output: A volume reference number. - - Result Codes - noErr 0 No error - notOpenErr -28 AppleTalk is not open - nsvErr -35 Volume not found - paramErr -50 Parameter error; typically, zone, server, - and volume name combination is not valid - or not complete, or the user name is not - recognized - extFSErr -58 External file system error - no file - system claimed this call. - memFullErr -108 Not enough memory to create a new volume - control block for mounting the volume - afpBadUAM -5002 User authentication method is unknown - afpBadVersNum -5003 Workstation is using an AFP version that - the server doesnÕt recognize - afpNoServer -5016 Server is not responding - afpUserNotAuth -5023 User authentication failed (usually, - password is not correct) - afpPwdExpired -5042 Password has expired on server - afpBadDirIDType -5060 Not a fixed directory ID volume - afpCantMountMoreSrvrs -5061 Maximum number of volumes has been - mounted - afpAlreadyMounted -5062 Volume already mounted - afpSameNodeErr -5063 Attempt to log on to a server running - on the same machine - - __________ - - Also see: GetVolMountInfoSize, GetVolMountInfo, BuildAFPVolMountInfo, - RetrieveAFPVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -Share( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The Share function establishes a local volume or directory as a - share point. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil if dirID - specifies the directory. - - Result Codes - noErr 0 No error - tmfoErr -42 Too many share points - fnfErr -43 File not found - dupFNErr -48 Already a share point with this name - paramErr -50 Function not supported by volume - dirNFErrdirNFErr -120 Directory not found - afpAccessDenied -5000 This directory cannot be shared - afpObjectTypeErr -5025 Object was a file, not a directory - afpContainsSharedErr -5033 The directory contains a share point - afpInsideSharedErr -5043 The directory is inside a shared directory - - __________ - - Also see: FSpShare, Unshare, FSpUnshare -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpShare(const FSSpec * spec); - - -/* - The FSpShare function establishes a local volume or directory as a - share point. - - spec input: An FSSpec record specifying the share point. - - Result Codes - noErr 0 No error - tmfoErr -42 Too many share points - fnfErr -43 File not found - dupFNErr -48 Already a share point with this name - paramErr -50 Function not supported by volume - dirNFErrdirNFErr -120 Directory not found - afpAccessDenied -5000 This directory cannot be shared - afpObjectTypeErr -5025 Object was a file, not a directory - afpContainsSharedErr -5033 The directory contains a share point - afpInsideSharedErr -5043 The directory is inside a shared directory - - __________ - - Also see: Share, Unshare, FSpUnshare -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -Unshare( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The Unshare function removes a share point. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil if dirID - specifies the directory. - - Result Codes - noErr 0 No error - fnfErr -43 File not found - paramErr -50 Function not supported by volume - dirNFErrdirNFErr -120 Directory not found - afpObjectTypeErr -5025 Object was a file, not a directory; or, - this directory is not a share point - - __________ - - Also see: Share, FSpShare, FSpUnshare -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpUnshare(const FSSpec * spec); - - -/* - The FSpUnshare function removes a share point. - - spec input: An FSSpec record specifying the share point. - - Result Codes - noErr 0 No error - fnfErr -43 File not found - paramErr -50 Function not supported by volume - dirNFErrdirNFErr -120 Directory not found - afpObjectTypeErr -5025 Object was a file, not a directory; or, - this directory is not a share point - - __________ - - Also see: Share, FSpShare, Unshare -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetUGEntry( - short objType, - StringPtr objName, - long * objID); - - -/* - The GetUGEntry function retrieves user or group entries from the - local file server. - - objType input: The object type: -1 = group; 0 = user - objName input: Points to a buffer (minimum Str31) where the user - or group name is to be returned or must be nil. - output: The user or group name. - objID input: O to get the first user or group. If the entry objID - last returned by GetUGEntry is passed, then user or - group whose alphabetically next in the list of entries - is returned. - output: The user or group ID. - - Result Codes - noErr 0 No error - fnfErr -43 No more users or groups - paramErr -50 Function not supported; or, ioObjID is - negative - - __________ - - Also see: GetUGEntries -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __MOREFILES__ */ - diff --git a/src/mac/classic/morefile/MoreFilesExtras.c b/src/mac/classic/morefile/MoreFilesExtras.c deleted file mode 100644 index 9788e746da..0000000000 --- a/src/mac/classic/morefile/MoreFilesExtras.c +++ /dev/null @@ -1,3632 +0,0 @@ -/* - File: MoreFilesExtras.c - - Contains: A collection of useful high-level File Manager routines - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Jim Luther - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL [2500429] Changed null output parameters to real variables when - calling GetSharedLibrary to prevent crashes with older versions - of CFM. Added standard header. Updated names of includes. Added - C function implementations of accessors that used to be macros - since the generated Pascal headers no longer contain - implementations. Updated various other routines to use new - calling convention of the accessor functions. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#if !TARGET_CARBON -#include -#include -#include -#else -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreDesktopMgr.h" -#include "FSpCompat.h" - -#include "MoreFilesExtras.h" - -/*****************************************************************************/ - -/* Functions to get information out of GetVolParmsInfoBuffer. */ - -/* version 1 field getters */ - -pascal short GetVolParmsInfoVersion(const GetVolParmsInfoBuffer *volParms) -{ - return ( volParms->vMVersion ); -} - -pascal long GetVolParmsInfoAttrib(const GetVolParmsInfoBuffer *volParms) -{ - return ( volParms->vMAttrib ); -} - -pascal Handle GetVolParmsInfoLocalHand(const GetVolParmsInfoBuffer *volParms) -{ - return ( volParms->vMLocalHand ); -} - -pascal long GetVolParmsInfoServerAdr(const GetVolParmsInfoBuffer *volParms) -{ - return ( volParms->vMServerAdr ); -} - -/* version 2 field getters (assume zero result if version < 2) */ - -pascal long GetVolParmsInfoVolumeGrade(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMVersion >= 2) ? volParms->vMVolumeGrade : 0 ); -} - -pascal long GetVolParmsInfoForeignPrivID(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMVersion >= 2) ? volParms->vMForeignPrivID : 0 ); -} - -/* version 3 field getters (assume zero result if version < 3) */ - -pascal long GetVolParmsInfoExtendedAttributes(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMVersion >= 3) ? volParms->vMExtendedAttributes : 0 ); -} - -/* attribute bits supported by all versions of GetVolParmsInfoBuffer */ - -pascal Boolean isNetworkVolume(const GetVolParmsInfoBuffer *volParms) -{ - return ( volParms->vMServerAdr != 0 ); -} - -pascal Boolean hasLimitFCBs(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bLimitFCBs)) != 0 ); -} - -pascal Boolean hasLocalWList(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bLocalWList)) != 0 ); -} - -pascal Boolean hasNoMiniFndr(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoMiniFndr)) != 0 ); -} - -pascal Boolean hasNoVNEdit(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoVNEdit)) != 0 ); -} - -pascal Boolean hasNoLclSync(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoLclSync)) != 0 ); -} - -pascal Boolean hasTrshOffLine(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bTrshOffLine)) != 0 ); -} - -pascal Boolean hasNoSwitchTo(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoSwitchTo)) != 0 ); -} - -pascal Boolean hasNoDeskItems(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoDeskItems)) != 0 ); -} - -pascal Boolean hasNoBootBlks(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoBootBlks)) != 0 ); -} - -pascal Boolean hasAccessCntl(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bAccessCntl)) != 0 ); -} - -pascal Boolean hasNoSysDir(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bNoSysDir)) != 0 ); -} - -pascal Boolean hasExtFSVol(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasExtFSVol)) != 0 ); -} - -pascal Boolean hasOpenDeny(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasOpenDeny)) != 0 ); -} - -pascal Boolean hasCopyFile(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasCopyFile)) != 0 ); -} - -pascal Boolean hasMoveRename(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasMoveRename)) != 0 ); -} - -pascal Boolean hasDesktopMgr(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasDesktopMgr)) != 0 ); -} - -pascal Boolean hasShortName(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasShortName)) != 0 ); -} - -pascal Boolean hasFolderLock(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasFolderLock)) != 0 ); -} - -pascal Boolean hasPersonalAccessPrivileges(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0 ); -} - -pascal Boolean hasUserGroupList(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasUserGroupList)) != 0 ); -} - -pascal Boolean hasCatSearch(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasCatSearch)) != 0 ); -} - -pascal Boolean hasFileIDs(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasFileIDs)) != 0 ); -} - -pascal Boolean hasBTreeMgr(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasBTreeMgr)) != 0 ); -} - -pascal Boolean hasBlankAccessPrivileges(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0 ); -} - -pascal Boolean supportsAsyncRequests(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bSupportsAsyncRequests)) != 0 ); -} - -pascal Boolean supportsTrashVolumeCache(const GetVolParmsInfoBuffer *volParms) -{ - return ( (volParms->vMAttrib & (1L << bSupportsTrashVolumeCache)) != 0 ); -} - -/* attribute bits supported by version 3 and greater versions of GetVolParmsInfoBuffer */ - -pascal Boolean volIsEjectable(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bIsEjectable)) != 0 ); -} - -pascal Boolean volSupportsHFSPlusAPIs(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsHFSPlusAPIs)) != 0 ); -} - -pascal Boolean volSupportsFSCatalogSearch(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsFSCatalogSearch)) != 0 ); -} - -pascal Boolean volSupportsFSExchangeObjects(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsFSExchangeObjects)) != 0 ); -} - -pascal Boolean volSupports2TBFiles(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupports2TBFiles)) != 0 ); -} - -pascal Boolean volSupportsLongNames(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsLongNames)) != 0 ); -} - -pascal Boolean volSupportsMultiScriptNames(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsMultiScriptNames)) != 0 ); -} - -pascal Boolean volSupportsNamedForks(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsNamedForks)) != 0 ); -} - -pascal Boolean volSupportsSubtreeIterators(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsSubtreeIterators)) != 0 ); -} - -pascal Boolean volL2PCanMapFileBlocks(const GetVolParmsInfoBuffer *volParms) -{ - return ( (GetVolParmsInfoExtendedAttributes(volParms) & (1L << bL2PCanMapFileBlocks)) != 0 ); -} - -/*****************************************************************************/ - -/* Functions for testing ioACUser bits. */ - -pascal Boolean userIsOwner(SInt8 ioACUser) -{ - return ( (ioACUser & kioACUserNotOwnerMask) == 0 ); -} - -pascal Boolean userHasFullAccess(SInt8 ioACUser) -{ - return ( (ioACUser & acUserAccessMask) == acUserFull ); -} - -pascal Boolean userHasDropBoxAccess(SInt8 ioACUser) -{ - return ( (ioACUser & acUserAccessMask) == acUserDropBox ); -} - -pascal Boolean userHasBulletinBoard(SInt8 ioACUser) -{ - return ( (ioACUser & acUserAccessMask) == acUserBulletinBoard ); -} - -pascal Boolean userHasNoAccess(SInt8 ioACUser) -{ - return ( (ioACUser & acUserAccessMask) == acUserNone ); -} - -/*****************************************************************************/ - -/* local data structures */ - -/* The DeleteEnumGlobals structure is used to minimize the amount of -** stack space used when recursively calling DeleteLevel and to hold -** global information that might be needed at any time. */ - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#endif // PRAGMA_STRUCT_ALIGN -struct DeleteEnumGlobals -{ - OSErr error; /* temporary holder of results - saves 2 bytes of stack each level */ - Str63 itemName; /* the name of the current item */ - UniversalFMPB myPB; /* the parameter block used for PBGetCatInfo calls */ -}; -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#endif // PRAGMA_STRUCT_ALIGN - -typedef struct DeleteEnumGlobals DeleteEnumGlobals; -typedef DeleteEnumGlobals *DeleteEnumGlobalsPtr; - -/*****************************************************************************/ - -/* -** CallPBXGetVolInfoSync is the glue code needed to make PBXGetVolInfoSync -** File Manager requests from CFM-based programs. Apple added PBXGetVolInfoSync -** to InterfaceLib in Mac OS 8.5, so if __MACOSEIGHTFIVEORLATER is defined, -** CallPBXGetVolInfoSync is defined back to PBXGetVolInfoSync. -** -** Non-CFM 68K programs don't needs this glue (and won't get it) because -** they instead use the inline assembly glue found in the Files.h interface -** file. -*/ - -#if TARGET_API_MAC_CARBON || !TARGET_RT_MAC_CFM - - // Carbon builds and 68K builds don't need this glue - #define CallPBXGetVolInfoSync PBXGetVolInfoSync - -#else // TARGET_API_MAC_CARBON || !TARGET_RT_MAC_CFM - - #if __WANTPASCALELIMINATION - #undef pascal - #endif // __WANTPASCALELIMINATION - - /* This is exactly like the simple mixed mode glue in InterfaceLib in Mac OS 8.5 and 8.6 */ - static pascal OSErr PBXGetVolInfoSyncGlue(XVolumeParamPtr paramBlock) - { - enum - { - uppFSDispatchProcInfo = kRegisterBased - | REGISTER_RESULT_LOCATION(kRegisterD0) - | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) - | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(long))) /* selector */ - | REGISTER_ROUTINE_PARAMETER(2, kRegisterD1, SIZE_CODE(sizeof(long))) /* trap word */ - | REGISTER_ROUTINE_PARAMETER(3, kRegisterA0, SIZE_CODE(sizeof(XVolumeParamPtr))) - }; - - static UniversalProcPtr fsDispatchTrapAddress = NULL; - - /* Is this the first time we've been called? */ - if ( fsDispatchTrapAddress == NULL ) - { - /* Yes - Get the trap address of _FSDispatch */ - fsDispatchTrapAddress = NGetTrapAddress(_FSDispatch, OSTrap); - } - return ( CallOSTrapUniversalProc(fsDispatchTrapAddress, - uppFSDispatchProcInfo, - kFSMXGetVolInfo, - _FSDispatch, - paramBlock) ); - } - - /* - ** PBXGetVolInfoSync was added to the File Manager in System software 7.5.2. - ** However, PBXGetVolInfoSync wasn't added to InterfaceLib until Mac OS 8.5. - ** This wrapper calls PBXGetVolInfoSync if it is found in InterfaceLib; - ** otherwise, it calls PBXGetVolInfoSyncGlue. This ensures that your program - ** is calling the latest implementation of PBXGetVolInfoSync. - */ - static pascal OSErr CallPBXGetVolInfoSync(XVolumeParamPtr paramBlock) - { - typedef pascal OSErr (*PBXGetVolInfoProcPtr) (XVolumeParamPtr paramBlock); - - OSErr result; - CFragConnectionID connID; - Ptr mainAddr; - Str255 errMessage; - static PBXGetVolInfoProcPtr PBXGetVolInfoSyncPtr = NULL; - - //* Is this the first time we've been called? */ - if ( PBXGetVolInfoSyncPtr == NULL ) - { - /* Yes - Get our connection ID to InterfaceLib */ - result = GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch, kLoadCFrag, &connID, &mainAddr, errMessage); - if ( result == noErr ) - { - /* See if PBXGetVolInfoSync is in InterfaceLib */ - if ( FindSymbol(connID, "\pPBXGetVolInfoSync", &(Ptr)PBXGetVolInfoSyncPtr, NULL) != noErr ) - { - /* Use glue code if symbol isn't found */ - PBXGetVolInfoSyncPtr = PBXGetVolInfoSyncGlue; - } - } - } - /* Call PBXGetVolInfoSync if present; otherwise, call PBXGetVolInfoSyncGlue */ - return ( (*PBXGetVolInfoSyncPtr)(paramBlock) ); - } - - #if __WANTPASCALELIMINATION - #define pascal - #endif // __WANTPASCALELIMINATION - -#endif // TARGET_API_MAC_CARBON || !TARGET_RT_MAC_CFM - -/*****************************************************************************/ - -pascal void TruncPString(StringPtr destination, - ConstStr255Param source, - short maxLength) -{ - short charType; - - if ( source != NULL && destination != NULL ) /* don't do anything stupid */ - { - if ( source[0] > maxLength ) - { - /* Make sure the string isn't truncated in the middle of */ - /* a multi-byte character. */ - while (maxLength != 0) - { - // Note: CharacterByteType's textOffset parameter is zero-based from the textPtr parameter - charType = CharacterByteType((Ptr)&source[1], maxLength - 1, smSystemScript); - if ( (charType == smSingleByte) || (charType == smLastByte) ) - break; /* source[maxLength] is now a valid last character */ - --maxLength; - } - } - else - { - maxLength = source[0]; - } - /* Set the destination string length */ - destination[0] = maxLength; - /* and copy maxLength characters (if needed) */ - if ( source != destination ) - { - while ( maxLength != 0 ) - { - destination[maxLength] = source[maxLength]; - --maxLength; - } - } - } -} - -/*****************************************************************************/ - -pascal Ptr GetTempBuffer(long buffReqSize, - long *buffActSize) -{ - enum - { - kSlopMemory = 0x00008000 /* 32K - Amount of free memory to leave when allocating buffers */ - }; - Ptr tempPtr; - - /* Make request a multiple of 1024 bytes */ - buffReqSize = buffReqSize & 0xfffffc00; - - if ( buffReqSize < 0x00000400 ) - { - /* Request was smaller than 1024 bytes - make it 1024 */ - buffReqSize = 0x00000400; - } - - /* Attempt to allocate the memory */ - tempPtr = NewPtr(buffReqSize); - - /* If request failed, go to backup plan */ - if ( (tempPtr == NULL) && (buffReqSize > 0x00000400) ) - { - /* - ** Try to get largest 1024-byte block available - ** leaving some slop for the toolbox if possible - */ - long freeMemory = (FreeMem() - kSlopMemory) & 0xfffffc00; - - buffReqSize = MaxBlock() & 0xfffffc00; - - if ( buffReqSize > freeMemory ) - { - buffReqSize = freeMemory; - } - - if ( buffReqSize == 0 ) - { - buffReqSize = 0x00000400; - } - - tempPtr = NewPtr(buffReqSize); - } - - /* Return bytes allocated */ - if ( tempPtr != NULL ) - { - *buffActSize = buffReqSize; - } - else - { - *buffActSize = 0; - } - - return ( tempPtr ); -} - -/*****************************************************************************/ - -/* -** GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync -** in cases where the returned volume name is not needed by the caller. -** The pathname and vRefNum parameters are not touched, and the pb -** parameter is initialized by PBHGetVInfoSync except that ioNamePtr in -** the parameter block is always returned as NULL (since it might point -** to the local tempPathname). -** -** I noticed using this code in several places, so here it is once. -** This reduces the code size of MoreFiles. -*/ -pascal OSErr GetVolumeInfoNoName(ConstStr255Param pathname, - short vRefNum, - HParmBlkPtr pb) -{ - Str255 tempPathname; - OSErr error; - - /* Make sure pb parameter is not NULL */ - if ( pb != NULL ) - { - pb->volumeParam.ioVRefNum = vRefNum; - if ( pathname == NULL ) - { - pb->volumeParam.ioNamePtr = NULL; - pb->volumeParam.ioVolIndex = 0; /* use ioVRefNum only */ - } - else - { - BlockMoveData(pathname, tempPathname, pathname[0] + 1); /* make a copy of the string and */ - pb->volumeParam.ioNamePtr = (StringPtr)tempPathname; /* use the copy so original isn't trashed */ - pb->volumeParam.ioVolIndex = -1; /* use ioNamePtr/ioVRefNum combination */ - } - error = PBHGetVInfoSync(pb); - pb->volumeParam.ioNamePtr = NULL; /* ioNamePtr may point to local tempPathname, so don't return it */ - } - else - { - error = paramErr; - } - return ( error ); -} - -/*****************************************************************************/ - -/* -** XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync -** in cases where the returned volume name is not needed by the caller. -** The pathname and vRefNum parameters are not touched, and the pb -** parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in -** the parameter block is always returned as NULL (since it might point -** to the local tempPathname). -*/ -pascal OSErr XGetVolumeInfoNoName(ConstStr255Param pathname, - short vRefNum, - XVolumeParamPtr pb) -{ - Str255 tempPathname; - OSErr error; - - /* Make sure pb parameter is not NULL */ - if ( pb != NULL ) - { - pb->ioVRefNum = vRefNum; - pb->ioXVersion = 0; /* this XVolumeParam version (0) */ - if ( pathname == NULL ) - { - pb->ioNamePtr = NULL; - pb->ioVolIndex = 0; /* use ioVRefNum only */ - } - else - { - BlockMoveData(pathname, tempPathname, pathname[0] + 1); /* make a copy of the string and */ - pb->ioNamePtr = (StringPtr)tempPathname; /* use the copy so original isn't trashed */ - pb->ioVolIndex = -1; /* use ioNamePtr/ioVRefNum combination */ - } - - { -#if !TARGET_API_MAC_CARBON - long response; - - /* Is PBXGetVolInfo available? */ - if ( ( Gestalt(gestaltFSAttr, &response) != noErr ) || ((response & (1L << gestaltFSSupports2TBVols)) == 0) ) - { - /* No, fall back on PBHGetVInfo */ - error = PBHGetVInfoSync((HParmBlkPtr)pb); - if ( error == noErr ) - { - /* calculate the ioVTotalBytes and ioVFreeBytes fields */ - pb->ioVTotalBytes = U64Multiply(U64SetU(pb->ioVNmAlBlks), U64SetU(pb->ioVAlBlkSiz)); - pb->ioVFreeBytes = U64Multiply(U64SetU(pb->ioVFrBlk), U64SetU(pb->ioVAlBlkSiz)); - } - } - else -#endif - { - /* Yes, so use it */ - error = CallPBXGetVolInfoSync(pb); - } - } - pb->ioNamePtr = NULL; /* ioNamePtr may point to local tempPathname, so don't return it */ - } - else - { - error = paramErr; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetCatInfoNoName(short vRefNum, - long dirID, - ConstStr255Param name, - CInfoPBPtr pb) -{ - Str31 tempName; - OSErr error; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb->dirInfo.ioNamePtr = tempName; - pb->dirInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb->dirInfo.ioNamePtr = (StringPtr)name; - pb->dirInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb->dirInfo.ioVRefNum = vRefNum; - pb->dirInfo.ioDrDirID = dirID; - error = PBGetCatInfoSync(pb); - pb->dirInfo.ioNamePtr = NULL; - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DetermineVRefNum(ConstStr255Param pathname, - short vRefNum, - short *realVRefNum) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - *realVRefNum = pb.volumeParam.ioVRefNum; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr HGetVInfo(short volReference, - StringPtr volName, - short *vRefNum, - unsigned long *freeBytes, - unsigned long *totalBytes) -{ - OSErr result; - UInt64 freeBytes64; - UInt64 totalBytes64; - - // get the best values possible from XGetVInfo - result = XGetVInfo(volReference, volName, vRefNum, &freeBytes64, &totalBytes64); - if ( result == noErr ) - { - // and pin those values if needed - if ( (UInt64ToUnsignedWide(freeBytes64)).hi != 0 ) - { - // pin to maximum 512-byte block aligned value - *freeBytes = 0xfffffe00; - } - else - { - *freeBytes = U32SetU(freeBytes64); - } - - if ( (UInt64ToUnsignedWide(totalBytes64)).hi != 0 ) - { - // pin to maximum 512-byte block aligned value - *totalBytes = 0xfffffe00; - } - else - { - *totalBytes = U32SetU(totalBytes64); - } - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr XGetVInfo(short volReference, - StringPtr volName, - short *vRefNum, - UInt64 *freeBytes, - UInt64 *totalBytes) -{ - OSErr result; - XVolumeParam pb; - -#if !TARGET_API_MAC_CARBON - - long response; - -#endif // !TARGET_API_MAC_CARBON - - pb.ioVRefNum = volReference; - pb.ioNamePtr = volName; - pb.ioXVersion = 0; /* this XVolumeParam version (0) */ - pb.ioVolIndex = 0; /* use ioVRefNum only, return volume name */ - -#if !TARGET_API_MAC_CARBON - - /* See if large volume support is available */ - if ( ( Gestalt(gestaltFSAttr, &response) == noErr ) && ((response & (1L << gestaltFSSupports2TBVols)) != 0) ) - -#endif // !TARGET_API_MAC_CARBON - - { - /* Large volume support is available */ - result = CallPBXGetVolInfoSync(&pb); - if ( result == noErr ) - { - /* The volume name was returned in volName (if not NULL) and */ - /* we have the volume's vRefNum and allocation block size */ - *vRefNum = pb.ioVRefNum; - - /* return the freeBytes and totalBytes */ - *totalBytes = pb.ioVTotalBytes; - *freeBytes = pb.ioVFreeBytes; - } - } - -#if !TARGET_API_MAC_CARBON - - else - { - /* No large volume support */ - /* Use PBHGetVInfoSync to get the results */ - result = PBHGetVInfoSync((HParmBlkPtr)&pb); - if ( result == noErr ) - { - VCB *theVCB; - - /* The volume name was returned in volName (if not NULL) and */ - /* we have the volume's vRefNum */ - *vRefNum = pb.ioVRefNum; - - /* System 7.5 (and beyond) pins the number of allocation blocks and */ - /* the number of free allocation blocks returned by PBHGetVInfo to */ - /* a value so that when multiplied by the allocation block size, */ - /* the volume will look like it has $7fffffff bytes or less. This */ - /* was done so older applications that use signed math or that use */ - /* the GetVInfo function (which uses signed math) will continue to work. */ - /* However, the unpinned numbers (which we want) are always available */ - /* in the volume's VCB so we'll get those values from the VCB. */ - /* Note: Carbon doesn't support the VCB queue, so this code cannot be */ - /* used (and is conditionalized out) by Carbon applications. */ - - /* Find the volume's VCB */ - theVCB = (VCB *)(GetVCBQHdr()->qHead); - while ( theVCB != NULL ) - { - if ( theVCB->vcbVRefNum == *vRefNum ) - { - break; - } - - theVCB = (VCB *)(theVCB->qLink); /* next VCB */ - } - - if ( theVCB != NULL ) - { - /* Found a VCB we can use. Get the un-pinned number of allocation blocks */ - /* and the number of free blocks from the VCB. */ - *freeBytes = U64Multiply(U64SetU((unsigned short)theVCB->vcbFreeBks), U64SetU((unsigned long)pb.ioVAlBlkSiz)); - *totalBytes = U64Multiply(U64SetU((unsigned short)theVCB->vcbNmAlBlks), U64SetU((unsigned long)pb.ioVAlBlkSiz)); - } - else - { - /* Didn't find a VCB we can use. Return the number of allocation blocks */ - /* and the number of free blocks returned by PBHGetVInfoSync. */ - *freeBytes = U64Multiply(U64SetU((unsigned short)pb.ioVFrBlk), U64SetU((unsigned long)pb.ioVAlBlkSiz)); - *totalBytes = U64Multiply(U64SetU((unsigned short)pb.ioVNmAlBlks), U64SetU((unsigned long)pb.ioVAlBlkSiz)); - } - - } - } - -#endif // !TARGET_API_MAC_CARBON - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr CheckVolLock(ConstStr255Param pathname, - short vRefNum) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - if ( (pb.volumeParam.ioVAtrb & kHFSVolumeHardwareLockMask) != 0 ) - { - error = wPrErr; /* volume locked by hardware */ - } - else if ( (pb.volumeParam.ioVAtrb & kHFSVolumeSoftwareLockMask) != 0 ) - { - error = vLckdErr; /* volume locked by software */ - } - } - - return ( error ); -} - -/*****************************************************************************/ -// -// The following routines call Mac OS routines that are not supported by -// Carbon: -// -// GetDriverName -// FindDrive -// GetDiskBlocks -// GetVolState - -#if !TARGET_API_MAC_CARBON // { - - /*****************************************************************************/ - - pascal OSErr GetDriverName(short driverRefNum, - Str255 driverName) - { - OSErr result; - DCtlHandle theDctl; - DRVRHeaderPtr dHeaderPtr; - - theDctl = GetDCtlEntry(driverRefNum); - if ( theDctl != NULL ) - { - if ( (**theDctl).dCtlFlags & dRAMBasedMask ) - { - /* dctlDriver is handle - dereference */ - dHeaderPtr = *((DRVRHeaderHandle)(**theDctl).dCtlDriver); - } - else - { - /* dctlDriver is pointer */ - dHeaderPtr = (DRVRHeaderPtr)(**theDctl).dCtlDriver; - } - BlockMoveData((*dHeaderPtr).drvrName, driverName, (*dHeaderPtr).drvrName[0] + 1); - result = noErr; - } - else - { - driverName[0] = 0; - result = badUnitErr; /* bad reference number */ - } - - return ( result ); - } - - /*****************************************************************************/ - - pascal OSErr FindDrive(ConstStr255Param pathname, - short vRefNum, - DrvQElPtr *driveQElementPtr) - { - OSErr result; - HParamBlockRec hPB; - short driveNumber; - - *driveQElementPtr = NULL; - - /* First, use GetVolumeInfoNoName to determine the volume */ - result = GetVolumeInfoNoName(pathname, vRefNum, &hPB); - if ( result == noErr ) - { - /* - ** The volume can be either online, offline, or ejected. What we find in - ** ioVDrvInfo and ioVDRefNum will tell us which it is. - ** See Inside Macintosh: Files page 2-80 and the Technical Note - ** "FL 34 - VCBs and Drive Numbers : The Real Story" - ** Where we get the drive number depends on the state of the volume. - */ - if ( hPB.volumeParam.ioVDrvInfo != 0 ) - { - /* The volume is online and not ejected */ - /* Get the drive number */ - driveNumber = hPB.volumeParam.ioVDrvInfo; - } - else - { - /* The volume's is either offline or ejected */ - /* in either case, the volume is NOT online */ - - /* Is it ejected or just offline? */ - if ( hPB.volumeParam.ioVDRefNum > 0 ) - { - /* It's ejected, the drive number is ioVDRefNum */ - driveNumber = hPB.volumeParam.ioVDRefNum; - } - else - { - /* It's offline, the drive number is the negative of ioVDRefNum */ - driveNumber = (short)-hPB.volumeParam.ioVDRefNum; - } - } - - /* Get pointer to first element in drive queue */ - *driveQElementPtr = (DrvQElPtr)(GetDrvQHdr()->qHead); - - /* Search for a matching drive number */ - while ( (*driveQElementPtr != NULL) && ((*driveQElementPtr)->dQDrive != driveNumber) ) - { - *driveQElementPtr = (DrvQElPtr)(*driveQElementPtr)->qLink; - } - - if ( *driveQElementPtr == NULL ) - { - /* This should never happen since every volume must have a drive, but... */ - result = nsDrvErr; - } - } - - return ( result ); - } - - /*****************************************************************************/ - - pascal OSErr GetDiskBlocks(ConstStr255Param pathname, - short vRefNum, - unsigned long *numBlocks) - { - /* Various constants for GetDiskBlocks() */ - enum - { - /* return format list status code */ - kFmtLstCode = 6, - - /* reference number of .SONY driver */ - kSonyRefNum = 0xfffb, - - /* values returned by DriveStatus in DrvSts.twoSideFmt */ - kSingleSided = 0, - kDoubleSided = -1, - kSingleSidedSize = 800, /* 400K */ - kDoubleSidedSize = 1600, /* 800K */ - - /* values in DrvQEl.qType */ - kWordDrvSiz = 0, - kLongDrvSiz = 1, - - /* more than enough formatListRecords */ - kMaxFormatListRecs = 16 - }; - - DrvQElPtr driveQElementPtr; - unsigned long blocks; - ParamBlockRec pb; - FormatListRec formatListRecords[kMaxFormatListRecs]; - DrvSts status; - short formatListRecIndex; - OSErr result; - - blocks = 0; - - /* Find the drive queue element for this volume */ - result = FindDrive(pathname, vRefNum, &driveQElementPtr); - - /* - ** Make sure this is a real driver (dQRefNum < 0). - ** AOCE's Mail Enclosures volume uses 0 for dQRefNum which will cause - ** problems if you try to use it as a driver refNum. - */ - if ( (result == noErr) && (driveQElementPtr->dQRefNum >= 0) ) - { - result = paramErr; - } - else - { - /* Attempt to get the drive's format list. */ - /* (see the Technical Note "What Your Sony Drives For You") */ - - pb.cntrlParam.ioVRefNum = driveQElementPtr->dQDrive; - pb.cntrlParam.ioCRefNum = driveQElementPtr->dQRefNum; - pb.cntrlParam.csCode = kFmtLstCode; - pb.cntrlParam.csParam[0] = kMaxFormatListRecs; - *(long *)&pb.cntrlParam.csParam[1] = (long)&formatListRecords[0]; - - result = PBStatusSync(&pb); - - if ( result == noErr ) - { - /* The drive supports ReturnFormatList status call. */ - - /* Get the current disk's size. */ - for( formatListRecIndex = 0; - formatListRecIndex < pb.cntrlParam.csParam[0]; - ++formatListRecIndex ) - { - if ( (formatListRecords[formatListRecIndex].formatFlags & - diCIFmtFlagsCurrentMask) != 0 ) - { - blocks = formatListRecords[formatListRecIndex].volSize; - } - } - if ( blocks == 0 ) - { - /* This should never happen */ - result = paramErr; - } - } - else if ( driveQElementPtr->dQRefNum == (short)kSonyRefNum ) - { - /* The drive is a non-SuperDrive floppy which only supports 400K and 800K disks */ - - result = DriveStatus(driveQElementPtr->dQDrive, &status); - if ( result == noErr ) - { - switch ( status.twoSideFmt ) - { - case kSingleSided: - blocks = kSingleSidedSize; - break; - case kDoubleSided: - blocks = kDoubleSidedSize; - break; - default: - /* This should never happen */ - result = paramErr; - break; - } - } - } - else - { - /* The drive is not a floppy and it doesn't support ReturnFormatList */ - /* so use the dQDrvSz field(s) */ - - result = noErr; /* reset result */ - switch ( driveQElementPtr->qType ) - { - case kWordDrvSiz: - blocks = driveQElementPtr->dQDrvSz; - break; - case kLongDrvSiz: - blocks = ((unsigned long)driveQElementPtr->dQDrvSz2 << 16) + - driveQElementPtr->dQDrvSz; - break; - default: - /* This should never happen */ - result = paramErr; - break; - } - } - } - - if ( result == noErr ) - { - *numBlocks = blocks; - } - - return ( result ); - } - - /*****************************************************************************/ - - pascal OSErr GetVolState(ConstStr255Param pathname, - short vRefNum, - Boolean *volumeOnline, - Boolean *volumeEjected, - Boolean *driveEjectable, - Boolean *driverWantsEject) - { - HParamBlockRec pb; - short driveNumber; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - if ( pb.volumeParam.ioVDrvInfo != 0 ) - { - /* the volume is online and not ejected */ - *volumeOnline = true; - *volumeEjected = false; - - /* Get the drive number */ - driveNumber = pb.volumeParam.ioVDrvInfo; - } - else - { - /* the volume's is either offline or ejected */ - /* in either case, the volume is NOT online */ - *volumeOnline = false; - - /* Is it ejected? */ - *volumeEjected = pb.volumeParam.ioVDRefNum > 0; - - if ( *volumeEjected ) - { - /* If ejected, the drive number is ioVDRefNum */ - driveNumber = pb.volumeParam.ioVDRefNum; - } - else - { - /* If offline, the drive number is the negative of ioVDRefNum */ - driveNumber = (short)-pb.volumeParam.ioVDRefNum; - } - } - - { - DrvQElPtr drvQElem; - - /* Find the drive queue element by searching the drive queue */ - drvQElem = (DrvQElPtr)(GetDrvQHdr()->qHead); - while ( (drvQElem != NULL) && (drvQElem->dQDrive != driveNumber) ) - { - drvQElem = (DrvQElPtr)drvQElem->qLink; - } - - if ( drvQElem != NULL ) - { - /* - ** Each drive queue element is preceded by 4 flag bytes. - ** Byte 1 (the second flag byte) has bits that tell us if a - ** drive is ejectable and if its driver wants an eject call. - ** See Inside Macintosh: Files, page 2-85. - */ - { - Ptr flagBytePtr; - - /* point to byte 1 of the flag bytes */ - flagBytePtr = (Ptr)drvQElem; - flagBytePtr -= 3; - - /* - ** The drive is ejectable if flag byte 1 does not contain - ** 0x08 (nonejectable) or 0x48 (nonejectable, but wants eject call). - */ - - *driveEjectable = (*flagBytePtr != 0x08) && (*flagBytePtr != 0x48); - - /* - ** The driver wants an eject call if flag byte 1 does not contain - ** 0x08 (nonejectable). This may seem like a minor point, but some - ** disk drivers use the Eject request to flush their caches to disk - ** and you wouldn't want to skip that step after unmounting a volume. - */ - - *driverWantsEject = (*flagBytePtr != 0x08); - } - } - else - { - /* Didn't find the drive (this should never happen) */ - *driveEjectable = false; - *driverWantsEject = false; - } - } - } - - return ( error ); - } - - /*****************************************************************************/ - -#endif // } !TARGET_API_MAC_CARBON - -/*****************************************************************************/ - -pascal OSErr GetVolFileSystemID(ConstStr255Param pathname, - short vRefNum, - short *fileSystemID) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - *fileSystemID = pb.volumeParam.ioVFSID; - } - - return ( error ); -} - -/*****************************************************************************/ - -// -// Note: Under Carbon there are no drive numbers, so you cannot call -// Eject with a drive number after unmounting a volume. -// When a Carbon application calls UnmountVol, CarbonLib will make -// sure ejectable media is ejected (leaving ejectable media in the -// disk drive makes no sense to Carbon applications). -// -pascal OSErr UnmountAndEject(ConstStr255Param pathname, - short vRefNum) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname, vRefNum, &pb); - if ( error == noErr ) - { - -#if !TARGET_API_MAC_CARBON - - short driveNum; - Boolean ejected, wantsEject; - DrvQElPtr drvQElem; - - if ( pb.volumeParam.ioVDrvInfo != 0 ) - { - /* the volume is online and not ejected */ - ejected = false; - - /* Get the drive number */ - driveNum = pb.volumeParam.ioVDrvInfo; - } - else - { - /* the volume is ejected or offline */ - - /* Is it ejected? */ - ejected = pb.volumeParam.ioVDRefNum > 0; - - if ( ejected ) - { - /* If ejected, the drive number is ioVDRefNum */ - driveNum = pb.volumeParam.ioVDRefNum; - } - else - { - /* If offline, the drive number is the negative of ioVDRefNum */ - driveNum = (short)-pb.volumeParam.ioVDRefNum; - } - } - - /* find the drive queue element */ - drvQElem = (DrvQElPtr)(GetDrvQHdr()->qHead); - while ( (drvQElem != NULL) && (drvQElem->dQDrive != driveNum) ) - { - drvQElem = (DrvQElPtr)drvQElem->qLink; - } - - if ( drvQElem != NULL ) - { - /* does the drive want an eject call */ - wantsEject = (*((Ptr)((Ptr)drvQElem - 3)) != 8); - } - else - { - /* didn't find the drive!! */ - wantsEject = false; - } - -#endif // !TARGET_API_MAC_CARBON - - /* unmount the volume */ - pb.volumeParam.ioNamePtr = NULL; - /* ioVRefNum is already filled in from PBHGetVInfo */ - error = PBUnmountVol((ParmBlkPtr)&pb); - -#if !TARGET_API_MAC_CARBON - - if ( error == noErr ) - { - if ( wantsEject && !ejected ) - { - /* eject the media from the drive if needed */ - pb.volumeParam.ioVRefNum = driveNum; - error = PBEject((ParmBlkPtr)&pb); - } - } - -#endif // !TARGET_API_MAC_CARBON - - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr OnLine(FSSpecPtr volumes, - short reqVolCount, - short *actVolCount, - short *volIndex) -{ - HParamBlockRec pb; - OSErr error = noErr; - FSSpec *endVolArray; - - if ( *volIndex > 0 ) - { - *actVolCount = 0; - for ( endVolArray = volumes + reqVolCount; (volumes < endVolArray) && (error == noErr); ++volumes ) - { - pb.volumeParam.ioNamePtr = (StringPtr) & volumes->name; - pb.volumeParam.ioVolIndex = *volIndex; - error = PBHGetVInfoSync(&pb); - if ( error == noErr ) - { - volumes->parID = fsRtParID; /* the root directory's parent is 1 */ - volumes->vRefNum = pb.volumeParam.ioVRefNum; - ++*volIndex; - ++*actVolCount; - } - } - } - else - { - error = paramErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr SetDefault(short newVRefNum, - long newDirID, - short *oldVRefNum, - long *oldDirID) -{ - OSErr error; - - /* Get the current default volume/directory. */ - error = HGetVol(NULL, oldVRefNum, oldDirID); - if ( error == noErr ) - { - /* Set the new default volume/directory */ - error = HSetVol(NULL, newVRefNum, newDirID); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr RestoreDefault(short oldVRefNum, - long oldDirID) -{ - OSErr error; - -#if !TARGET_API_MAC_CARBON - - short defaultVRefNum; - long defaultDirID; - long defaultProcID; - - /* Determine if the default volume was a wdRefNum. */ - error = GetWDInfo(oldVRefNum, &defaultVRefNum, &defaultDirID, &defaultProcID); - if ( error == noErr ) - { - /* Restore the old default volume/directory, one way or the other. */ - if ( defaultDirID != fsRtDirID ) - { - /* oldVRefNum was a wdRefNum - use SetVol */ - error = SetVol(NULL, oldVRefNum); - } - else - { - -#endif // !TARGET_API_MAC_CARBON - - /* oldVRefNum was a real vRefNum - use HSetVol */ - error = HSetVol(NULL, oldVRefNum, oldDirID); - -#if !TARGET_API_MAC_CARBON - - } - } -#endif // !TARGET_API_MAC_CARBON - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetDInfo(short vRefNum, - long dirID, - ConstStr255Param name, - DInfo *fndrInfo) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - if ( (pb.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* it's a directory, return the DInfo */ - *fndrInfo = pb.dirInfo.ioDrUsrWds; - } - else - { - /* oops, a file was passed */ - error = dirNFErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetDInfo(const FSSpec *spec, - DInfo *fndrInfo) -{ - return ( GetDInfo(spec->vRefNum, spec->parID, spec->name, fndrInfo) ); -} - -/*****************************************************************************/ - -pascal OSErr SetDInfo(short vRefNum, - long dirID, - ConstStr255Param name, - const DInfo *fndrInfo) -{ - CInfoPBRec pb; - Str31 tempName; - OSErr error; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb.dirInfo.ioNamePtr = tempName; - pb.dirInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.dirInfo.ioNamePtr = (StringPtr)name; - pb.dirInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.dirInfo.ioVRefNum = vRefNum; - pb.dirInfo.ioDrDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - if ( (pb.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* it's a directory, set the DInfo */ - if ( pb.dirInfo.ioNamePtr == tempName ) - { - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - } - else - { - pb.dirInfo.ioDrDirID = dirID; - } - pb.dirInfo.ioDrUsrWds = *fndrInfo; - error = PBSetCatInfoSync(&pb); - } - else - { - /* oops, a file was passed */ - error = dirNFErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetDInfo(const FSSpec *spec, - const DInfo *fndrInfo) -{ - return ( SetDInfo(spec->vRefNum, spec->parID, spec->name, fndrInfo) ); -} - -/*****************************************************************************/ - -pascal OSErr GetDirectoryID(short vRefNum, - long dirID, - ConstStr255Param name, - long *theDirID, - Boolean *isDirectory) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - *isDirectory = (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0; - if ( *isDirectory ) - { - *theDirID = pb.dirInfo.ioDrDirID; - } - else - { - *theDirID = pb.hFileInfo.ioFlParID; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetDirectoryID(const FSSpec *spec, - long *theDirID, - Boolean *isDirectory) -{ - return ( GetDirectoryID(spec->vRefNum, spec->parID, spec->name, - theDirID, isDirectory) ); -} - -/*****************************************************************************/ - -pascal OSErr GetDirName(short vRefNum, - long dirID, - Str31 name) -{ - CInfoPBRec pb; - OSErr error; - - if ( name != NULL ) - { - pb.dirInfo.ioNamePtr = name; - pb.dirInfo.ioVRefNum = vRefNum; - pb.dirInfo.ioDrDirID = dirID; - pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ - error = PBGetCatInfoSync(&pb); - } - else - { - error = paramErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetIOACUser(short vRefNum, - long dirID, - ConstStr255Param name, - SInt8 *ioACUser) -{ - CInfoPBRec pb; - OSErr error; - - /* Clear ioACUser before calling PBGetCatInfo since some file systems - ** don't bother to set or clear this field. If ioACUser isn't set by the - ** file system, then you'll get the zero value back (full access) which - ** is the access you have on volumes that don't support ioACUser. - */ - pb.dirInfo.ioACUser = 0; /* ioACUser used to be filler2 */ - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - if ( (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) == 0 ) - { - /* oops, a file was passed */ - error = dirNFErr; - } - else - { - *ioACUser = pb.dirInfo.ioACUser; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetIOACUser(const FSSpec *spec, - SInt8 *ioACUser) -{ - return ( GetIOACUser(spec->vRefNum, spec->parID, spec->name, ioACUser) ); -} - -/*****************************************************************************/ - -pascal OSErr GetParentID(short vRefNum, - long dirID, - ConstStr255Param name, - long *parID) -{ - CInfoPBRec pb; - Str31 tempName; - OSErr error; - short realVRefNum; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb.hFileInfo.ioNamePtr = tempName; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - /* - ** There's a bug in HFS where the wrong parent dir ID can be - ** returned if multiple separators are used at the end of a - ** pathname. For example, if the pathname: - ** 'volumeName:System Folder:Extensions::' - ** is passed, the directory ID of the Extensions folder is - ** returned in the ioFlParID field instead of fsRtDirID. Since - ** multiple separators at the end of a pathname always specifies - ** a directory, we only need to work-around cases where the - ** object is a directory and there are multiple separators at - ** the end of the name parameter. - */ - if ( (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* Its a directory */ - - /* is there a pathname? */ - if ( pb.hFileInfo.ioNamePtr == name ) - { - /* could it contain multiple separators? */ - if ( name[0] >= 2 ) - { - /* does it contain multiple separators at the end? */ - if ( (name[name[0]] == ':') && (name[name[0] - 1] == ':') ) - { - /* OK, then do the extra stuff to get the correct parID */ - - /* Get the real vRefNum (this should not fail) */ - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - /* we don't need the parent's name, but add protect against File Sharing problem */ - tempName[0] = 0; - pb.dirInfo.ioNamePtr = tempName; - pb.dirInfo.ioVRefNum = realVRefNum; - /* pb.dirInfo.ioDrDirID already contains the */ - /* dirID of the directory object */ - pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ - error = PBGetCatInfoSync(&pb); - /* now, pb.dirInfo.ioDrParID contains the correct parID */ - } - } - } - } - } - - if ( error == noErr ) - { - /* if no errors, then pb.hFileInfo.ioFlParID (pb.dirInfo.ioDrParID) */ - /* contains the parent ID */ - *parID = pb.hFileInfo.ioFlParID; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetFilenameFromPathname(ConstStr255Param pathname, - Str255 filename) -{ - short index; - short nameEnd; - OSErr error; - - /* default to no filename */ - filename[0] = 0; - - /* check for no pathname */ - if ( pathname != NULL ) - { - /* get string length */ - index = pathname[0]; - - /* check for empty string */ - if ( index != 0 ) - { - /* skip over last trailing colon (if any) */ - if ( pathname[index] == ':' ) - { - --index; - } - - /* save the end of the string */ - nameEnd = index; - - /* if pathname ends with multiple colons, then this pathname refers */ - /* to a directory, not a file */ - if ( pathname[index] != ':' ) - { - /* parse backwards until we find a colon or hit the beginning of the pathname */ - while ( (index != 0) && (pathname[index] != ':') ) - { - --index; - } - - /* if we parsed to the beginning of the pathname and the pathname ended */ - /* with a colon, then pathname is a full pathname to a volume, not a file */ - if ( (index != 0) || (pathname[pathname[0]] != ':') ) - { - /* get the filename and return noErr */ - filename[0] = (char)(nameEnd - index); - BlockMoveData(&pathname[index+1], &filename[1], nameEnd - index); - error = noErr; - } - else - { - /* pathname to a volume, not a file */ - error = notAFileErr; - } - } - else - { - /* directory, not a file */ - error = notAFileErr; - } - } - else - { - /* empty string isn't a file */ - error = notAFileErr; - } - } - else - { - /* NULL pathname isn't a file */ - error = notAFileErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetObjectLocation(short vRefNum, - long dirID, - ConstStr255Param pathname, - short *realVRefNum, - long *realParID, - Str255 realName, - Boolean *isDirectory) -{ - OSErr error; - CInfoPBRec pb; - Str255 tempPathname; - - /* clear results */ - *realVRefNum = 0; - *realParID = 0; - realName[0] = 0; - - /* - ** Get the real vRefNum - */ - error = DetermineVRefNum(pathname, vRefNum, realVRefNum); - if ( error == noErr ) - { - /* - ** Determine if the object already exists and if so, - ** get the real parent directory ID if it's a file - */ - - /* Protection against File Sharing problem */ - if ( (pathname == NULL) || (pathname[0] == 0) ) - { - tempPathname[0] = 0; - pb.hFileInfo.ioNamePtr = tempPathname; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)pathname; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - /* - ** The file system object is present and we have the file's real parID - */ - - /* Is it a directory or a file? */ - *isDirectory = (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0; - if ( *isDirectory ) - { - /* - ** It's a directory, get its name and parent dirID, and then we're done - */ - - pb.dirInfo.ioNamePtr = realName; - pb.dirInfo.ioVRefNum = *realVRefNum; - /* pb.dirInfo.ioDrDirID already contains the dirID of the directory object */ - pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ - error = PBGetCatInfoSync(&pb); - - /* get the parent ID here, because the file system can return the */ - /* wrong parent ID from the last call. */ - *realParID = pb.dirInfo.ioDrParID; - } - else - { - /* - ** It's a file - use the parent directory ID from the last call - ** to GetCatInfoparse, get the file name, and then we're done - */ - *realParID = pb.hFileInfo.ioFlParID; - error = GetFilenameFromPathname(pathname, realName); - } - } - else if ( error == fnfErr ) - { - /* - ** The file system object is not present - see if its parent is present - */ - - /* - ** Parse to get the object name from end of pathname - */ - error = GetFilenameFromPathname(pathname, realName); - - /* if we can't get the object name from the end, we can't continue */ - if ( error == noErr ) - { - /* - ** What we want now is the pathname minus the object name - ** for example: - ** if pathname is 'vol:dir:file' tempPathname becomes 'vol:dir:' - ** if pathname is 'vol:dir:file:' tempPathname becomes 'vol:dir:' - ** if pathname is ':dir:file' tempPathname becomes ':dir:' - ** if pathname is ':dir:file:' tempPathname becomes ':dir:' - ** if pathname is ':file' tempPathname becomes ':' - ** if pathname is 'file or file:' tempPathname becomes '' - */ - - /* get a copy of the pathname */ - BlockMoveData(pathname, tempPathname, pathname[0] + 1); - - /* remove the object name */ - tempPathname[0] -= realName[0]; - /* and the trailing colon (if any) */ - if ( pathname[pathname[0]] == ':' ) - { - --tempPathname[0]; - } - - /* OK, now get the parent's directory ID */ - - /* Protection against File Sharing problem */ - pb.hFileInfo.ioNamePtr = (StringPtr)tempPathname; - if ( tempPathname[0] != 0 ) - { - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - else - { - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - *realParID = pb.dirInfo.ioDrDirID; - - *isDirectory = false; /* we don't know what the object is really going to be */ - } - - if ( error != noErr ) - { - error = dirNFErr; /* couldn't find parent directory */ - } - else - { - error = fnfErr; /* we found the parent, but not the file */ - } - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetDirItems(short vRefNum, - long dirID, - ConstStr255Param name, - Boolean getFiles, - Boolean getDirectories, - FSSpecPtr items, - short reqItemCount, - short *actItemCount, - short *itemIndex) /* start with 1, then use what's returned */ -{ - CInfoPBRec pb; - OSErr error; - long theDirID; - Boolean isDirectory; - FSSpec *endItemsArray; - - if ( *itemIndex > 0 ) - { - /* NOTE: If I could be sure that the caller passed a real vRefNum and real directory */ - /* to this routine, I could rip out calls to DetermineVRefNum and GetDirectoryID and this */ - /* routine would be much faster because of the overhead of DetermineVRefNum and */ - /* GetDirectoryID and because GetDirectoryID blows away the directory index hint the Macintosh */ - /* file system keeps for indexed calls. I can't be sure, so for maximum throughput, */ - /* pass a big array of FSSpecs so you can get the directory's contents with few calls */ - /* to this routine. */ - - /* get the real volume reference number */ - error = DetermineVRefNum(name, vRefNum, &pb.hFileInfo.ioVRefNum); - if ( error == noErr ) - { - /* and the real directory ID of this directory (and make sure it IS a directory) */ - error = GetDirectoryID(vRefNum, dirID, name, &theDirID, &isDirectory); - if ( error == noErr ) - { - if ( isDirectory ) - { - *actItemCount = 0; - endItemsArray = items + reqItemCount; - while ( (items < endItemsArray) && (error == noErr) ) - { - pb.hFileInfo.ioNamePtr = (StringPtr) &items->name; - pb.hFileInfo.ioDirID = theDirID; - pb.hFileInfo.ioFDirIndex = *itemIndex; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - items->parID = pb.hFileInfo.ioFlParID; /* return item's parID */ - items->vRefNum = pb.hFileInfo.ioVRefNum; /* return item's vRefNum */ - ++*itemIndex; /* prepare to get next item in directory */ - - if ( (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - if ( getDirectories ) - { - ++*actItemCount; /* keep this item */ - ++items; /* point to next item */ - } - } - else - { - if ( getFiles ) - { - ++*actItemCount; /* keep this item */ - ++items; /* point to next item */ - } - } - } - } - } - else - { - /* it wasn't a directory */ - error = dirNFErr; - } - } - } - } - else - { - /* bad itemIndex */ - error = paramErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -static void DeleteLevel(long dirToDelete, - DeleteEnumGlobalsPtr theGlobals) -{ - long savedDir; - - do - { - /* prepare to delete directory */ - theGlobals->myPB.ciPB.dirInfo.ioNamePtr = (StringPtr)&theGlobals->itemName; - theGlobals->myPB.ciPB.dirInfo.ioFDirIndex = 1; /* get first item */ - theGlobals->myPB.ciPB.dirInfo.ioDrDirID = dirToDelete; /* in this directory */ - theGlobals->error = PBGetCatInfoSync(&(theGlobals->myPB.ciPB)); - if ( theGlobals->error == noErr ) - { - savedDir = dirToDelete; - /* We have an item. Is it a file or directory? */ - if ( (theGlobals->myPB.ciPB.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* it's a directory */ - savedDir = theGlobals->myPB.ciPB.dirInfo.ioDrDirID; /* save dirID of directory instead */ - DeleteLevel(theGlobals->myPB.ciPB.dirInfo.ioDrDirID, theGlobals); /* Delete its contents */ - theGlobals->myPB.ciPB.dirInfo.ioNamePtr = NULL; /* prepare to delete directory */ - } - if ( theGlobals->error == noErr ) - { - theGlobals->myPB.ciPB.dirInfo.ioDrDirID = savedDir; /* restore dirID */ - theGlobals->myPB.hPB.fileParam.ioFVersNum = 0; /* just in case it's used on an MFS volume... */ - theGlobals->error = PBHDeleteSync(&(theGlobals->myPB.hPB)); /* delete this item */ - if ( theGlobals->error == fLckdErr ) - { - (void) PBHRstFLockSync(&(theGlobals->myPB.hPB)); /* unlock it */ - theGlobals->error = PBHDeleteSync(&(theGlobals->myPB.hPB)); /* and try again */ - } - } - } - } while ( theGlobals->error == noErr ); - - if ( theGlobals->error == fnfErr ) - { - theGlobals->error = noErr; - } -} - -/*****************************************************************************/ - -pascal OSErr DeleteDirectoryContents(short vRefNum, - long dirID, - ConstStr255Param name) -{ - DeleteEnumGlobals theGlobals; - Boolean isDirectory; - OSErr error; - - /* Get the real dirID and make sure it is a directory. */ - error = GetDirectoryID(vRefNum, dirID, name, &dirID, &isDirectory); - if ( error == noErr ) - { - if ( isDirectory ) - { - /* Get the real vRefNum */ - error = DetermineVRefNum(name, vRefNum, &vRefNum); - if ( error == noErr ) - { - /* Set up the globals we need to access from the recursive routine. */ - theGlobals.myPB.ciPB.dirInfo.ioVRefNum = vRefNum; - - /* Here we go into recursion land... */ - DeleteLevel(dirID, &theGlobals); - error = theGlobals.error; - } - } - else - { - error = dirNFErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr DeleteDirectory(short vRefNum, - long dirID, - ConstStr255Param name) -{ - OSErr error; - - /* Make sure a directory was specified and then delete its contents */ - error = DeleteDirectoryContents(vRefNum, dirID, name); - if ( error == noErr ) - { - error = HDelete(vRefNum, dirID, name); - if ( error == fLckdErr ) - { - (void) HRstFLock(vRefNum, dirID, name); /* unlock the directory locked by AppleShare */ - error = HDelete(vRefNum, dirID, name); /* and try again */ - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr CheckObjectLock(short vRefNum, - long dirID, - ConstStr255Param name) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - /* check locked bit */ - if ( (pb.hFileInfo.ioFlAttrib & kioFlAttribLockedMask) != 0 ) - { - error = fLckdErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCheckObjectLock(const FSSpec *spec) -{ - return ( CheckObjectLock(spec->vRefNum, spec->parID, spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr GetFileSize(short vRefNum, - long dirID, - ConstStr255Param fileName, - long *dataSize, - long *rsrcSize) -{ - HParamBlockRec pb; - OSErr error; - - pb.fileParam.ioNamePtr = (StringPtr)fileName; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioDirID = dirID; - pb.fileParam.ioFDirIndex = 0; - error = PBHGetFInfoSync(&pb); - if ( error == noErr ) - { - *dataSize = pb.fileParam.ioFlLgLen; - *rsrcSize = pb.fileParam.ioFlRLgLen; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetFileSize(const FSSpec *spec, - long *dataSize, - long *rsrcSize) -{ - return ( GetFileSize(spec->vRefNum, spec->parID, spec->name, dataSize, rsrcSize) ); -} - -/*****************************************************************************/ - -pascal OSErr BumpDate(short vRefNum, - long dirID, - ConstStr255Param name) -/* Given a file or directory, change its modification date to the current date/time. */ -{ - CInfoPBRec pb; - Str31 tempName; - OSErr error; - unsigned long secs; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb.hFileInfo.ioNamePtr = tempName; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - GetDateTime(&secs); - /* set mod date to current date, or one second into the future - if mod date = current date */ - pb.hFileInfo.ioFlMdDat = (secs == pb.hFileInfo.ioFlMdDat) ? (++secs) : (secs); - if ( pb.dirInfo.ioNamePtr == tempName ) - { - pb.hFileInfo.ioDirID = pb.hFileInfo.ioFlParID; - } - else - { - pb.hFileInfo.ioDirID = dirID; - } - error = PBSetCatInfoSync(&pb); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpBumpDate(const FSSpec *spec) -{ - return ( BumpDate(spec->vRefNum, spec->parID, spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr ChangeCreatorType(short vRefNum, - long dirID, - ConstStr255Param name, - OSType creator, - OSType fileType) -{ - CInfoPBRec pb; - OSErr error; - short realVRefNum; - long parID; - - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - if ( (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) == 0 ) /* if file */ - { - parID = pb.hFileInfo.ioFlParID; /* save parent dirID for BumpDate call */ - - /* If creator not 0x00000000, change creator */ - if ( creator != (OSType)0x00000000 ) - { - pb.hFileInfo.ioFlFndrInfo.fdCreator = creator; - } - - /* If fileType not 0x00000000, change fileType */ - if ( fileType != (OSType)0x00000000 ) - { - pb.hFileInfo.ioFlFndrInfo.fdType = fileType; - } - - pb.hFileInfo.ioDirID = dirID; - error = PBSetCatInfoSync(&pb); /* now, save the new information back to disk */ - - if ( (error == noErr) && (parID != fsRtParID) ) /* can't bump fsRtParID */ - { - /* get the real vRefNum in case a full pathname was passed */ - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = BumpDate(realVRefNum, parID, NULL); - /* and bump the parent directory's mod date to wake up the Finder */ - /* to the change we just made */ - } - } - } - else - { - /* it was a directory, not a file */ - error = notAFileErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpChangeCreatorType(const FSSpec *spec, - OSType creator, - OSType fileType) -{ - return ( ChangeCreatorType(spec->vRefNum, spec->parID, spec->name, creator, fileType) ); -} - -/*****************************************************************************/ - -pascal OSErr ChangeFDFlags(short vRefNum, - long dirID, - ConstStr255Param name, - Boolean setBits, - unsigned short flagBits) -{ - CInfoPBRec pb; - Str31 tempName; - OSErr error; - short realVRefNum; - long parID; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb.hFileInfo.ioNamePtr = tempName; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - parID = pb.hFileInfo.ioFlParID; /* save parent dirID for BumpDate call */ - - /* set or clear the appropriate bits in the Finder flags */ - if ( setBits ) - { - /* OR in the bits */ - pb.hFileInfo.ioFlFndrInfo.fdFlags |= flagBits; - } - else - { - /* AND out the bits */ - pb.hFileInfo.ioFlFndrInfo.fdFlags &= ~flagBits; - } - - if ( pb.dirInfo.ioNamePtr == tempName ) - { - pb.hFileInfo.ioDirID = pb.hFileInfo.ioFlParID; - } - else - { - pb.hFileInfo.ioDirID = dirID; - } - - error = PBSetCatInfoSync(&pb); /* now, save the new information back to disk */ - - if ( (error == noErr) && (parID != fsRtParID) ) /* can't bump fsRtParID */ - { - /* get the real vRefNum in case a full pathname was passed */ - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = BumpDate(realVRefNum, parID, NULL); - /* and bump the parent directory's mod date to wake up the Finder */ - /* to the change we just made */ - } - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpChangeFDFlags(const FSSpec *spec, - Boolean setBits, - unsigned short flagBits) -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, setBits, flagBits) ); -} - -/*****************************************************************************/ - -pascal OSErr SetIsInvisible(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, make it invisible. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, true, kIsInvisible) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetIsInvisible(const FSSpec *spec) - /* Given a file or directory, make it invisible. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, true, kIsInvisible) ); -} - -/*****************************************************************************/ - -pascal OSErr ClearIsInvisible(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, make it visible. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, false, kIsInvisible) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpClearIsInvisible(const FSSpec *spec) - /* Given a file or directory, make it visible. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, false, kIsInvisible) ); -} - -/*****************************************************************************/ - -pascal OSErr SetNameLocked(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, lock its name. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, true, kNameLocked) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetNameLocked(const FSSpec *spec) - /* Given a file or directory, lock its name. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, true, kNameLocked) ); -} - -/*****************************************************************************/ - -pascal OSErr ClearNameLocked(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, unlock its name. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, false, kNameLocked) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpClearNameLocked(const FSSpec *spec) - /* Given a file or directory, unlock its name. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, false, kNameLocked) ); -} - -/*****************************************************************************/ - -pascal OSErr SetIsStationery(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file, make it a stationery pad. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, true, kIsStationery) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetIsStationery(const FSSpec *spec) - /* Given a file, make it a stationery pad. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, true, kIsStationery) ); -} - -/*****************************************************************************/ - -pascal OSErr ClearIsStationery(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file, clear the stationery bit. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, false, kIsStationery) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpClearIsStationery(const FSSpec *spec) - /* Given a file, clear the stationery bit. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, false, kIsStationery) ); -} - -/*****************************************************************************/ - -pascal OSErr SetHasCustomIcon(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, indicate that it has a custom icon. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, true, kHasCustomIcon) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpSetHasCustomIcon(const FSSpec *spec) - /* Given a file or directory, indicate that it has a custom icon. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, true, kHasCustomIcon) ); -} - -/*****************************************************************************/ - -pascal OSErr ClearHasCustomIcon(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file or directory, indicate that it does not have a custom icon. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, false, kHasCustomIcon) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpClearHasCustomIcon(const FSSpec *spec) - /* Given a file or directory, indicate that it does not have a custom icon. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, false, kHasCustomIcon) ); -} - -/*****************************************************************************/ - -pascal OSErr ClearHasBeenInited(short vRefNum, - long dirID, - ConstStr255Param name) - /* Given a file, clear its "has been inited" bit. */ -{ - return ( ChangeFDFlags(vRefNum, dirID, name, false, kHasBeenInited) ); -} - -/*****************************************************************************/ - -pascal OSErr FSpClearHasBeenInited(const FSSpec *spec) - /* Given a file, clear its "has been inited" bit. */ -{ - return ( ChangeFDFlags(spec->vRefNum, spec->parID, spec->name, false, kHasBeenInited) ); -} - -/*****************************************************************************/ - -pascal OSErr CopyFileMgrAttributes(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - Boolean copyLockBit) -{ - UniversalFMPB pb; - Str31 tempName; - OSErr error; - Boolean objectIsDirectory; - - pb.ciPB.hFileInfo.ioVRefNum = srcVRefNum; - pb.ciPB.hFileInfo.ioDirID = srcDirID; - - /* Protection against File Sharing problem */ - if ( (srcName == NULL) || (srcName[0] == 0) ) - { - tempName[0] = 0; - pb.ciPB.hFileInfo.ioNamePtr = tempName; - pb.ciPB.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.ciPB.hFileInfo.ioNamePtr = (StringPtr)srcName; - pb.ciPB.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - error = PBGetCatInfoSync(&pb.ciPB); - if ( error == noErr ) - { - objectIsDirectory = ( (pb.ciPB.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ); - pb.ciPB.hFileInfo.ioVRefNum = dstVRefNum; - pb.ciPB.hFileInfo.ioDirID = dstDirID; - if ( (dstName != NULL) && (dstName[0] == 0) ) - { - pb.ciPB.hFileInfo.ioNamePtr = NULL; - } - else - { - pb.ciPB.hFileInfo.ioNamePtr = (StringPtr)dstName; - } - /* don't copy the hasBeenInited bit */ - pb.ciPB.hFileInfo.ioFlFndrInfo.fdFlags = ( pb.ciPB.hFileInfo.ioFlFndrInfo.fdFlags & ~kHasBeenInited ); - error = PBSetCatInfoSync(&pb.ciPB); - if ( (error == noErr) && (copyLockBit) && ((pb.ciPB.hFileInfo.ioFlAttrib & kioFlAttribLockedMask) != 0) ) - { - pb.hPB.fileParam.ioFVersNum = 0; - error = PBHSetFLockSync(&pb.hPB); - if ( (error != noErr) && (objectIsDirectory) ) - { - error = noErr; /* ignore lock errors if destination is directory */ - } - } - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCopyFileMgrAttributes(const FSSpec *srcSpec, - const FSSpec *dstSpec, - Boolean copyLockBit) -{ - return ( CopyFileMgrAttributes(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name, - copyLockBit) ); -} - -/*****************************************************************************/ - -pascal OSErr HOpenAware(short vRefNum, - long dirID, - ConstStr255Param fileName, - short denyModes, - short *refNum) -{ - HParamBlockRec pb; - OSErr error; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize = sizeof(GetVolParmsInfoBuffer); - - pb.ioParam.ioMisc = NULL; - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioNamePtr = (StringPtr)fileName; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - - /* get volume attributes */ - /* this preflighting is needed because Foreign File Access based file systems don't */ - /* return the correct error result to the OpenDeny call */ - error = HGetVolParms(fileName, vRefNum, &volParmsInfo, &infoSize); - if ( (error == noErr) && hasOpenDeny(&volParmsInfo) ) - { - /* if volume supports OpenDeny, use it and return */ - pb.accessParam.ioDenyModes = denyModes; - error = PBHOpenDenySync(&pb); - *refNum = pb.ioParam.ioRefNum; - } - else if ( (error == noErr) || (error == paramErr) ) /* paramErr is OK, it just means this volume doesn't support GetVolParms */ - { - /* OpenDeny isn't supported, so try File Manager Open functions */ - - /* If request includes write permission, then see if the volume is */ - /* locked by hardware or software. The HFS file system doesn't check */ - /* for this when a file is opened - you only find out later when you */ - /* try to write and the write fails with a wPrErr or a vLckdErr. */ - - if ( (denyModes & dmWr) != 0 ) - { - error = CheckVolLock(fileName, vRefNum); - } - else - { - error = noErr; - } - - if ( error == noErr ) - { - /* Set File Manager permissions to closest thing possible */ - if ( (denyModes == dmWr) || (denyModes == dmRdWr) ) - { - pb.ioParam.ioPermssn = fsRdWrShPerm; - } - else - { - pb.ioParam.ioPermssn = denyModes % 4; - } - - error = PBHOpenDFSync(&pb); /* Try OpenDF */ - if ( error == paramErr ) - { - error = PBHOpenSync(&pb); /* OpenDF not supported, so try Open */ - } - *refNum = pb.ioParam.ioRefNum; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpOpenAware(const FSSpec *spec, - short denyModes, - short *refNum) -{ - return ( HOpenAware(spec->vRefNum, spec->parID, spec->name, denyModes, refNum) ); -} - -/*****************************************************************************/ - -pascal OSErr HOpenRFAware(short vRefNum, - long dirID, - ConstStr255Param fileName, - short denyModes, - short *refNum) -{ - HParamBlockRec pb; - OSErr error; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize = sizeof(GetVolParmsInfoBuffer); - - pb.ioParam.ioMisc = NULL; - pb.fileParam.ioFVersNum = 0; - pb.fileParam.ioNamePtr = (StringPtr)fileName; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioDirID = dirID; - - /* get volume attributes */ - /* this preflighting is needed because Foreign File Access based file systems don't */ - /* return the correct error result to the OpenRFDeny call */ - error = HGetVolParms(fileName, vRefNum, &volParmsInfo, &infoSize); - if ( (error == noErr) && hasOpenDeny(&volParmsInfo) ) - { - /* if volume supports OpenRFDeny, use it and return */ - if ( hasOpenDeny(&volParmsInfo) ) - { - pb.accessParam.ioDenyModes = denyModes; - error = PBHOpenRFDenySync(&pb); - *refNum = pb.ioParam.ioRefNum; - } - } - else if ( (error == noErr) || (error == paramErr) ) /* paramErr is OK, it just means this volume doesn't support GetVolParms */ - { - /* OpenRFDeny isn't supported, so try File Manager OpenRF function */ - - /* If request includes write permission, then see if the volume is */ - /* locked by hardware or software. The HFS file system doesn't check */ - /* for this when a file is opened - you only find out later when you */ - /* try to write and the write fails with a wPrErr or a vLckdErr. */ - - if ( (denyModes & dmWr) != 0 ) - { - error = CheckVolLock(fileName, vRefNum); - } - else - { - error = noErr; - } - - if ( error == noErr ) - { - /* Set File Manager permissions to closest thing possible */ - if ( (denyModes == dmWr) || (denyModes == dmRdWr) ) - { - pb.ioParam.ioPermssn = fsRdWrShPerm; - } - else - { - pb.ioParam.ioPermssn = denyModes % 4; - } - - error = PBHOpenRFSync(&pb); - *refNum = pb.ioParam.ioRefNum; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpOpenRFAware(const FSSpec *spec, - short denyModes, - short *refNum) -{ - return ( HOpenRFAware(spec->vRefNum, spec->parID, spec->name, denyModes, refNum) ); -} - -/*****************************************************************************/ - -pascal OSErr FSReadNoCache(short refNum, - long *count, - void *buffPtr) -{ - ParamBlockRec pb; - OSErr error; - - pb.ioParam.ioRefNum = refNum; - pb.ioParam.ioBuffer = (Ptr)buffPtr; - pb.ioParam.ioReqCount = *count; - pb.ioParam.ioPosMode = fsAtMark + noCacheMask; /* fsAtMark + noCacheMask */ - pb.ioParam.ioPosOffset = 0; - error = PBReadSync(&pb); - *count = pb.ioParam.ioActCount; /* always return count */ - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSWriteNoCache(short refNum, - long *count, - const void *buffPtr) -{ - ParamBlockRec pb; - OSErr error; - - pb.ioParam.ioRefNum = refNum; - pb.ioParam.ioBuffer = (Ptr)buffPtr; - pb.ioParam.ioReqCount = *count; - pb.ioParam.ioPosMode = fsAtMark + noCacheMask; /* fsAtMark + noCacheMask */ - pb.ioParam.ioPosOffset = 0; - error = PBWriteSync(&pb); - *count = pb.ioParam.ioActCount; /* always return count */ - return ( error ); -} - -/*****************************************************************************/ - -/* -** See if numBytes bytes of buffer1 are equal to buffer2. -*/ -static Boolean EqualMemory(const void *buffer1, const void *buffer2, unsigned long numBytes) -{ - register unsigned char *b1 = (unsigned char *)buffer1; - register unsigned char *b2 = (unsigned char *)buffer2; - - if ( b1 != b2 ) /* if buffer pointers are same, then they are equal */ - { - while ( numBytes > 0 ) - { - /* compare the bytes and then increment the pointers */ - if ( (*b1++ - *b2++) != 0 ) - { - return ( false ); - } - --numBytes; - } - } - - return ( true ); -} - -/*****************************************************************************/ - -/* -** Read any number of bytes from an open file using read-verify mode. -** The FSReadVerify function reads any number of bytes from an open file -** and verifies them against the data in the buffer pointed to by buffPtr. -** -** Because of a bug in the HFS file system, only non-block aligned parts of -** the read are verified against the buffer data and the rest is *copied* -** into the buffer. Thus, you shouldn't verify against your original data; -** instead, you should verify against a copy of the original data and then -** compare the read-verified copy against the original data after calling -** FSReadVerify. That's why this function isn't exported - it needs the -** wrapper provided by FSWriteVerify. -*/ -static OSErr FSReadVerify(short refNum, - long *count, - void *buffPtr) -{ - ParamBlockRec pb; - OSErr result; - - pb.ioParam.ioRefNum = refNum; - pb.ioParam.ioBuffer = (Ptr)buffPtr; - pb.ioParam.ioReqCount = *count; - pb.ioParam.ioPosMode = fsAtMark + rdVerify; - pb.ioParam.ioPosOffset = 0; - result = PBReadSync(&pb); - *count = pb.ioParam.ioActCount; /* always return count */ - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr FSWriteVerify(short refNum, - long *count, - const void *buffPtr) -{ - Ptr verifyBuffer; - long position; - long bufferSize; - long byteCount; - long bytesVerified; - Ptr startVerify; - OSErr result; - - /* - ** Allocate the verify buffer - ** Try to get get a large enough buffer to verify in one pass. - ** If that fails, use GetTempBuffer to get a buffer. - */ - bufferSize = *count; - verifyBuffer = NewPtr(bufferSize); - if ( verifyBuffer == NULL ) - { - verifyBuffer = GetTempBuffer(bufferSize, &bufferSize); - } - if ( verifyBuffer != NULL ) - { - /* Save the current position */ - result = GetFPos(refNum, &position); - if ( result == noErr ) - { - /* Write the data */ - result = FSWrite(refNum, count, buffPtr); - if ( result == noErr ) - { - /* Restore the original position */ - result = SetFPos(refNum, fsFromStart, position); - if ( result == noErr ) - { - /* - ** *count = total number of bytes to verify - ** bufferSize = the size of the verify buffer - ** bytesVerified = number of bytes verified - ** byteCount = number of bytes to verify this pass - ** startVerify = position in buffPtr - */ - bytesVerified = 0; - startVerify = (Ptr)buffPtr; - while ( (bytesVerified < *count) && ( result == noErr ) ) - { - if ( (*count - bytesVerified) > bufferSize ) - { - byteCount = bufferSize; - } - else - { - byteCount = *count - bytesVerified; - } - /* - ** Copy the write buffer into the verify buffer. - ** This step is needed because the File Manager - ** compares the data in any non-block aligned - ** data at the beginning and end of the read-verify - ** request back into the file system's cache - ** to the data in verify Buffer. However, the - ** File Manager does not compare any full blocks - ** and instead copies them into the verify buffer - ** so we still have to compare the buffers again - ** after the read-verify request completes. - */ - BlockMoveData(startVerify, verifyBuffer, byteCount); - - /* Read-verify the data back into the verify buffer */ - result = FSReadVerify(refNum, &byteCount, verifyBuffer); - if ( result == noErr ) - { - /* See if the buffers are the same */ - if ( !EqualMemory(verifyBuffer, startVerify, byteCount) ) - { - result = ioErr; - } - startVerify += byteCount; - bytesVerified += byteCount; - } - } - } - } - } - DisposePtr(verifyBuffer); - } - else - { - result = memFullErr; - } - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr CopyFork(short srcRefNum, - short dstRefNum, - void *copyBufferPtr, - long copyBufferSize) -{ - ParamBlockRec srcPB; - ParamBlockRec dstPB; - OSErr srcError; - OSErr dstError; - - if ( (copyBufferPtr == NULL) || (copyBufferSize == 0) ) - return ( paramErr ); - - srcPB.ioParam.ioRefNum = srcRefNum; - dstPB.ioParam.ioRefNum = dstRefNum; - - /* preallocate the destination fork and */ - /* ensure the destination fork's EOF is correct after the copy */ - srcError = PBGetEOFSync(&srcPB); - if ( srcError != noErr ) - return ( srcError ); - dstPB.ioParam.ioMisc = srcPB.ioParam.ioMisc; - dstError = PBSetEOFSync(&dstPB); - if ( dstError != noErr ) - return ( dstError ); - - /* reset source fork's mark */ - srcPB.ioParam.ioPosMode = fsFromStart; - srcPB.ioParam.ioPosOffset = 0; - srcError = PBSetFPosSync(&srcPB); - if ( srcError != noErr ) - return ( srcError ); - - /* reset destination fork's mark */ - dstPB.ioParam.ioPosMode = fsFromStart; - dstPB.ioParam.ioPosOffset = 0; - dstError = PBSetFPosSync(&dstPB); - if ( dstError != noErr ) - return ( dstError ); - - /* set up fields that won't change in the loop */ - srcPB.ioParam.ioBuffer = (Ptr)copyBufferPtr; - srcPB.ioParam.ioPosMode = fsAtMark + noCacheMask;/* fsAtMark + noCacheMask */ - /* If copyBufferSize is greater than 512 bytes, make it a multiple of 512 bytes */ - /* This will make writes on local volumes faster */ - if ( (copyBufferSize >= 512) && ((copyBufferSize & 0x1ff) != 0) ) - { - srcPB.ioParam.ioReqCount = copyBufferSize & 0xfffffe00; - } - else - { - srcPB.ioParam.ioReqCount = copyBufferSize; - } - dstPB.ioParam.ioBuffer = (Ptr)copyBufferPtr; - dstPB.ioParam.ioPosMode = fsAtMark + noCacheMask;/* fsAtMark + noCacheMask */ - - while ( (srcError == noErr) && (dstError == noErr) ) - { - srcError = PBReadSync(&srcPB); - dstPB.ioParam.ioReqCount = srcPB.ioParam.ioActCount; - dstError = PBWriteSync(&dstPB); - } - - /* make sure there were no errors at the destination */ - if ( dstError != noErr ) - return ( dstError ); - - /* make sure the only error at the source was eofErr */ - if ( srcError != eofErr ) - return ( srcError ); - - return ( noErr ); -} - -/*****************************************************************************/ - -pascal OSErr GetFileLocation(short refNum, - short *vRefNum, - long *dirID, - StringPtr fileName) -{ - FCBPBRec pb; - OSErr error; - - pb.ioNamePtr = fileName; - pb.ioVRefNum = 0; - pb.ioRefNum = refNum; - pb.ioFCBIndx = 0; - error = PBGetFCBInfoSync(&pb); - if ( error == noErr ) - { - *vRefNum = pb.ioFCBVRefNum; - *dirID = pb.ioFCBParID; - } - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetFileLocation(short refNum, - FSSpec *spec) -{ - return ( GetFileLocation(refNum, &(spec->vRefNum), &(spec->parID), spec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr CopyDirectoryAccess(short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName) -{ - OSErr error; - GetVolParmsInfoBuffer infoBuffer; /* Where PBGetVolParms dumps its info */ - long dstServerAdr; /* AppleTalk server address of destination (if any) */ - long ownerID, groupID, accessRights; - long tempLong; - - /* See if destination supports directory access control */ - tempLong = sizeof(infoBuffer); - error = HGetVolParms(dstName, dstVRefNum, &infoBuffer, &tempLong); - if ( (error == noErr) && hasAccessCntl(&infoBuffer) ) - { - if ( hasAccessCntl(&infoBuffer) ) - { - dstServerAdr = infoBuffer.vMServerAdr; - - /* See if source supports directory access control and is on same server */ - tempLong = sizeof(infoBuffer); - error = HGetVolParms(srcName, srcVRefNum, &infoBuffer, &tempLong); - if ( error == noErr ) - { - if ( hasAccessCntl(&infoBuffer) && (dstServerAdr == infoBuffer.vMServerAdr) ) - { - /* both volumes support directory access control and they are */ - /* on same server, so copy the access information */ - error = HGetDirAccess(srcVRefNum, srcDirID, srcName, &ownerID, &groupID, &accessRights); - if ( error == noErr ) - { - error = HSetDirAccess(dstVRefNum, dstDirID, dstName, ownerID, groupID, accessRights); - } - } - else - { - /* destination doesn't support directory access control or */ - /* they volumes aren't on the same server */ - error = paramErr; - } - } - } - else - { - /* destination doesn't support directory access control */ - error = paramErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpCopyDirectoryAccess(const FSSpec *srcSpec, - const FSSpec *dstSpec) -{ - return ( CopyDirectoryAccess(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->vRefNum, dstSpec->parID, dstSpec->name) ); -} - -/*****************************************************************************/ - -pascal OSErr HMoveRenameCompat(short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstpathName, - ConstStr255Param copyName) -{ - OSErr error; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize; - short realVRefNum; - long realParID; - Str31 realName; - Boolean isDirectory; - long tempItemsDirID; - long uniqueTempDirID; - Str31 uniqueTempDirName; - unsigned short uniqueNameoverflow; - - /* Get volume attributes */ - infoSize = sizeof(GetVolParmsInfoBuffer); - error = HGetVolParms((StringPtr)srcName, vRefNum, &volParmsInfo, &infoSize); - if ( (error == noErr) && hasMoveRename(&volParmsInfo) ) - { - /* If volume supports move and rename, so use it and return */ - error = HMoveRename(vRefNum, srcDirID, srcName, dstDirID, dstpathName, copyName); - } - else if ( (error == noErr) || (error == paramErr) ) /* paramErr is OK, it just means this volume doesn't support GetVolParms */ - { - /* MoveRename isn't supported by this volume, so do it by hand */ - - /* If copyName isn't supplied, we can simply CatMove and return */ - if ( copyName == NULL ) - { - error = CatMove(vRefNum, srcDirID, srcName, dstDirID, dstpathName); - } - else - { - /* Renaming is required, so we have some work to do... */ - - /* Get the object's real name, real parent ID and real vRefNum */ - error = GetObjectLocation(vRefNum, srcDirID, (StringPtr)srcName, - &realVRefNum, &realParID, realName, &isDirectory); - if ( error == noErr ) - { - /* Find the Temporary Items Folder on that volume */ - error = FindFolder(realVRefNum, kTemporaryFolderType, kCreateFolder, - &realVRefNum, &tempItemsDirID); - if ( error == noErr ) - { - /* Create a new uniquely named folder in the temporary items folder. */ - /* This is done to avoid the case where 'realName' or 'copyName' already */ - /* exists in the temporary items folder. */ - - /* Start with current tick count as uniqueTempDirName */ - NumToString(TickCount(), uniqueTempDirName); - uniqueNameoverflow = 0; - do - { - error = DirCreate(realVRefNum, tempItemsDirID, uniqueTempDirName, &uniqueTempDirID); - if ( error == dupFNErr ) - { - /* Duplicate name - change the first character to the next ASCII character */ - ++uniqueTempDirName[1]; - /* Make sure it isn't a colon! */ - if ( uniqueTempDirName[1] == ':' ) - { - ++uniqueTempDirName[1]; - } - /* Don't go too far... */ - ++uniqueNameoverflow; - } - } while ( (error == dupFNErr) && (uniqueNameoverflow <= 64) ); /* 64 new files per 1/60th second - not likely! */ - if ( error == noErr ) - { - /* Move the object to the folder with uniqueTempDirID for renaming */ - error = CatMove(realVRefNum, realParID, realName, uniqueTempDirID, NULL); - if ( error == noErr ) - { - /* Rename the object */ - error = HRename(realVRefNum, uniqueTempDirID, realName, copyName); - if ( error == noErr ) - { - /* Move object to its new home */ - error = CatMove(realVRefNum, uniqueTempDirID, copyName, dstDirID, dstpathName); - if ( error != noErr ) - { - /* Error handling: rename object back to original name - ignore errors */ - (void) HRename(realVRefNum, uniqueTempDirID, copyName, realName); - } - } - if ( error != noErr ) - { - /* Error handling: move object back to original location - ignore errors */ - (void) CatMove(realVRefNum, uniqueTempDirID, realName, realParID, NULL); - } - } - /* Done with ourTempDir, so delete it - ignore errors */ - (void) HDelete(realVRefNum, uniqueTempDirID, NULL); - } - } - } - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpMoveRenameCompat(const FSSpec *srcSpec, - const FSSpec *dstSpec, - ConstStr255Param copyName) -{ - /* make sure the FSSpecs refer to the same volume */ - if (srcSpec->vRefNum != dstSpec->vRefNum) - return (diffVolErr); - return ( HMoveRenameCompat(srcSpec->vRefNum, srcSpec->parID, srcSpec->name, - dstSpec->parID, dstSpec->name, copyName) ); -} - -/*****************************************************************************/ - -pascal OSErr BuildAFPVolMountInfo(short flags, - char nbpInterval, - char nbpCount, - short uamType, - Str32 zoneName, - Str32 serverName, - Str27 volName, - Str31 userName, - Str8 userPassword, - Str8 volPassword, - AFPVolMountInfoPtr *afpInfoPtr) -{ - MyAFPVolMountInfoPtr infoPtr; - OSErr error; - - /* Allocate the AFPXVolMountInfo record */ - infoPtr = (MyAFPVolMountInfoPtr)NewPtrClear(sizeof(MyAFPVolMountInfo)); - if ( infoPtr != NULL ) - { - /* Fill in an AFPVolMountInfo record that can be passed to VolumeMount */ - infoPtr->length = sizeof(MyAFPVolMountInfo); - infoPtr->media = AppleShareMediaType; - infoPtr->flags = flags; - infoPtr->nbpInterval = nbpInterval; - infoPtr->nbpCount = nbpCount; - infoPtr->uamType = uamType; - - infoPtr->zoneNameOffset = offsetof(MyAFPVolMountInfo, zoneName); - infoPtr->serverNameOffset = offsetof(MyAFPVolMountInfo, serverName); - infoPtr->volNameOffset = offsetof(MyAFPVolMountInfo, volName); - infoPtr->userNameOffset = offsetof(MyAFPVolMountInfo, userName); - infoPtr->userPasswordOffset = offsetof(MyAFPVolMountInfo, userPassword); - infoPtr->volPasswordOffset = offsetof(MyAFPVolMountInfo, volPassword); - - BlockMoveData(zoneName, infoPtr->zoneName, sizeof(Str32)); - BlockMoveData(serverName, infoPtr->serverName, sizeof(Str32)); - BlockMoveData(volName, infoPtr->volName, sizeof(Str27)); - BlockMoveData(userName, infoPtr->userName, sizeof(Str31)); - BlockMoveData(userPassword, infoPtr->userPassword, sizeof(Str8)); - BlockMoveData(volPassword, infoPtr->volPassword, sizeof(Str8)); - - *afpInfoPtr = (AFPVolMountInfoPtr)infoPtr; - error = noErr; - } - else - { - error = memFullErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr, - short *flags, - short *uamType, - StringPtr zoneName, - StringPtr serverName, - StringPtr volName, - StringPtr userName) -{ - StringPtr tempPtr; - OSErr error; - - /* Retrieve the AFP mounting information from an AFPVolMountInfo record. */ - if ( afpInfoPtr->media == AppleShareMediaType ) - { - *flags = afpInfoPtr->flags; - *uamType = afpInfoPtr->uamType; - - if ( afpInfoPtr->zoneNameOffset != 0) - { - tempPtr = (StringPtr)((long)afpInfoPtr + afpInfoPtr->zoneNameOffset); - BlockMoveData(tempPtr, zoneName, tempPtr[0] + 1); - } - - if ( afpInfoPtr->serverNameOffset != 0) - { - tempPtr = (StringPtr)((long)afpInfoPtr + afpInfoPtr->serverNameOffset); - BlockMoveData(tempPtr, serverName, tempPtr[0] + 1); - } - - if ( afpInfoPtr->volNameOffset != 0) - { - tempPtr = (StringPtr)((long)afpInfoPtr + afpInfoPtr->volNameOffset); - BlockMoveData(tempPtr, volName, tempPtr[0] + 1); - } - - if ( afpInfoPtr->userNameOffset != 0) - { - tempPtr = (StringPtr)((long)afpInfoPtr + afpInfoPtr->userNameOffset); - BlockMoveData(tempPtr, userName, tempPtr[0] + 1); - } - - error = noErr; - } - else - { - error = paramErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr BuildAFPXVolMountInfo(short flags, - char nbpInterval, - char nbpCount, - short uamType, - Str32 zoneName, - Str32 serverName, - Str27 volName, - Str31 userName, - Str8 userPassword, - Str8 volPassword, - Str32 uamName, - unsigned long alternateAddressLength, - void *alternateAddress, - AFPXVolMountInfoPtr *afpXInfoPtr) -{ - Size infoSize; - MyAFPXVolMountInfoPtr infoPtr; - OSErr error; - - /* Calculate the size of the AFPXVolMountInfo record */ - infoSize = sizeof(MyAFPXVolMountInfo) + alternateAddressLength - 1; - - /* Allocate the AFPXVolMountInfo record */ - infoPtr = (MyAFPXVolMountInfoPtr)NewPtrClear(infoSize); - if ( infoPtr != NULL ) - { - /* Fill in an AFPXVolMountInfo record that can be passed to VolumeMount */ - infoPtr->length = infoSize; - infoPtr->media = AppleShareMediaType; - infoPtr->flags = flags; - if ( alternateAddressLength != 0 ) - { - /* make sure the volMountExtendedFlagsBit is set if there's extended address info */ - infoPtr->flags |= volMountExtendedFlagsMask; - /* and set the only extendedFlags bit we know about */ - infoPtr->extendedFlags = kAFPExtendedFlagsAlternateAddressMask; - } - else - { - /* make sure the volMountExtendedFlagsBit is clear if there's no extended address info */ - infoPtr->flags &= ~volMountExtendedFlagsMask; - /* and clear the extendedFlags */ - infoPtr->extendedFlags = 0; - } - infoPtr->nbpInterval = nbpInterval; - infoPtr->nbpCount = nbpCount; - infoPtr->uamType = uamType; - - infoPtr->zoneNameOffset = offsetof(MyAFPXVolMountInfo, zoneName); - infoPtr->serverNameOffset = offsetof(MyAFPXVolMountInfo, serverName); - infoPtr->volNameOffset = offsetof(MyAFPXVolMountInfo, volName); - infoPtr->userNameOffset = offsetof(MyAFPXVolMountInfo, userName); - infoPtr->userPasswordOffset = offsetof(MyAFPXVolMountInfo, userPassword); - infoPtr->volPasswordOffset = offsetof(MyAFPXVolMountInfo, volPassword); - infoPtr->uamNameOffset = offsetof(MyAFPXVolMountInfo, uamName); - infoPtr->alternateAddressOffset = offsetof(MyAFPXVolMountInfo, alternateAddress); - - BlockMoveData(zoneName, infoPtr->zoneName, sizeof(Str32)); - BlockMoveData(serverName, infoPtr->serverName, sizeof(Str32)); - BlockMoveData(volName, infoPtr->volName, sizeof(Str27)); - BlockMoveData(userName, infoPtr->userName, sizeof(Str31)); - BlockMoveData(userPassword, infoPtr->userPassword, sizeof(Str8)); - BlockMoveData(volPassword, infoPtr->volPassword, sizeof(Str8)); - BlockMoveData(uamName, infoPtr->uamName, sizeof(Str32)); - BlockMoveData(alternateAddress, infoPtr->alternateAddress, alternateAddressLength); - - *afpXInfoPtr = (AFPXVolMountInfoPtr)infoPtr; - error = noErr; - } - else - { - error = memFullErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr, - short *flags, - short *uamType, - StringPtr zoneName, - StringPtr serverName, - StringPtr volName, - StringPtr userName, - StringPtr uamName, - unsigned long *alternateAddressLength, - AFPAlternateAddress **alternateAddress) -{ - StringPtr tempPtr; - Ptr alternateAddressStart; - Ptr alternateAddressEnd; - Size alternateAddressDataSize; - OSErr error; - UInt8 addressCount; - - /* Retrieve the AFP mounting information from an AFPVolMountInfo record. */ - if ( afpXInfoPtr->media == AppleShareMediaType ) - { - /* default to noErr */ - error = noErr; - - /* Is this an extended record? */ - if ( (afpXInfoPtr->flags & volMountExtendedFlagsMask) != 0 ) - { - if ( ((afpXInfoPtr->extendedFlags & kAFPExtendedFlagsAlternateAddressMask) != 0) && - (afpXInfoPtr->alternateAddressOffset != 0) ) - { - - alternateAddressStart = (Ptr)((long)afpXInfoPtr + afpXInfoPtr->alternateAddressOffset); - alternateAddressEnd = alternateAddressStart + 1; /* skip over alternate address version byte */ - addressCount = *(UInt8*)alternateAddressEnd; /* get the address count */ - ++alternateAddressEnd; /* skip over alternate address count byte */ - /* alternateAddressEnd now equals &AFPAlternateAddress.fAddressList[0] */ - while ( addressCount != 0 ) - { - /* parse the address list to find the end */ - alternateAddressEnd += *(UInt8*)alternateAddressEnd; /* add length of each AFPTagData record */ - --addressCount; - } - /* get the size of the alternateAddressData */ - alternateAddressDataSize = alternateAddressEnd - alternateAddressStart; - /* allocate memory for it */ - *alternateAddress = (AFPAlternateAddress *)NewPtr(alternateAddressDataSize); - if ( *alternateAddress != NULL ) - { - /* and return the data */ - BlockMoveData(alternateAddressStart, *alternateAddress, alternateAddressDataSize); - *alternateAddressLength = alternateAddressDataSize; - } - else - { - /* no memory - fail now */ - error = memFullErr; - } - } - - if ( error == noErr ) /* fill in more output parameters if everything is OK */ - { - if ( afpXInfoPtr->uamNameOffset != 0 ) - { - tempPtr = (StringPtr)((long)afpXInfoPtr + afpXInfoPtr->uamNameOffset); - BlockMoveData(tempPtr, uamName, tempPtr[0] + 1); - } - } - } - - if ( error == noErr ) /* fill in more output parameters if everything is OK */ - { - *flags = afpXInfoPtr->flags; - *uamType = afpXInfoPtr->uamType; - - if ( afpXInfoPtr->zoneNameOffset != 0 ) - { - tempPtr = (StringPtr)((long)afpXInfoPtr + afpXInfoPtr->zoneNameOffset); - BlockMoveData(tempPtr, zoneName, tempPtr[0] + 1); - } - - if ( afpXInfoPtr->serverNameOffset != 0 ) - { - tempPtr = (StringPtr)((long)afpXInfoPtr + afpXInfoPtr->serverNameOffset); - BlockMoveData(tempPtr, serverName, tempPtr[0] + 1); - } - - if ( afpXInfoPtr->volNameOffset != 0 ) - { - tempPtr = (StringPtr)((long)afpXInfoPtr + afpXInfoPtr->volNameOffset); - BlockMoveData(tempPtr, volName, tempPtr[0] + 1); - } - - if ( afpXInfoPtr->userNameOffset != 0 ) - { - tempPtr = (StringPtr)((long)afpXInfoPtr + afpXInfoPtr->userNameOffset); - BlockMoveData(tempPtr, userName, tempPtr[0] + 1); - } - } - } - else - { - error = paramErr; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetUGEntries(short objType, - UGEntryPtr entries, - long reqEntryCount, - long *actEntryCount, - long *objID) -{ - HParamBlockRec pb; - OSErr error = noErr; - UGEntry *endEntryArray; - - pb.objParam.ioObjType = objType; - *actEntryCount = 0; - for ( endEntryArray = entries + reqEntryCount; (entries < endEntryArray) && (error == noErr); ++entries ) - { - pb.objParam.ioObjNamePtr = (StringPtr)entries->name; - pb.objParam.ioObjID = *objID; - /* Files.h in the universal interfaces, PBGetUGEntrySync takes a CMovePBPtr */ - /* as the parameter. Inside Macintosh and the original glue used HParmBlkPtr. */ - /* A CMovePBPtr works OK, but this will be changed in the future back to */ - /* HParmBlkPtr, so I'm just casting it here. */ - error = PBGetUGEntrySync(&pb); - if ( error == noErr ) - { - entries->objID = *objID = pb.objParam.ioObjID; - entries->objType = objType; - ++*actEntryCount; - } - } - - return ( error ); -} - -/*****************************************************************************/ - diff --git a/src/mac/classic/morefile/MoreFilesExtras.h b/src/mac/classic/morefile/MoreFilesExtras.h deleted file mode 100644 index 285dfa7977..0000000000 --- a/src/mac/classic/morefile/MoreFilesExtras.h +++ /dev/null @@ -1,3597 +0,0 @@ -/* - File: MoreFilesExtras.h - - Contains: A collection of useful high-level File Manager routines. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __MOREFILESEXTRAS__ -#define __MOREFILESEXTRAS__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -/* -** Bit masks and macros to get common information out of ioACUser returned -** by PBGetCatInfo (remember to clear ioACUser before calling PBGetCatInfo -** since some file systems don't bother to set this field). -** -** Use the GetDirAccessRestrictions or FSpGetDirAccessRestrictions -** functions to retrieve the ioACUser access restrictions byte for -** a folder. -** -** Note: The access restriction byte returned by PBGetCatInfo is the -** 2's complement of the user's privileges byte returned in -** ioACAccess by PBHGetDirAccess. -*/ - -enum { - /* mask for just the access restriction bits */ - acUserAccessMask = (kioACUserNoSeeFolderMask + kioACUserNoSeeFilesMask + kioACUserNoMakeChangesMask), /* common access privilege settings */ - acUserFull = 0x00, /* no access restiction bits on */ - acUserNone = acUserAccessMask, /* all access restiction bits on */ - acUserDropBox = kioACUserNoSeeFolderMask + kioACUserNoSeeFilesMask, /* make changes, but not see files or folders */ - acUserBulletinBoard = kioACUserNoMakeChangesMask /* see files and folders, but not make changes */ -}; - - -/*****************************************************************************/ - -/* -** Deny mode permissions for use with the HOpenAware, HOpenRFAware, -** FSpOpenAware, and FSpOpenRFAware functions. -** Note: Common settings are the ones with comments. -*/ - -enum { - dmNone = 0x0000, - dmNoneDenyRd = fsRdDenyPerm, - dmNoneDenyWr = fsWrDenyPerm, - dmNoneDenyRdWr = (fsRdDenyPerm + fsWrDenyPerm), - dmRd = fsRdPerm, /* Single writer, multiple readers; the readers */ - dmRdDenyRd = (fsRdPerm + fsRdDenyPerm), - dmRdDenyWr = (fsRdPerm + fsWrDenyPerm), /* Browsing - equivalent to fsRdPerm */ - dmRdDenyRdWr = (fsRdPerm + fsRdDenyPerm + fsWrDenyPerm), - dmWr = fsWrPerm, - dmWrDenyRd = (fsWrPerm + fsRdDenyPerm), - dmWrDenyWr = (fsWrPerm + fsWrDenyPerm), - dmWrDenyRdWr = (fsWrPerm + fsRdDenyPerm + fsWrDenyPerm), - dmRdWr = fsRdWrPerm, /* Shared access - equivalent to fsRdWrShPerm */ - dmRdWrDenyRd = (fsRdWrPerm + fsRdDenyPerm), - dmRdWrDenyWr = (fsRdWrPerm + fsWrDenyPerm), /* Single writer, multiple readers; the writer */ - dmRdWrDenyRdWr = (fsRdWrPerm + fsRdDenyPerm + fsWrDenyPerm) /* Exclusive access - equivalent to fsRdWrPerm */ -}; - - -/*****************************************************************************/ - -/* -** For those times where you need to use more than one kind of File Manager parameter -** block but don't feel like wasting stack space, here's a parameter block you can reuse. -*/ - - -union UniversalFMPB { - ParamBlockRec PB; - CInfoPBRec ciPB; - DTPBRec dtPB; - HParamBlockRec hPB; - CMovePBRec cmPB; - WDPBRec wdPB; - FCBPBRec fcbPB; - XVolumeParam xPB; -}; -typedef union UniversalFMPB UniversalFMPB; -typedef UniversalFMPB * UniversalFMPBPtr; -typedef UniversalFMPBPtr * UniversalFMPBHandle; - -/* -** Used by GetUGEntries to return user or group lists -*/ - -struct UGEntry { - short objType; /* object type: -1 = group; 0 = user */ - long objID; /* the user or group ID */ - Str31 name; /* the user or group name */ -}; -typedef struct UGEntry UGEntry; -typedef UGEntry * UGEntryPtr; -typedef UGEntryPtr * UGEntryHandle; - -/* -** I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h -*/ -typedef unsigned char Str8[9]; - -struct MyAFPVolMountInfo { - short length; /* length of this record */ - VolumeType media; /* type of media, always AppleShareMediaType */ - short flags; /* 0 = normal mount; set bit 0 to inhibit greeting messages */ - char nbpInterval; /* NBP interval parameter; 7 is a good choice */ - char nbpCount; /* NBP count parameter; 5 is a good choice */ - short uamType; /* User Authentication Method */ - short zoneNameOffset; /* offset from start of record to zoneName */ - short serverNameOffset; /* offset from start of record to serverName */ - short volNameOffset; /* offset from start of record to volName */ - short userNameOffset; /* offset from start of record to userName */ - short userPasswordOffset; /* offset from start of record to userPassword */ - short volPasswordOffset; /* offset from start of record to volPassword */ - Str32 zoneName; /* server's AppleTalk zone name */ - char filler1; /* to word align volPassword */ - Str32 serverName; /* server name */ - char filler2; /* to word align volPassword */ - Str27 volName; /* volume name */ - Str31 userName; /* user name (zero length Pascal string for guest) */ - Str8 userPassword; /* user password (zero length Pascal string if no user password) */ - char filler3; /* to word align volPassword */ - Str8 volPassword; /* volume password (zero length Pascal string if no volume password) */ - char filler4; /* to end record on word boundry */ -}; -typedef struct MyAFPVolMountInfo MyAFPVolMountInfo; -typedef MyAFPVolMountInfo * MyAFPVolMountInfoPtr; -typedef MyAFPVolMountInfoPtr * MyAFPVolMountInfoHandle; - -struct MyAFPXVolMountInfo { - short length; /* length of this record */ - VolumeType media; /* type of media, always AppleShareMediaType */ - short flags; /* bits for no messages, no reconnect, etc */ - char nbpInterval; /* NBP interval parameter; 7 is a good choice */ - char nbpCount; /* NBP count parameter; 5 is a good choice */ - short uamType; /* User Authentication Method */ - short zoneNameOffset; /* offset from start of record to zoneName */ - short serverNameOffset; /* offset from start of record to serverName */ - short volNameOffset; /* offset from start of record to volName */ - short userNameOffset; /* offset from start of record to userName */ - short userPasswordOffset; /* offset from start of record to userPassword */ - short volPasswordOffset; /* offset from start of record to volPassword */ - short extendedFlags; /* extended flags word */ - short uamNameOffset; /* offset to a pascal UAM name string */ - short alternateAddressOffset; /* offset to Alternate Addresses in tagged format */ - Str32 zoneName; /* server's AppleTalk zone name */ - char filler1; /* to word align volPassword */ - Str32 serverName; /* server name */ - char filler2; /* to word align volPassword */ - Str27 volName; /* volume name */ - Str31 userName; /* user name (zero length Pascal string for guest) */ - Str8 userPassword; /* user password (zero length Pascal string if no user password) */ - char filler3; /* to word align volPassword */ - Str8 volPassword; /* volume password (zero length Pascal string if no volume password) */ - char filler4; /* to word align uamNameOffset */ - Str32 uamName; /* UAM name */ - char filler5; /* to word align alternateAddress */ - char alternateAddress[1]; /* AFPAlternateAddress */ -}; -typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo; -typedef MyAFPXVolMountInfo * MyAFPXVolMountInfoPtr; -typedef MyAFPXVolMountInfoPtr * MyAFPXVolMountInfoHandle; - -/*****************************************************************************/ - -/* Functions to get information out of GetVolParmsInfoBuffer. */ - -/* version 1 field getters */ - -EXTERN_API( short ) -GetVolParmsInfoVersion(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( long ) -GetVolParmsInfoAttrib(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Handle ) -GetVolParmsInfoLocalHand(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( long ) -GetVolParmsInfoServerAdr(const GetVolParmsInfoBuffer * volParms); - - - -/* version 2 field getters (assume zero result if version < 2) */ - -EXTERN_API( long ) -GetVolParmsInfoVolumeGrade(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( long ) -GetVolParmsInfoForeignPrivID(const GetVolParmsInfoBuffer * volParms); - - - -/* version 3 field getters (assume zero result if version < 3) */ - -EXTERN_API( long ) -GetVolParmsInfoExtendedAttributes(const GetVolParmsInfoBuffer * volParms); - - - -/* attribute bits supported by all versions of GetVolParmsInfoBuffer */ - -EXTERN_API( Boolean ) -isNetworkVolume(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasLimitFCBs(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasLocalWList(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoMiniFndr(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoVNEdit(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoLclSync(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasTrshOffLine(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoSwitchTo(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoDeskItems(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoBootBlks(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasAccessCntl(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasNoSysDir(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasExtFSVol(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasOpenDeny(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasCopyFile(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasMoveRename(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasDesktopMgr(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasShortName(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasFolderLock(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasPersonalAccessPrivileges(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasUserGroupList(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasCatSearch(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasFileIDs(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasBTreeMgr(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -hasBlankAccessPrivileges(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -supportsAsyncRequests(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -supportsTrashVolumeCache(const GetVolParmsInfoBuffer * volParms); - - - -/* attribute bits supported by version 3 and greater versions of GetVolParmsInfoBuffer */ - -EXTERN_API( Boolean ) -volIsEjectable(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsHFSPlusAPIs(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsFSCatalogSearch(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsFSExchangeObjects(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupports2TBFiles(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsLongNames(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsMultiScriptNames(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsNamedForks(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volSupportsSubtreeIterators(const GetVolParmsInfoBuffer * volParms); - - -EXTERN_API( Boolean ) -volL2PCanMapFileBlocks(const GetVolParmsInfoBuffer * volParms); - - - -/*****************************************************************************/ - -/* Functions for testing ioACUser bits. */ - -EXTERN_API( Boolean ) -userIsOwner(SInt8 ioACUser); - - -EXTERN_API( Boolean ) -userHasFullAccess(SInt8 ioACUser); - - -EXTERN_API( Boolean ) -userHasDropBoxAccess(SInt8 ioACUser); - - -EXTERN_API( Boolean ) -userHasBulletinBoard(SInt8 ioACUser); - - -EXTERN_API( Boolean ) -userHasNoAccess(SInt8 ioACUser); - - - -/*****************************************************************************/ - -EXTERN_API( void ) -TruncPString( - StringPtr destination, - ConstStr255Param source, - short maxLength); - - -/* - The TruncPString function copies up to maxLength characters from - the source Pascal string to the destination Pascal string. TruncPString - ensures that the truncated string ends on a single-byte character, or on - the last byte of a multi-byte character. - - destination output: destination Pascal string. - source input: source Pascal string. - maxLength output: The maximum allowable length of the destination - string. -*/ - -/*****************************************************************************/ - -EXTERN_API( Ptr ) -GetTempBuffer( - long buffReqSize, - long * buffActSize); - - -/* - The GetTempBuffer function allocates a temporary buffer for file system - operations which is at least 1024 bytes (1K) and a multiple of - 1024 bytes. - - buffReqSize input: Size you'd like the buffer to be. - buffActSize output: Size of buffer allocated. - function result output: Pointer to memory allocated or nil if no memory - was available. The caller is responsible for - disposing of this buffer with DisposePtr. -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetVolumeInfoNoName( - ConstStr255Param pathname, - short vRefNum, - HParmBlkPtr pb); - - -/* - GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync - in cases where the returned volume name is not needed by the caller. - The pathname and vRefNum parameters are not touched, and the pb - parameter is initialized by PBHGetVInfoSync except that ioNamePtr in - the parameter block is always returned as NULL (since it might point - to GetVolumeInfoNoName's local variable tempPathname). - - I noticed using this code in several places, so here it is once. - This reduces the code size of MoreFiles. - - pathName input: Pointer to a full pathname or nil. If you pass in a - partial pathname, it is ignored. A full pathname to a - volume must end with a colon character (:). - vRefNum input: Volume specification (volume reference number, working - directory number, drive number, or 0). - pb input: A pointer to HParamBlockRec. - output: The parameter block as filled in by PBHGetVInfoSync - except that ioNamePtr will always be NULL. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume, or pb was NULL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -XGetVolumeInfoNoName( - ConstStr255Param pathname, - short vRefNum, - XVolumeParamPtr pb); - - -/* - XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync - in cases where the returned volume name is not needed by the caller. - The pathname and vRefNum parameters are not touched, and the pb - parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in - the parameter block is always returned as NULL (since it might point - to XGetVolumeInfoNoName's local variable tempPathname). - - pathName input: Pointer to a full pathname or nil. If you pass in a - partial pathname, it is ignored. A full pathname to a - volume must end with a colon character (:). - vRefNum input: Volume specification (volume reference number, working - directory number, drive number, or 0). - pb input: A pointer to HParamBlockRec. - output: The parameter block as filled in by PBXGetVolInfoSync - except that ioNamePtr will always be NULL. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume, or pb was NULL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetCatInfoNoName( - short vRefNum, - long dirID, - ConstStr255Param name, - CInfoPBPtr pb); - - -/* - GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync - in cases where the returned object is not needed by the caller. - The vRefNum, dirID and name parameters are not touched, and the pb - parameter is initialized by PBGetCatInfoSync except that ioNamePtr in - the parameter block is always returned as NULL (since it might point - to GetCatInfoNoName's local variable tempName). - - I noticed using this code in several places, so here it is once. - This reduces the code size of MoreFiles. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - pb input: A pointer to CInfoPBRec. - output: The parameter block as filled in by - PBGetCatInfoSync except that ioNamePtr will - always be NULL. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DetermineVRefNum( - ConstStr255Param pathname, - short vRefNum, - short * realVRefNum); - - -/* - The DetermineVRefNum function determines the volume reference number of - a volume from a pathname, a volume specification, or a combination - of the two. - WARNING: Volume names on the Macintosh are *not* unique -- Multiple - mounted volumes can have the same name. For this reason, the use of a - volume name or full pathname to identify a specific volume may not - produce the results you expect. If more than one volume has the same - name and a volume name or full pathname is used, the File Manager - currently uses the first volume it finds with a matching name in the - volume queue. - - pathName input: Pointer to a full pathname or nil. If you pass in a - partial pathname, it is ignored. A full pathname to a - volume must end with a colon character (:). - vRefNum input: Volume specification (volume reference number, working - directory number, drive number, or 0). - realVRefNum output: The real volume reference number. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HGetVInfo( - short volReference, - StringPtr volName, - short * vRefNum, - unsigned long * freeBytes, - unsigned long * totalBytes); - - -/* - The HGetVInfo function returns the name, volume reference number, - available space (in bytes), and total space (in bytes) for the - specified volume. You can specify the volume by providing its drive - number, volume reference number, or 0 for the default volume. - This routine is compatible with volumes up to 4 gigabytes. - - volReference input: The drive number, volume reference number, - or 0 for the default volume. - volName input: A pointer to a buffer (minimum Str27) where - the volume name is to be returned or must - be nil. - output: The volume name. - vRefNum output: The volume reference number. - freeBytes output: The number of free bytes on the volume. - freeBytes is an unsigned long value. - totalBytes output: The total number of bytes on the volume. - totalBytes is an unsigned long value. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume - - __________ - - Also see: XGetVInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -XGetVInfo( - short volReference, - StringPtr volName, - short * vRefNum, - UInt64 * freeBytes, - UInt64 * totalBytes); - - -/* - The XGetVInfo function returns the name, volume reference number, - available space (in bytes), and total space (in bytes) for the - specified volume. You can specify the volume by providing its drive - number, volume reference number, or 0 for the default volume. - This routine is compatible with volumes up to 2 terabytes. - - volReference input: The drive number, volume reference number, - or 0 for the default volume. - volName input: A pointer to a buffer (minimum Str27) where - the volume name is to be returned or must - be nil. - output: The volume name. - vRefNum output: The volume reference number. - freeBytes output: The number of free bytes on the volume. - freeBytes is an UnsignedWide value. - totalBytes output: The total number of bytes on the volume. - totalBytes is an UnsignedWide value. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume - - __________ - - Also see: HGetVInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CheckVolLock( - ConstStr255Param pathname, - short vRefNum); - - -/* - The CheckVolLock function determines if a volume is locked - either by - hardware or by software. If CheckVolLock returns noErr, then the volume - is not locked. - - pathName input: Pointer to a full pathname or nil. If you pass in a - partial pathname, it is ignored. A full pathname to a - volume must end with a colon character (:). - vRefNum input: Volume specification (volume reference number, working - directory number, drive number, or 0). - - Result Codes - noErr 0 No error - volume not locked - nsvErr -35 No such volume - wPrErr -44 Volume locked by hardware - vLckdErr -46 Volume locked by software - paramErr -50 No default volume -*/ - -/*****************************************************************************/ -/* -** The following routines call Mac OS routines that are not supported by -** Carbon: -** -** GetDriverName -** FindDrive -** GetDiskBlocks -** GetVolState -*/ - -#if !TARGET_API_MAC_CARBON // { - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetDriverName( - short driverRefNum, - Str255 driverName); - - -/* - The GetDriverName function returns a device driver's name. - - driverRefNum input: The driver reference number. - driverName output: The driver's name. - - Result Codes - noErr 0 No error - badUnitErr -21 Bad driver reference number -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FindDrive( - ConstStr255Param pathname, - short vRefNum, - DrvQElPtr * driveQElementPtr); - - -/* - The FindDrive function returns a pointer to a mounted volume's - drive queue element. - - pathName input: Pointer to a full pathname or nil. If you - pass in a partial pathname, it is ignored. - A full pathname to a volume must end with - a colon character (:). - vRefNum input: Volume specification (volume reference - number, working directory number, drive - number, or 0). - driveQElementPtr output: Pointer to a volume's drive queue element - in the drive queue. DO NOT change the - DrvQEl. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume - nsDrvErr -56 No such drive -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetDiskBlocks( - ConstStr255Param pathname, - short vRefNum, - unsigned long * numBlocks); - - -/* - The GetDiskBlocks function returns the number of physical disk - blocks on a disk drive. NOTE: This is not the same as volume - allocation blocks! - - pathName input: Pointer to a full pathname or nil. If you - pass in a partial pathname, it is ignored. - A full pathname to a volume must end with - a colon character (:). - vRefNum input: Volume specification (volume reference - number, working directory number, drive - number, or 0). - numBlocks output: The number of physical disk blocks on the disk drive. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume, driver reference - number is zero, ReturnFormatList - returned zero blocks, DriveStatus - returned an unknown value, or - driveQElementPtr->qType is unknown - nsDrvErr -56 No such drive - statusErr Ð18 Driver does not respond to this - status request - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies - a nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetVolState( - ConstStr255Param pathname, - short vRefNum, - Boolean * volumeOnline, - Boolean * volumeEjected, - Boolean * driveEjectable, - Boolean * driverWantsEject); - - -/* - The GetVolState function determines if a volume is online or offline, - if an offline volume is ejected, and if the volume's driver is - ejectable or wants eject calls. - - pathName input: Pointer to a full pathname or nil. - vRefNum input: Volume specification (volume reference number, - working directory number, drive number, or 0). - volumeOnline output: True if the volume is online; - False if the volume is offline. - volumeEjected output: True if the volume is ejected (ejected - volumes are always offline); False if the - volume is not ejected. - driveEjectable output: True if the volume's drive is ejectable; - False if the volume's drive is not ejectable. - driverWantsEject output: True if the volume's driver wants an Eject - request after unmount (even if the drive - is not ejectable); False if the volume's - driver does not need an eject request. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume, or pb was NULL -*/ - -/*****************************************************************************/ - -#endif // } !TARGET_API_MAC_CARBON - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetVolFileSystemID( - ConstStr255Param pathname, - short vRefNum, - short * fileSystemID); - - -/* - The GetVolFileSystemID function returned the file system ID of - a mounted volume. The file system ID identifies the file system - that handles requests to a particular volume. Here's a partial list - of file system ID numbers (only Apple's file systems are listed): - FSID File System - ----- ----------------------------------------------------- - $0000 Macintosh HFS or MFS - $0100 ProDOS File System - $0101 PowerTalk Mail Enclosures - $4147 ISO 9660 File Access (through Foreign File Access) - $4242 High Sierra File Access (through Foreign File Access) - $464D QuickTake File System (through Foreign File Access) - $4953 Macintosh PC Exchange (MS-DOS) - $4A48 Audio CD Access (through Foreign File Access) - $4D4B Apple Photo Access (through Foreign File Access) - - See the Technical Note "FL 35 - Determining Which File System - Is Active" and the "Guide to the File System Manager" for more - information. - - pathName input: Pointer to a full pathname or nil. If you pass - in a partial pathname, it is ignored. A full - pathname to a volume must contain at least - one colon character (:) and must not start with - a colon character. - vRefNum input: Volume specification (volume reference number, - working directory number, drive number, or 0). - fileSystemID output: The volume's file system ID. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - paramErr -50 No default volume, or pb was NULL -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -UnmountAndEject( - ConstStr255Param pathname, - short vRefNum); - - -/* - The UnmountAndEject function unmounts and ejects a volume. The volume - is ejected only if it is ejectable and not already ejected. - - pathName input: Pointer to a full pathname or nil. If you pass in a - partial pathname, it is ignored. A full pathname to a - volume must end with a colon character (:). - vRefNum input: Volume specification (volume reference number, working - directory number, drive number, or 0). - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad volume name - fBsyErr -47 One or more files are open - paramErr -50 No default volume - nsDrvErr -56 No such drive - extFSErr -58 External file system error - no file - system claimed this call. -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -OnLine( - FSSpecPtr volumes, - short reqVolCount, - short * actVolCount, - short * volIndex); - - -/* - The OnLine function returns the list of volumes currently mounted in - an array of FSSpec records. - - A noErr result indicates that the volumes array was filled - (actVolCount == reqVolCount) and there may be additional volumes - mounted. A nsvErr result indicates that the end of the volume list - was found and actVolCount volumes were actually found this time. - - volumes input: Pointer to array of FSSpec where the volume list - is returned. - reqVolCount input: Maximum number of volumes to return (the number of - elements in the volumes array). - actVolCount output: The number of volumes actually returned. - volIndex input: The current volume index position. Set to 1 to - start with the first volume. - output: The volume index position to get the next volume. - Pass this value the next time you call OnLine to - start where you left off. - - Result Codes - noErr 0 No error, but there are more volumes - to list - nsvErr -35 No more volumes to be listed - paramErr -50 volIndex was <= 0 -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetDefault( - short newVRefNum, - long newDirID, - short * oldVRefNum, - long * oldDirID); - - -/* - The SetDefault function sets the default volume and directory to the - volume specified by newVRefNum and the directory specified by newDirID. - The current default volume reference number and directory ID are - returned in oldVRefNum and oldDir and must be used to restore the - default volume and directory to their previous state *as soon as - possible* with the RestoreDefault function. These two functions are - designed to be used as a wrapper around Standard I/O routines where - the location of the file is implied to be the default volume and - directory. In other words, this is how you should use these functions: - - error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID); - if ( error == noErr ) - { - // call the Stdio functions like remove, rename, tmpfile, - // fopen, freopen, etc. or non-ANSI extensions like - // fdopen,fsetfileinfo, -- create, open, unlink, etc. here! - - error = RestoreDefault(oldVRefNum, oldDirID); - } - - By using these functions as a wrapper, you won't need to open a working - directory (because SetDefault and RestoreDefault use HSetVol) and you - won't have to worry about the effects of using HSetVol (documented in - Technical Note "FL 11 - PBHSetVol is Dangerous" and in the - Inside Macintosh: Files book in the description of the HSetVol and - PBHSetVol functions) because the default volume/directory is restored - before giving up control to code that might be affected by HSetVol. - - newVRefNum input: Volume specification (volume reference number, - working directory number, drive number, or 0) of - the new default volume. - newDirID input: Directory ID of the new default directory. - oldVRefNum output: The volume specification to save for use with - RestoreDefault. - oldDirID output: The directory ID to save for use with - RestoreDefault. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - bdNamErr -37 Bad volume name - fnfErr -43 Directory not found - paramErr -50 No default volume - afpAccessDenied -5000 User does not have access to the directory - - __________ - - Also see: RestoreDefault -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -RestoreDefault( - short oldVRefNum, - long oldDirID); - - -/* - The RestoreDefault function restores the default volume and directory - to the volume specified by oldVRefNum and the directory specified by - oldDirID. The oldVRefNum and oldDirID parameters were previously - obtained from the SetDefault function. These two functions are designed - to be used as a wrapper around Standard C I/O routines where the - location of the file is implied to be the default volume and directory. - In other words, this is how you should use these functions: - - error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID); - if ( error == noErr ) - { - // call the Stdio functions like remove, rename, tmpfile, - // fopen, freopen, etc. or non-ANSI extensions like - // fdopen,fsetfileinfo, -- create, open, unlink, etc. here! - - error = RestoreDefault(oldVRefNum, oldDirID); - } - - By using these functions as a wrapper, you won't need to open a working - directory (because SetDefault and RestoreDefault use HSetVol) and you - won't have to worry about the effects of using HSetVol (documented in - Technical Note "FL 11 - PBHSetVol is Dangerous" and in the - Inside Macintosh: Files book in the description of the HSetVol and - PBHSetVol functions) because the default volume/directory is restored - before giving up control to code that might be affected by HSetVol. - - oldVRefNum input: The volume specification to restore. - oldDirID input: The directory ID to restore. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - bdNamErr -37 Bad volume name - fnfErr -43 Directory not found - paramErr -50 No default volume - rfNumErr -51 Bad working directory reference number - afpAccessDenied -5000 User does not have access to the directory - - __________ - - Also see: SetDefault -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetDInfo( - short vRefNum, - long dirID, - ConstStr255Param name, - DInfo * fndrInfo); - - -/* - The GetDInfo function gets the finder information for a directory. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - fndrInfo output: If the object is a directory, then its DInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpGetDInfo, FSpGetFInfoCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetDInfo( - const FSSpec * spec, - DInfo * fndrInfo); - - -/* - The FSpGetDInfo function gets the finder information for a directory. - - spec input: An FSSpec record specifying the directory. - fndrInfo output: If the object is a directory, then its DInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpGetFInfoCompat, GetDInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetDInfo( - short vRefNum, - long dirID, - ConstStr255Param name, - const DInfo * fndrInfo); - - -/* - The SetDInfo function sets the finder information for a directory. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - fndrInfo input: The DInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpSetDInfo, FSpSetFInfoCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetDInfo( - const FSSpec * spec, - const DInfo * fndrInfo); - - -/* - The FSpSetDInfo function sets the finder information for a directory. - - spec input: An FSSpec record specifying the directory. - fndrInfo input: The DInfo. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpSetFInfoCompat, SetDInfo -*/ - -/*****************************************************************************/ - -#if OLDROUTINENAMES - #define GetDirID(vRefNum, dirID, name, theDirID, isDirectory) GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory) -#endif -EXTERN_API( OSErr ) -GetDirectoryID( - short vRefNum, - long dirID, - ConstStr255Param name, - long * theDirID, - Boolean * isDirectory); - - -/* - The GetDirectoryID function gets the directory ID number of the - directory specified. If a file is specified, then the parent - directory of the file is returned and isDirectory is false. If - a directory is specified, then that directory's ID number is - returned and isDirectory is true. - WARNING: Volume names on the Macintosh are *not* unique -- Multiple - mounted volumes can have the same name. For this reason, the use of a - volume name or full pathname to identify a specific volume may not - produce the results you expect. If more than one volume has the same - name and a volume name or full pathname is used, the File Manager - currently uses the first volume it finds with a matching name in the - volume queue. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - theDirID output: If the object is a file, then its parent directory - ID. If the object is a directory, then its ID. - isDirectory output: True if object is a directory; false if - object is a file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -#if OLDROUTINENAMES - #define DirIDFromFSSpec(spec, theDirID, isDirectory) FSpGetDirectoryID(spec, theDirID, isDirectory) -#endif -EXTERN_API( OSErr ) -FSpGetDirectoryID( - const FSSpec * spec, - long * theDirID, - Boolean * isDirectory); - - -/* - The FSpGetDirectoryID function gets the directory ID number of the - directory specified by spec. If spec is to a file, then the parent - directory of the file is returned and isDirectory is false. If - spec is to a directory, then that directory's ID number is - returned and isDirectory is true. - - spec input: An FSSpec record specifying the directory. - theDirID output: The directory ID. - isDirectory output: True if object is a directory; false if - object is a file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetDirName( - short vRefNum, - long dirID, - Str31 name); - - -/* - The GetDirName function gets the name of a directory from its - directory ID. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name output: Points to a Str31 where the directory name is to be - returned. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume or - name parameter was NULL - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetIOACUser( - short vRefNum, - long dirID, - ConstStr255Param name, - SInt8 * ioACUser); - - -/* - GetIOACUser returns a directory's access restrictions byte. - Use the masks and macro defined in MoreFilesExtras to check for - specific access priviledges. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - ioACUser output: The access restriction byte - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetIOACUser( - const FSSpec * spec, - SInt8 * ioACUser); - - -/* - FSpGetIOACUser returns a directory's access restrictions byte. - Use the masks and macro defined in MoreFilesExtras to check for - specific access priviledges. - - spec input: An FSSpec record specifying the directory. - ioACUser output: The access restriction byte - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetParentID( - short vRefNum, - long dirID, - ConstStr255Param name, - long * parID); - - -/* - The GetParentID function gets the parent directory ID number of the - specified object. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - parID output: The parent directory ID of the specified object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetFilenameFromPathname( - ConstStr255Param pathname, - Str255 filename); - - -/* - The GetFilenameFromPathname function gets the file (or directory) name - from the end of a full or partial pathname. Returns notAFileErr if the - pathname is nil, the pathname is empty, or the pathname cannot refer to - a filename (with a noErr result, the pathname could still refer to a - directory). - - pathname input: A full or partial pathname. - filename output: The file (or directory) name. - - Result Codes - noErr 0 No error - notAFileErr -1302 The pathname is nil, the pathname - is empty, or the pathname cannot refer - to a filename - - __________ - - See also: GetObjectLocation. -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetObjectLocation( - short vRefNum, - long dirID, - ConstStr255Param pathname, - short * realVRefNum, - long * realParID, - Str255 realName, - Boolean * isDirectory); - - -/* - The GetObjectLocation function gets a file system object's location - - that is, its real volume reference number, real parent directory ID, - and name. While we're at it, determine if the object is a file or directory. - If GetObjectLocation returns fnfErr, then the location information - returned is valid, but it describes an object that doesn't exist. - You can use the location information for another operation, such as - creating a file or directory. - - vRefNum input: Volume specification. - dirID input: Directory ID. - pathname input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - realVRefNum output: The real volume reference number. - realParID output: The parent directory ID of the specified object. - realName output: The name of the specified object (the case of the - object name may not be the same as the object's - catalog entry on disk - since the Macintosh file - system is not case sensitive, it shouldn't matter). - isDirectory output: True if object is a directory; false if object - is a file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - notAFileErr -1302 The pathname is nil, the pathname - is empty, or the pathname cannot refer - to a filename - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSMakeFSSpecCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetDirItems( - short vRefNum, - long dirID, - ConstStr255Param name, - Boolean getFiles, - Boolean getDirectories, - FSSpecPtr items, - short reqItemCount, - short * actItemCount, - short * itemIndex); - - -/* - The GetDirItems function returns a list of items in the specified - directory in an array of FSSpec records. File, subdirectories, or - both can be returned in the list. - - A noErr result indicates that the items array was filled - (actItemCount == reqItemCount) and there may be additional items - left in the directory. A fnfErr result indicates that the end of - the directory list was found and actItemCount items were actually - found this time. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - getFiles input: Pass true to have files added to the items list. - getDirectories input: Pass true to have directories added to the - items list. - items input: Pointer to array of FSSpec where the item list - is returned. - reqItemCount input: Maximum number of items to return (the number - of elements in the items array). - actItemCount output: The number of items actually returned. - itemIndex input: The current item index position. Set to 1 to - start with the first item in the directory. - output: The item index position to get the next item. - Pass this value the next time you call - GetDirItems to start where you left off. - - Result Codes - noErr 0 No error, but there are more items - to list - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found, there are no more items - to be listed. - paramErr -50 No default volume or itemIndex was <= 0 - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DeleteDirectoryContents( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The DeleteDirectoryContents function deletes the contents of a directory. - All files and subdirectories in the specified directory are deleted. - If a locked file or directory is encountered, it is unlocked and then - deleted. If any unexpected errors are encountered, - DeleteDirectoryContents quits and returns to the caller. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - fBsyErr -47 File busy, directory not empty, or working directory control block open - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: DeleteDirectory -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -DeleteDirectory( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The DeleteDirectory function deletes a directory and its contents. - All files and subdirectories in the specified directory are deleted. - If a locked file or directory is encountered, it is unlocked and then - deleted. After deleting the directories contents, the directory is - deleted. If any unexpected errors are encountered, DeleteDirectory - quits and returns to the caller. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to directory name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - fBsyErr -47 File busy, directory not empty, or working directory control block open - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: DeleteDirectoryContents -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CheckObjectLock( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The CheckObjectLock function determines if a file or directory is locked. - If CheckObjectLock returns noErr, then the file or directory - is not locked. If CheckObjectLock returns fLckdErr, the it is locked. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: FSpCheckObjectLock -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCheckObjectLock(const FSSpec * spec); - - -/* - The FSpCheckObjectLock function determines if a file or directory is locked. - If FSpCheckObjectLock returns noErr, then the file or directory - is not locked. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - Also see: CheckObjectLock -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetFileSize( - short vRefNum, - long dirID, - ConstStr255Param fileName, - long * dataSize, - long * rsrcSize); - - -/* - The GetFileSize function returns the logical size of a file's - data and resource fork. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: The name of the file. - dataSize output: The number of bytes in the file's data fork. - rsrcSize output: The number of bytes in the file's resource fork. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpGetFileSize -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetFileSize( - const FSSpec * spec, - long * dataSize, - long * rsrcSize); - - -/* - The FSpGetFileSize function returns the logical size of a file's - data and resource fork. - - spec input: An FSSpec record specifying the file. - dataSize output: The number of bytes in the file's data fork. - rsrcSize output: The number of bytes in the file's resource fork. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume - dirNFErrdirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: GetFileSize -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -BumpDate( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The BumpDate function changes the modification date of a file or - directory to the current date/time. If the modification date is already - equal to the current date/time, then add one second to the - modification date. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpBumpDate -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpBumpDate(const FSSpec * spec); - - -/* - The FSpBumpDate function changes the modification date of a file or - directory to the current date/time. If the modification date is already - equal to the current date/time, then add one second to the - modification date. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: BumpDate -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ChangeCreatorType( - short vRefNum, - long dirID, - ConstStr255Param name, - OSType creator, - OSType fileType); - - -/* - The ChangeCreatorType function changes the creator or file type of a file. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: The name of the file. - creator input: The new creator type or 0x00000000 to leave - the creator type alone. - fileType input: The new file type or 0x00000000 to leave the - file type alone. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - notAFileErr -1302 Name was not a file - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpChangeCreatorType -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpChangeCreatorType( - const FSSpec * spec, - OSType creator, - OSType fileType); - - -/* - The FSpChangeCreatorType function changes the creator or file type of a file. - - spec input: An FSSpec record specifying the file. - creator input: The new creator type or 0x00000000 to leave - the creator type alone. - fileType input: The new file type or 0x00000000 to leave the - file type alone. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - notAFileErr -1302 Name was not a file - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: ChangeCreatorType -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ChangeFDFlags( - short vRefNum, - long dirID, - ConstStr255Param name, - Boolean setBits, - unsigned short flagBits); - - -/* - The ChangeFDFlags function sets or clears Finder Flag bits in the - fdFlags field of a file or directory's FInfo record. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - setBits input: If true, then set the bits specified in flagBits. - If false, then clear the bits specified in flagBits. - flagBits input: The flagBits parameter specifies which Finder Flag - bits to set or clear. If a bit in flagBits is set, - then the same bit in fdFlags is either set or - cleared depending on the state of the setBits - parameter. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpChangeFDFlags -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpChangeFDFlags( - const FSSpec * spec, - Boolean setBits, - unsigned short flagBits); - - -/* - The FSpChangeFDFlags function sets or clears Finder Flag bits in the - fdFlags field of a file or directory's FInfo record. - - spec input: An FSSpec record specifying the object. - setBits input: If true, then set the bits specified in flagBits. - If false, then clear the bits specified in flagBits. - flagBits input: The flagBits parameter specifies which Finder Flag - bits to set or clear. If a bit in flagBits is set, - then the same bit in fdFlags is either set or - cleared depending on the state of the setBits - parameter. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: ChangeFDFlags -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetIsInvisible( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The SetIsInvisible function sets the invisible bit in the fdFlags - word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetIsInvisible(const FSSpec * spec); - - -/* - The FSpSetIsInvisible function sets the invisible bit in the fdFlags - word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ClearIsInvisible( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The ClearIsInvisible function clears the invisible bit in the fdFlags - word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpClearIsInvisible(const FSSpec * spec); - - -/* - The FSpClearIsInvisible function clears the invisible bit in the fdFlags - word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetNameLocked( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The SetNameLocked function sets the nameLocked bit in the fdFlags word - of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetNameLocked(const FSSpec * spec); - - -/* - The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word - of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetNameLocked, ClearNameLocked, FSpClearNameLocked -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ClearNameLocked( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The ClearNameLocked function clears the nameLocked bit in the fdFlags - word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetNameLocked, FSpSetNameLocked, FSpClearNameLocked -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpClearNameLocked(const FSSpec * spec); - - -/* - The FSpClearNameLocked function clears the nameLocked bit in the fdFlags - word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetNameLocked, FSpSetNameLocked, ClearNameLocked -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetIsStationery( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The SetIsStationery function sets the isStationery bit in the - fdFlags word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetIsStationery(const FSSpec * spec); - - -/* - The FSpSetIsStationery function sets the isStationery bit in the - fdFlags word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsStationery, ClearIsStationery, FSpClearIsStationery -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ClearIsStationery( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The ClearIsStationery function clears the isStationery bit in the - fdFlags word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsStationery, FSpSetIsStationery, FSpClearIsStationery -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpClearIsStationery(const FSSpec * spec); - - -/* - The FSpClearIsStationery function clears the isStationery bit in the - fdFlags word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetIsStationery, FSpSetIsStationery, ClearIsStationery -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -SetHasCustomIcon( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The SetHasCustomIcon function sets the hasCustomIcon bit in the - fdFlags word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpSetHasCustomIcon(const FSSpec * spec); - - -/* - The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the - fdFlags word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ClearHasCustomIcon( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The ClearHasCustomIcon function clears the hasCustomIcon bit in the - fdFlags word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpClearHasCustomIcon(const FSSpec * spec); - - -/* - The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the - fdFlags word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -ClearHasBeenInited( - short vRefNum, - long dirID, - ConstStr255Param name); - - -/* - The ClearHasBeenInited function clears the hasBeenInited bit in the - fdFlags word of the specified file or directory's finder information. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID specifies - a directory that's the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpClearHasBeenInited -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpClearHasBeenInited(const FSSpec * spec); - - -/* - The FSpClearHasBeenInited function clears the hasBeenInited bit in the - fdFlags word of the specified file or directory's finder information. - - spec input: An FSSpec record specifying the object. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: ClearHasBeenInited -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CopyFileMgrAttributes( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName, - Boolean copyLockBit); - - -/* - The CopyFileMgrAttributes function copies all File Manager attributes - from the source file or directory to the destination file or directory. - If copyLockBit is true, then set the locked state of the destination - to match the source. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Pointer to source object name, or nil when - srcDirID specifies a directory that's the object. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Pointer to destination object name, or nil when - dstDirID specifies a directory that's the object. - copyLockBit input: If true, set the locked state of the destination - to match the source. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: FSpCopyFileMgrAttributes -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCopyFileMgrAttributes( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - Boolean copyLockBit); - - -/* - The FSpCopyFileMgrAttributes function copies all File Manager attributes - from the source file or directory to the destination file or directory. - If copyLockBit is true, then set the locked state of the destination - to match the source. - - srcSpec input: An FSSpec record specifying the source object. - dstSpec input: An FSSpec record specifying the destination object. - copyLockBit input: If true, set the locked state of the destination - to match the source. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - paramErr -50 No default volume - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: CopyFileMgrAttributes -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HOpenAware( - short vRefNum, - long dirID, - ConstStr255Param fileName, - short denyModes, - short * refNum); - - -/* - The HOpenAware function opens the data fork of a file using deny mode - permissions instead the normal File Manager permissions. If OpenDeny - is not available, then HOpenAware translates the deny modes to the - closest File Manager permissions and tries to open the file with - OpenDF first, and then Open if OpenDF isn't available. By using - HOpenAware with deny mode permissions, a program can be "AppleShare - aware" and fall back on the standard File Manager open calls - automatically. - - vRefNum input: Volume specification. - dirID input: Directory ID. - fileName input: The name of the file. - denyModes input: The deny modes access under which to open the file. - refNum output: The file reference number of the opened file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - tmfoErr -42 Too many files open - fnfErr -43 File not found - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - opWrErr -49 File already open for writing - paramErr -50 No default volume - permErr -54 File is already open and cannot be opened using specified deny modes - afpAccessDenied -5000 User does not have the correct access to the file - afpDenyConflict -5006 Requested access permission not possible - - __________ - - See also: FSpOpenAware, HOpenRFAware, FSpOpenRFAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpOpenAware( - const FSSpec * spec, - short denyModes, - short * refNum); - - -/* - The FSpOpenAware function opens the data fork of a file using deny mode - permissions instead the normal File Manager permissions. If OpenDeny - is not available, then FSpOpenAware translates the deny modes to the - closest File Manager permissions and tries to open the file with - OpenDF first, and then Open if OpenDF isn't available. By using - FSpOpenAware with deny mode permissions, a program can be "AppleShare - aware" and fall back on the standard File Manager open calls - automatically. - - spec input: An FSSpec record specifying the file. - denyModes input: The deny modes access under which to open the file. - refNum output: The file reference number of the opened file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - tmfoErr -42 Too many files open - fnfErr -43 File not found - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - opWrErr -49 File already open for writing - paramErr -50 No default volume - permErr -54 File is already open and cannot be opened using specified deny modes - afpAccessDenied -5000 User does not have the correct access to the file - afpDenyConflict -5006 Requested access permission not possible - - __________ - - See also: HOpenAware, HOpenRFAware, FSpOpenRFAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HOpenRFAware( - short vRefNum, - long dirID, - ConstStr255Param fileName, - short denyModes, - short * refNum); - - -/* - The HOpenRFAware function opens the resource fork of a file using deny - mode permissions instead the normal File Manager permissions. If - OpenRFDeny is not available, then HOpenRFAware translates the deny - modes to the closest File Manager permissions and tries to open the - file with OpenRF. By using HOpenRFAware with deny mode permissions, - a program can be "AppleShare aware" and fall back on the standard - File Manager open calls automatically. - - vRefNum input: Volume specification. - dirID input: Directory ID. - fileName input: The name of the file. - denyModes input: The deny modes access under which to open the file. - refNum output: The file reference number of the opened file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - tmfoErr -42 Too many files open - fnfErr -43 File not found - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - opWrErr -49 File already open for writing - paramErr -50 No default volume - permErr -54 File is already open and cannot be opened using specified deny modes - afpAccessDenied -5000 User does not have the correct access to the file - afpDenyConflict -5006 Requested access permission not possible - - __________ - - See also: HOpenAware, FSpOpenAware, FSpOpenRFAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpOpenRFAware( - const FSSpec * spec, - short denyModes, - short * refNum); - - -/* - The FSpOpenRFAware function opens the resource fork of a file using deny - mode permissions instead the normal File Manager permissions. If - OpenRFDeny is not available, then FSpOpenRFAware translates the deny - modes to the closest File Manager permissions and tries to open the - file with OpenRF. By using FSpOpenRFAware with deny mode permissions, - a program can be "AppleShare aware" and fall back on the standard - File Manager open calls automatically. - - spec input: An FSSpec record specifying the file. - denyModes input: The deny modes access under which to open the file. - refNum output: The file reference number of the opened file. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - tmfoErr -42 Too many files open - fnfErr -43 File not found - wPrErr -44 Volume locked by hardware - fLckdErr -45 File is locked - vLckdErr -46 Volume is locked or read-only - opWrErr -49 File already open for writing - paramErr -50 No default volume - permErr -54 File is already open and cannot be opened using specified deny modes - afpAccessDenied -5000 User does not have the correct access to the file - afpDenyConflict -5006 Requested access permission not possible - - __________ - - See also: HOpenAware, FSpOpenAware, HOpenRFAware -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSReadNoCache( - short refNum, - long * count, - void * buffPtr); - - -/* - The FSReadNoCache function reads any number of bytes from an open file - while asking the file system to bypass its cache mechanism. - - refNum input: The file reference number of an open file. - count input: The number of bytes to read. - output: The number of bytes actually read. - buffPtr input: A pointer to the data buffer into which the bytes are - to be read. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - ioErr Ð36 Data does not match in read-verify mode - fnOpnErr -38 File not open - rfNumErr -51 Bad reference number - afpAccessDenied -5000 User does not have the correct access to - the file - - __________ - - See also: FSWriteNoCache -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSWriteNoCache( - short refNum, - long * count, - const void * buffPtr); - - -/* - The FSReadNoCache function writes any number of bytes to an open file - while asking the file system to bypass its cache mechanism. - - refNum input: The file reference number of an open file. - count input: The number of bytes to write to the file. - output: The number of bytes actually written. - buffPtr input: A pointer to the data buffer from which the bytes are - to be written. - - Result Codes - noErr 0 No error - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Disk full - ioErr Ð36 Data does not match in read-verify mode - fnOpnErr -38 File not open - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - rfNumErr -51 Bad reference number - wrPermErr -61 Read/write permission doesnÕt - allow writing - afpAccessDenied -5000 User does not have the correct access to - the file - - __________ - - See also: FSReadNoCache -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSWriteVerify( - short refNum, - long * count, - const void * buffPtr); - - -/* - The FSWriteVerify function writes any number of bytes to an open file - and then verifies that the data was actually written to the device. - - refNum input: The file reference number of an open file. - count input: The number of bytes to write to the file. - output: The number of bytes actually written and verified. - buffPtr input: A pointer to the data buffer from which the bytes are - to be written. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Disk full - ioErr Ð36 Data does not match in read-verify mode - fnOpnErr -38 File not open - eofErr -39 Logical end-of-file reached - posErr -40 Attempt to position mark before start - of file - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - rfNumErr -51 Bad reference number - gfpErr -52 Error during GetFPos - wrPermErr -61 Read/write permission doesnÕt - allow writing - memFullErr -108 Not enough room in heap zone to allocate - verify buffer - afpAccessDenied -5000 User does not have the correct access to - the file -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CopyFork( - short srcRefNum, - short dstRefNum, - void * copyBufferPtr, - long copyBufferSize); - - -/* - The CopyFork function copies all data from the source fork to the - destination fork of open file forks and makes sure the destination EOF - is equal to the source EOF. - - srcRefNum input: The source file reference number. - dstRefNum input: The destination file reference number. - copyBufferPtr input: Pointer to buffer to use during copy. The - buffer should be at least 512-bytes minimum. - The larger the buffer, the faster the copy. - copyBufferSize input: The size of the copy buffer. - - Result Codes - noErr 0 No error - readErr Ð19 Driver does not respond to read requests - writErr Ð20 Driver does not respond to write requests - badUnitErr Ð21 Driver reference number does not - match unit table - unitEmptyErr Ð22 Driver reference number specifies a - nil handle in unit table - abortErr Ð27 Request aborted by KillIO - notOpenErr Ð28 Driver not open - dskFulErr -34 Disk full - ioErr Ð36 Data does not match in read-verify mode - fnOpnErr -38 File not open - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Software volume lock - rfNumErr -51 Bad reference number - wrPermErr -61 Read/write permission doesnÕt - allow writing - afpAccessDenied -5000 User does not have the correct access to - the file -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetFileLocation( - short refNum, - short * vRefNum, - long * dirID, - StringPtr fileName); - - -/* - The GetFileLocation function gets the location (volume reference number, - directory ID, and fileName) of an open file. - - refNum input: The file reference number of an open file. - vRefNum output: The volume reference number. - dirID output: The parent directory ID. - fileName input: Points to a buffer (minimum Str63) where the - filename is to be returned or must be nil. - output: The filename. - - Result Codes - noErr 0 No error - nsvErr -35 Specified volume doesnÕt exist - fnOpnErr -38 File not open - rfNumErr -51 Reference number specifies nonexistent - access path - - __________ - - See also: FSpGetFileLocation -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpGetFileLocation( - short refNum, - FSSpec * spec); - - -/* - The FSpGetFileLocation function gets the location of an open file in - an FSSpec record. - - refNum input: The file reference number of an open file. - spec output: FSSpec record containing the file name and location. - - Result Codes - noErr 0 No error - nsvErr -35 Specified volume doesnÕt exist - fnOpnErr -38 File not open - rfNumErr -51 Reference number specifies nonexistent - access path - - __________ - - See also: GetFileLocation -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CopyDirectoryAccess( - short srcVRefNum, - long srcDirID, - ConstStr255Param srcName, - short dstVRefNum, - long dstDirID, - ConstStr255Param dstName); - - -/* - The CopyDirectoryAccess function copies the AFP directory access - privileges from one directory to another. Both directories must be on - the same file server, but not necessarily on the same server volume. - - srcVRefNum input: Source volume specification. - srcDirID input: Source directory ID. - srcName input: Pointer to source directory name, or nil when - srcDirID specifies the directory. - dstVRefNum input: Destination volume specification. - dstDirID input: Destination directory ID. - dstName input: Pointer to destination directory name, or nil when - dstDirID specifies the directory. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - fnfErr -43 Directory not found - vLckdErr -46 Volume is locked or read-only - paramErr -50 Volume doesn't support this function - afpAccessDenied -5000 User does not have the correct access - to the directory - afpObjectTypeErr -5025 Object is a file, not a directory - - __________ - - See also: FSpCopyDirectoryAccess -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpCopyDirectoryAccess( - const FSSpec * srcSpec, - const FSSpec * dstSpec); - - -/* - The FSpCopyDirectoryAccess function copies the AFP directory access - privileges from one directory to another. Both directories must be on - the same file server, but not necessarily on the same server volume. - - srcSpec input: An FSSpec record specifying the source directory. - dstSpec input: An FSSpec record specifying the destination directory. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - fnfErr -43 Directory not found - vLckdErr -46 Volume is locked or read-only - paramErr -50 Volume doesn't support this function - afpAccessDenied -5000 User does not have the correct access - to the directory - afpObjectTypeErr -5025 Object is a file, not a directory - - __________ - - See also: CopyDirectoryAccess -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -HMoveRenameCompat( - short vRefNum, - long srcDirID, - ConstStr255Param srcName, - long dstDirID, - ConstStr255Param dstpathName, - ConstStr255Param copyName); - - -/* - The HMoveRenameCompat function moves a file or directory and optionally - renames it. The source and destination locations must be on the same - volume. This routine works even if the volume doesn't support MoveRename. - - vRefNum input: Volume specification. - srcDirID input: Source directory ID. - srcName input: The source object name. - dstDirID input: Destination directory ID. - dstName input: Pointer to destination directory name, or - nil when dstDirID specifies a directory. - copyName input: Points to the new name if the object is to be - renamed or nil if the object isn't to be renamed. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 Volume not found - ioErr -36 I/O error - bdNamErr -37 Bad filename or attempt to move into - a file - fnfErr -43 Source file or directory not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 File busy, directory not empty, or - working directory control block open - dupFNErr -48 Destination already exists - paramErr -50 Volume doesn't support this function, - no default volume, or source and - volOfflinErr -53 Volume is offline - fsRnErr -59 Problem during rename - dirNFErr -120 Directory not found or incomplete pathname - badMovErr -122 Attempted to move directory into - offspring - wrgVolTypErr -123 Not an HFS volume (it's a MFS volume) - notAFileErr -1302 The pathname is nil, the pathname - is empty, or the pathname cannot refer - to a filename - diffVolErr -1303 Files on different volumes - afpAccessDenied -5000 The user does not have the right to - move the file or directory - afpObjectTypeErr -5025 Directory not found or incomplete pathname - afpSameObjectErr -5038 Source and destination files are the same - - __________ - - See also: FSpMoveRenameCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -FSpMoveRenameCompat( - const FSSpec * srcSpec, - const FSSpec * dstSpec, - ConstStr255Param copyName); - - -/* - The FSpMoveRenameCompat function moves a file or directory and optionally - renames it. The source and destination locations must be on the same - volume. This routine works even if the volume doesn't support MoveRename. - - srcSpec input: An FSSpec record specifying the source object. - dstSpec input: An FSSpec record specifying the destination - directory. - copyName input: Points to the new name if the object is to be - renamed or nil if the object isn't to be renamed. - - Result Codes - noErr 0 No error - dirFulErr -33 File directory full - dskFulErr -34 Disk is full - nsvErr -35 Volume not found - ioErr -36 I/O error - bdNamErr -37 Bad filename or attempt to move into - a file - fnfErr -43 Source file or directory not found - wPrErr -44 Hardware volume lock - fLckdErr -45 File is locked - vLckdErr -46 Destination volume is read-only - fBsyErr -47 File busy, directory not empty, or - working directory control block open - dupFNErr -48 Destination already exists - paramErr -50 Volume doesn't support this function, - no default volume, or source and - volOfflinErr -53 Volume is offline - fsRnErr -59 Problem during rename - dirNFErr -120 Directory not found or incomplete pathname - badMovErr -122 Attempted to move directory into - offspring - wrgVolTypErr -123 Not an HFS volume (it's a MFS volume) - notAFileErr -1302 The pathname is nil, the pathname - is empty, or the pathname cannot refer - to a filename - diffVolErr -1303 Files on different volumes - afpAccessDenied -5000 The user does not have the right to - move the file or directory - afpObjectTypeErr -5025 Directory not found or incomplete pathname - afpSameObjectErr -5038 Source and destination files are the same - - __________ - - See also: HMoveRenameCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -BuildAFPVolMountInfo( - short flags, - char nbpInterval, - char nbpCount, - short uamType, - Str32 zoneName, - Str31 serverName, - Str27 volName, - Str31 userName, - Str8 userPassword, - Str8 volPassword, - AFPVolMountInfoPtr * afpInfoPtr); - - -/* - The BuildAFPVolMountInfo function allocates and initializes the fields - of an AFPVolMountInfo record before using that record to call - the VolumeMount function. - - flags input: The AFP mounting flags. 0 = normal mount; - set bit 0 to inhibit greeting messages. - nbpInterval input: The interval used for VolumeMount's - NBP Lookup call. 7 is a good choice. - nbpCount input: The retry count used for VolumeMount's - NBP Lookup call. 5 is a good choice. - uamType input: The user authentication method to use. - zoneName input: The AppleTalk zone name of the server. - serverName input: The AFP server name. - volName input: The AFP volume name. - userName input: The user name (zero length Pascal string for - guest). - userPassWord input: The user password (zero length Pascal string - if no user password) - volPassWord input: The volume password (zero length Pascal string - if no volume password) - afpInfoPtr output: A pointer to the newly created and initialized - AFPVolMountInfo record. If the function fails to - create an AFPVolMountInfo record, it sets - afpInfoPtr to NULL and the function result is - memFullErr. Your program is responsible - for disposing of this pointer when it is finished - with it. - - Result Codes - noErr 0 No error - memFullErr -108 memory full error - - __________ - - Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount, - RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo, - RetrieveAFPXVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -RetrieveAFPVolMountInfo( - AFPVolMountInfoPtr afpInfoPtr, - short * flags, - short * uamType, - StringPtr zoneName, - StringPtr serverName, - StringPtr volName, - StringPtr userName); - - -/* - The RetrieveAFPVolMountInfo function retrieves the AFP mounting - information returned in an AFPVolMountInfo record by the - GetVolMountInfo function. - - afpInfoPtr input: Pointer to AFPVolMountInfo record that contains - the AFP mounting information. - flags output: The AFP mounting flags. - uamType output: The user authentication method used. - zoneName output: The AppleTalk zone name of the server. - serverName output: The AFP server name. - volName output: The AFP volume name. - userName output: The user name (zero length Pascal string for - guest). - - Result Codes - noErr 0 No error - paramErr -50 media field in AFP mounting information - was not AppleShareMediaType - - __________ - - Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount, - BuildAFPVolMountInfo, BuildAFPXVolMountInfo, - RetrieveAFPXVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -BuildAFPXVolMountInfo( - short flags, - char nbpInterval, - char nbpCount, - short uamType, - Str32 zoneName, - Str31 serverName, - Str27 volName, - Str31 userName, - Str8 userPassword, - Str8 volPassword, - Str32 uamName, - unsigned long alternateAddressLength, - void * alternateAddress, - AFPXVolMountInfoPtr * afpXInfoPtr); - - -/* - The BuildAFPXVolMountInfo function allocates and initializes the fields - of an AFPXVolMountInfo record before using that record to call - the VolumeMount function. - - flags input: The AFP mounting flags. - nbpInterval input: The interval used for VolumeMount's - NBP Lookup call. 7 is a good choice. - nbpCount input: The retry count used for VolumeMount's - NBP Lookup call. 5 is a good choice. - uamType input: The user authentication method to use. - zoneName input: The AppleTalk zone name of the server. - serverName input: The AFP server name. - volName input: The AFP volume name. - userName input: The user name (zero length Pascal string - for guest). - userPassWord input: The user password (zero length Pascal - string if no user password) - volPassWord input: The volume password (zero length Pascal - string if no volume password) - uamName input: The User Authentication Method name. - alternateAddressLength input: Length of alternateAddress data. - alternateAddress input The AFPAlternateAddress (variable length) - afpXInfoPtr output: A pointer to the newly created and - initialized AFPVolMountInfo record. - If the function fails to create an - AFPVolMountInfo record, it sets - afpInfoPtr to NULL and the function - result is memFullErr. Your program is - responsible for disposing of this pointer - when it is finished with it. - - Result Codes - noErr 0 No error - memFullErr -108 memory full error - - __________ - - Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount, - BuildAFPVolMountInfo, RetrieveAFPVolMountInfo, - RetrieveAFPXVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -RetrieveAFPXVolMountInfo( - AFPXVolMountInfoPtr afpXInfoPtr, - short * flags, - short * uamType, - StringPtr zoneName, - StringPtr serverName, - StringPtr volName, - StringPtr userName, - StringPtr uamName, - unsigned long * alternateAddressLength, - AFPAlternateAddress ** alternateAddress); - - -/* - The RetrieveAFPXVolMountInfo function retrieves the AFP mounting - information returned in an AFPXVolMountInfo record by the - GetVolMountInfo function. - - afpXInfoPtr input: Pointer to AFPXVolMountInfo record that - contains the AFP mounting information. - flags output: The AFP mounting flags. - uamType output: The user authentication method used. - zoneName output: The AppleTalk zone name of the server. - serverName output: The AFP server name. - volName output: The AFP volume name. - userName output: The user name (zero length Pascal - string for guest). - uamName output: The User Authentication Method name. - alternateAddressLength output: Length of alternateAddress data returned. - alternateAddress: output: A pointer to the newly created and - AFPAlternateAddress record (a variable - length record). If the function fails to - create an AFPAlternateAddress record, - it sets alternateAddress to NULL and the - function result is memFullErr. Your - program is responsible for disposing of - this pointer when it is finished with it. - - Result Codes - noErr 0 No error - paramErr -50 media field in AFP mounting information - was not AppleShareMediaType - memFullErr -108 memory full error - - __________ - - Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount, - BuildAFPVolMountInfo, RetrieveAFXVolMountInfo, - BuildAFPXVolMountInfo -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -GetUGEntries( - short objType, - UGEntryPtr entries, - long reqEntryCount, - long * actEntryCount, - long * objID); - - -/* - The GetUGEntries functions retrieves a list of user or group entries - from the local file server. - - objType input: The object type: -1 = group; 0 = user - UGEntries input: Pointer to array of UGEntry records where the list - is returned. - reqEntryCount input: The number of elements in the UGEntries array. - actEntryCount output: The number of entries returned. - objID input: The current index position. Set to 0 to start with - the first entry. - output: The index position to get the next entry. Pass this - value the next time you call GetUGEntries to start - where you left off. - - Result Codes - noErr 0 No error - fnfErr -43 No more users or groups - paramErr -50 Function not supported; or, ioObjID is - negative - - __________ - - Also see: GetUGEntry -*/ - -/*****************************************************************************/ - - - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __MOREFILESEXTRAS__ */ - diff --git a/src/mac/classic/morefile/Optimization.h b/src/mac/classic/morefile/Optimization.h deleted file mode 100644 index d2673f9304..0000000000 --- a/src/mac/classic/morefile/Optimization.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - File: Optimization.h - - Contains: Defines that let you make MoreFiles code more efficient. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <1> 2/7/01 JL first checked in -*/ - -/* - The Optimization changes to MoreFiles source and header files, along with - this file and OptimizationEnd.h, let you optimize the code produced - by MoreFiles in several ways. - - 1 -- MoreFiles contains extra code so that many routines can run under - Mac OS systems back to System 6. If your program requires a specific - version of Mac OS and your program checks for that version before - calling MoreFiles routines, then you can remove a lot of compatibility - code by defining one of the following to 1: - - __MACOSSEVENFIVEONEORLATER // assume Mac OS 7.5.1 or later - __MACOSSEVENFIVEORLATER // assume Mac OS 7.5 or later - __MACOSSEVENORLATER // assume Mac OS 7.0 or later - - If you're compiling 68K code, the default is to include all compatibility code. - If you're compiling PowerPC code (TARGET_RT_MAC_CFM), the default is __MACOSSEVENORLATER - If you're compiling for Carbon code (TARGET_API_MAC_CARBON), the default is __MACOSSEVENFIVEONEORLATER - - 2 -- You may disable Pascal calling conventions in all MoreFiles routines - except for system callbacks that require Pascal calling conventions. - This will make 68K C programs both smaller and faster. - (PowerPC compilers ignore pascal calling conventions.) - Just define __WANTPASCALELIMINATION to be 1 to turn this optimization on - when building MoreFiles for use from C programs (you'll need to keep - Pascal calling conventions when linking MoreFiles routines with Pascal - programs). - - 3 -- If Metrowerks compiler is used, "#pragma internal on" may help produce - better code. However, this option can also cause problems if you're - trying to build MoreFiles as a shared library, so it is by default not used. - Just define __USEPRAGMAINTERNAL to be 1 to turn this optimization on. - - Original changes supplied by Fabrizio Oddone -*/ - -#include - -// if we're compiling for Carbon, then we're running on Mac OS 8.1 or later -#ifndef __MACOSSEVENFIVEONEORLATER - #define __MACOSSEVENFIVEONEORLATER TARGET_API_MAC_CARBON -#endif - -#ifndef __MACOSSEVENFIVEORLATER - #define __MACOSSEVENFIVEORLATER __MACOSSEVENFIVEONEORLATER -#endif - -#ifndef __MACOSSEVENORLATER - #if TARGET_RT_MAC_CFM - #define __MACOSSEVENORLATER 1 - #else - #define __MACOSSEVENORLATER __MACOSSEVENFIVEORLATER - #endif -#endif - - -#ifndef __WANTPASCALELIMINATION - #define __WANTPASCALELIMINATION 0 -#endif - -#if __WANTPASCALELIMINATION - #define pascal -#endif - - -#ifndef __USEPRAGMAINTERNAL - #define __USEPRAGMAINTERNAL 0 -#endif - -#if __USEPRAGMAINTERNAL - #if defined(__MWERKS__) - #pragma internal on - #endif -#endif diff --git a/src/mac/classic/morefile/OptimizationEnd.h b/src/mac/classic/morefile/OptimizationEnd.h deleted file mode 100644 index 10ed02507f..0000000000 --- a/src/mac/classic/morefile/OptimizationEnd.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - File: OptimizationEnd.h - - Contains: Defines that let you make MoreFiles code more efficient. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Apple Macintosh Developer Technical Support - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <1> 2/7/01 JL first checked in -*/ - -/* - The Optimization changes to MoreFiles source and header files, along with - this file and Optimization.h, let you optimize the code produced by MoreFiles - in several ways. - - Original changes supplied by Fabrizio Oddone -*/ - - -#if __USEPRAGMAINTERNAL - #if defined(__MWERKS__) - #pragma internal reset - #endif -#endif - - -#if __WANTPASCALELIMINATION - #ifndef __COMPILINGMOREFILES - #undef pascal - #endif -#endif diff --git a/src/mac/classic/morefile/Search.c b/src/mac/classic/morefile/Search.c deleted file mode 100644 index d03154a5ee..0000000000 --- a/src/mac/classic/morefile/Search.c +++ /dev/null @@ -1,1300 +0,0 @@ -/* - File: Search.c - - Contains: IndexedSearch and the PBCatSearch compatibility function. - - Version: MoreFiles - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. - - File Ownership: - - DRI: Jim Luther - - Other Contact: Apple Macintosh Developer Technical Support - - - Technology: DTS Sample Code - - Writers: - - (JL) Jim Luther - - Change History (most recent first): - - <2> 2/7/01 JL Added standard header. Updated names of includes. Updated - various routines to use new calling convention of the - MoreFilesExtras accessor functions. Added TARGET_API_MAC_CARBON - conditional checks around TimeOutTask. - <1> 12/06/99 JL MoreFiles 1.5. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#define __COMPILINGMOREFILES - -#include "MoreFiles.h" -#include "MoreFilesExtras.h" - -#include "Search.h" - -/*****************************************************************************/ - -enum -{ - /* Number of LevelRecs to add each time the searchStack is grown */ - /* 20 levels is probably more than reasonable for most volumes. */ - /* If more are needed, they are allocated 20 levels at a time. */ - kAdditionalLevelRecs = 20 -}; - -/*****************************************************************************/ - -/* -** LevelRecs are used to store the directory ID and index whenever -** IndexedSearch needs to either scan a sub-directory, or return control -** to the caller because the call has timed out or the number of -** matches requested has been found. LevelRecs are stored in an array -** used as a stack. -*/ -struct LevelRec -{ - long dirModDate; /* for detecting most (but not all) catalog changes */ - long dirID; - short index; -}; -typedef struct LevelRec LevelRec; -typedef LevelRec *LevelRecPtr, **LevelRecHandle; - - -/* -** SearchPositionRec is my version of a CatPositionRec. It holds the -** information I need to resuming searching. -*/ -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif -struct SearchPositionRec -{ - long initialize; /* Goofy checksum of volume information used to make */ - /* sure we're resuming a search on the same volume. */ - unsigned short stackDepth; /* Current depth on searchStack. */ - short priv[11]; /* For future use... */ -}; -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif -typedef struct SearchPositionRec SearchPositionRec; -typedef SearchPositionRec *SearchPositionRecPtr; - - -/* -** ExtendedTMTask is a TMTask record extended to hold the timer flag. -*/ -#if PRAGMA_STRUCT_ALIGN -#pragma options align=mac68k -#endif -struct ExtendedTMTask -{ - TMTask theTask; - Boolean stopSearch; /* the Time Mgr task will set stopSearch to */ - /* true when the timer expires */ -}; -#if PRAGMA_STRUCT_ALIGN -#pragma options align=reset -#endif -typedef struct ExtendedTMTask ExtendedTMTask; -typedef ExtendedTMTask *ExtendedTMTaskPtr; - -/*****************************************************************************/ - -static OSErr CheckVol(ConstStr255Param pathname, - short vRefNum, - short *realVRefNum, - long *volID); - -static OSErr CheckStack(unsigned short stackDepth, - LevelRecHandle searchStack, - Size *searchStackSize); - -static OSErr VerifyUserPB(CSParamPtr userPB, - Boolean *includeFiles, - Boolean *includeDirs, - Boolean *includeNames); - -static Boolean IsSubString(ConstStr255Param aStringPtr, - ConstStr255Param subStringPtr); - -static Boolean CompareMasked(const long *data1, - const long *data2, - const long *mask, - short longsToCompare); - -static void CheckForMatches(CInfoPBPtr cPB, - CSParamPtr userPB, - const Str63 matchName, - Boolean includeFiles, - Boolean includeDirs); - -#if __WANTPASCALELIMINATION -#undef pascal -#endif - -#if TARGET_RT_MAC_CFM || TARGET_API_MAC_CARBON - -static pascal void TimeOutTask(TMTaskPtr tmTaskPtr); - -#else - -static pascal TMTaskPtr GetTMTaskPtr(void); - -static void TimeOutTask(void); - -#endif - -#if __WANTPASCALELIMINATION -#define pascal -#endif - -static long GetDirModDate(short vRefNum, - long dirID); - -/*****************************************************************************/ - -/* -** CheckVol gets the volume's real vRefNum and builds a volID. The volID -** is used to help insure that calls to resume searching with IndexedSearch -** are to the same volume as the last call to IndexedSearch. -*/ -static OSErr CheckVol(ConstStr255Param pathname, - short vRefNum, - short *realVRefNum, - long *volID) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname, vRefNum, &pb); - if ( error == noErr ) - { - /* Return the real vRefNum */ - *realVRefNum = pb.volumeParam.ioVRefNum; - - /* Add together a bunch of things that aren't supposed to change on */ - /* a mounted volume that's being searched and that should come up with */ - /* a fairly unique number */ - *volID = pb.volumeParam.ioVCrDate + - pb.volumeParam.ioVRefNum + - pb.volumeParam.ioVNmAlBlks + - pb.volumeParam.ioVAlBlkSiz + - pb.volumeParam.ioVFSID; - } - return ( error ); -} - -/*****************************************************************************/ - -/* -** CheckStack checks the size of the search stack (array) to see if there's -** room to push another LevelRec. If not, CheckStack grows the stack by -** another kAdditionalLevelRecs elements. -*/ -static OSErr CheckStack(unsigned short stackDepth, - LevelRecHandle searchStack, - Size *searchStackSize) -{ - OSErr result; - - if ( (*searchStackSize / sizeof(LevelRec)) == (stackDepth + 1) ) - { - /* Time to grow stack */ - SetHandleSize((Handle)searchStack, *searchStackSize + (kAdditionalLevelRecs * sizeof(LevelRec))); - result = MemError(); /* should be noErr */ - *searchStackSize = GetHandleSize((Handle)searchStack); - } - else - { - result = noErr; - } - - return ( result ); -} - -/*****************************************************************************/ - -/* -** VerifyUserPB makes sure the parameter block passed to IndexedSearch has -** valid parameters. By making this check once, we don't have to worry about -** things like NULL pointers, strings being too long, etc. -** VerifyUserPB also determines if the search includes files and/or -** directories, and determines if a full or partial name search was requested. -*/ -static OSErr VerifyUserPB(CSParamPtr userPB, - Boolean *includeFiles, - Boolean *includeDirs, - Boolean *includeNames) -{ - CInfoPBPtr searchInfo1; - CInfoPBPtr searchInfo2; - - searchInfo1 = userPB->ioSearchInfo1; - searchInfo2 = userPB->ioSearchInfo2; - - /* ioMatchPtr cannot be NULL */ - if ( userPB->ioMatchPtr == NULL ) - { - goto ParamErrExit; - } - - /* ioSearchInfo1 cannot be NULL */ - if ( searchInfo1 == NULL ) - { - goto ParamErrExit; - } - - /* If any bits except partialName, fullName, or negate are set, then */ - /* ioSearchInfo2 cannot be NULL because information in ioSearchInfo2 is required */ - if ( ((userPB->ioSearchBits & ~(fsSBPartialName | fsSBFullName | fsSBNegate)) != 0) && - ( searchInfo2 == NULL )) - { - goto ParamErrExit; - } - - *includeFiles = false; - *includeDirs = false; - *includeNames = false; - - if ( (userPB->ioSearchBits & (fsSBPartialName | fsSBFullName)) != 0 ) - { - /* If any kind of name matching is requested, then ioNamePtr in */ - /* ioSearchInfo1 cannot be NULL or a zero-length string */ - if ( (searchInfo1->hFileInfo.ioNamePtr == NULL) || - (searchInfo1->hFileInfo.ioNamePtr[0] == 0) || - (searchInfo1->hFileInfo.ioNamePtr[0] > (sizeof(Str63) - 1)) ) - { - goto ParamErrExit; - } - - *includeNames = true; - } - - if ( (userPB->ioSearchBits & fsSBFlAttrib) != 0 ) - { - /* The only attributes you can search on are the directory flag */ - /* and the locked flag. */ - if ( (searchInfo2->hFileInfo.ioFlAttrib & ~(kioFlAttribDirMask | kioFlAttribLockedMask)) != 0 ) - { - goto ParamErrExit; - } - - /* interested in the directory bit? */ - if ( (searchInfo2->hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* yes, so do they want just directories or just files? */ - if ( (searchInfo1->hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - *includeDirs = true; - } - else - { - *includeFiles = true; - } - } - else - { - /* no interest in directory bit - get both files and directories */ - *includeDirs = true; - *includeFiles = true; - } - } - else - { - /* no attribute checking - get both files and directories */ - *includeDirs = true; - *includeFiles = true; - } - - /* If directories are included in the search, */ - /* then the locked attribute cannot be requested. */ - if ( *includeDirs && - ((userPB->ioSearchBits & fsSBFlAttrib) != 0) && - ((searchInfo2->hFileInfo.ioFlAttrib & kioFlAttribLockedMask) != 0) ) - { - goto ParamErrExit; - } - - /* If files are included in the search, then there cannot be */ - /* a search on the number of files. */ - if ( *includeFiles && - ((userPB->ioSearchBits & fsSBDrNmFls) != 0) ) - { - goto ParamErrExit; - } - - /* If directories are included in the search, then there cannot */ - /* be a search on file lengths. */ - if ( *includeDirs && - ((userPB->ioSearchBits & (fsSBFlLgLen | fsSBFlPyLen | fsSBFlRLgLen | fsSBFlRPyLen)) != 0) ) - { - goto ParamErrExit; - } - - return ( noErr ); - -ParamErrExit: - return ( paramErr ); -} - -/*****************************************************************************/ - -/* -** IsSubString checks to see if a string is a substring of another string. -** Both input strings have already been converted to all uppercase using -** UprString (the same non-international call the File Manager uses). -*/ -static Boolean IsSubString(ConstStr255Param aStringPtr, - ConstStr255Param subStringPtr) -{ - short strLength; /* length of string */ - short subStrLength; /* length of subString */ - Boolean found; /* result of test */ - short index; /* current index into string */ - - found = false; - strLength = aStringPtr[0]; - subStrLength = subStringPtr[0]; - - if ( subStrLength <= strLength) - { - register short count; /* search counter */ - register short strIndex; /* running index into string */ - register short subStrIndex; /* running index into subString */ - - /* start looking at first character */ - index = 1; - - /* continue looking until remaining string is shorter than substring */ - count = strLength - subStrLength + 1; - - do - { - strIndex = index; /* start string index at index */ - subStrIndex = 1; /* start subString index at 1 */ - - while ( !found && (aStringPtr[strIndex] == subStringPtr[subStrIndex]) ) - { - if ( subStrIndex == subStrLength ) - { - /* all characters in subString were found */ - found = true; - } - else - { - /* check next character of substring against next character of string */ - ++subStrIndex; - ++strIndex; - } - } - - if ( !found ) - { - /* start substring search again at next string character */ - ++index; - --count; - } - } while ( count != 0 && (!found) ); - } - - return ( found ); -} - -/*****************************************************************************/ - -/* -** CompareMasked does a bitwise comparison with mask on 1 or more longs. -** data1 and data2 are first exclusive-ORed together resulting with bits set -** where they are different. That value is then ANDed with the mask resulting -** with bits set if the test fails. true is returned if the tests pass. -*/ -static Boolean CompareMasked(const long *data1, - const long *data2, - const long *mask, - short longsToCompare) -{ - Boolean result = true; - - while ( (longsToCompare != 0) && (result == true) ) - { - /* (*data1 ^ *data2) = bits that are different, so... */ - /* ((*data1 ^ *data2) & *mask) = bits that are different that we're interested in */ - - if ( ((*data1 ^ *data2) & *mask) != 0 ) - result = false; - - ++data1; - ++data2; - ++mask; - --longsToCompare; - } - - return ( result ); -} - -/*****************************************************************************/ - -/* -** Check for matches compares the search criteria in userPB to the file -** system object in cPB. If there's a match, then the information in cPB is -** is added to the match array and the actual match count is incremented. -*/ -static void CheckForMatches(CInfoPBPtr cPB, - CSParamPtr userPB, - const Str63 matchName, - Boolean includeFiles, - Boolean includeDirs) -{ - long searchBits; - CInfoPBPtr searchInfo1; - CInfoPBPtr searchInfo2; - Str63 itemName; /* copy of object's name for partial name matching */ - Boolean foundMatch; - - foundMatch = false; /* default to no match */ - - searchBits = userPB->ioSearchBits; - searchInfo1 = userPB->ioSearchInfo1; - searchInfo2 = userPB->ioSearchInfo2; - - /* Into the if statements that go on forever... */ - - if ( (cPB->hFileInfo.ioFlAttrib & kioFlAttribDirMask) == 0 ) - { - if (!includeFiles) - { - goto Failed; - } - } - else - { - if (!includeDirs) - { - goto Failed; - } - } - - if ( (searchBits & fsSBPartialName) != 0 ) - { - if ( (cPB->hFileInfo.ioNamePtr[0] > 0) && - (cPB->hFileInfo.ioNamePtr[0] <= (sizeof(Str63) - 1)) ) - { - /* Make uppercase copy of object name */ - BlockMoveData(cPB->hFileInfo.ioNamePtr, - itemName, - cPB->hFileInfo.ioNamePtr[0] + 1); - /* Use the same non-international call the File Manager uses */ - UpperString(itemName, true); - } - else - { - goto Failed; - } - - { - if ( !IsSubString(itemName, matchName) ) - { - goto Failed; - } - else if ( searchBits == fsSBPartialName ) - { - /* optimize for name matching only since it is most common way to search */ - goto Hit; - } - } - } - - if ( (searchBits & fsSBFullName) != 0 ) - { - /* Use the same non-international call the File Manager uses */ - if ( !EqualString(cPB->hFileInfo.ioNamePtr, matchName, false, true) ) - { - goto Failed; - } - else if ( searchBits == fsSBFullName ) - { - /* optimize for name matching only since it is most common way to search */ - goto Hit; - } - } - - if ( (searchBits & fsSBFlParID) != 0 ) - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlParID) < (unsigned long)(searchInfo1->hFileInfo.ioFlParID)) || - ((unsigned long)(cPB->hFileInfo.ioFlParID) > (unsigned long)(searchInfo2->hFileInfo.ioFlParID)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlAttrib) != 0 ) - { - if ( ((cPB->hFileInfo.ioFlAttrib ^ searchInfo1->hFileInfo.ioFlAttrib) & - searchInfo2->hFileInfo.ioFlAttrib) != 0 ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBDrNmFls) != 0 ) - { - if ( ((unsigned long)(cPB->dirInfo.ioDrNmFls) < (unsigned long)(searchInfo1->dirInfo.ioDrNmFls)) || - ((unsigned long)(cPB->dirInfo.ioDrNmFls) > (unsigned long)(searchInfo2->dirInfo.ioDrNmFls)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlFndrInfo) != 0 ) /* fsSBFlFndrInfo is same as fsSBDrUsrWds */ - { - if ( !CompareMasked((long *)&(cPB->hFileInfo.ioFlFndrInfo), - (long *)&(searchInfo1->hFileInfo.ioFlFndrInfo), - (long *)&(searchInfo2->hFileInfo.ioFlFndrInfo), - sizeof(FInfo) / sizeof(long)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlXFndrInfo) != 0 ) /* fsSBFlXFndrInfo is same as fsSBDrFndrInfo */ - { - if ( !CompareMasked((long *)&(cPB->hFileInfo.ioFlXFndrInfo), - (long *)&(searchInfo1->hFileInfo.ioFlXFndrInfo), - (long *)&(searchInfo2->hFileInfo.ioFlXFndrInfo), - sizeof(FXInfo) / sizeof(long)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlLgLen) != 0 ) - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlLgLen) < (unsigned long)(searchInfo1->hFileInfo.ioFlLgLen)) || - ((unsigned long)(cPB->hFileInfo.ioFlLgLen) > (unsigned long)(searchInfo2->hFileInfo.ioFlLgLen)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlPyLen) != 0 ) - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlPyLen) < (unsigned long)(searchInfo1->hFileInfo.ioFlPyLen)) || - ((unsigned long)(cPB->hFileInfo.ioFlPyLen) > (unsigned long)(searchInfo2->hFileInfo.ioFlPyLen)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlRLgLen) != 0 ) - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlRLgLen) < (unsigned long)(searchInfo1->hFileInfo.ioFlRLgLen)) || - ((unsigned long)(cPB->hFileInfo.ioFlRLgLen) > (unsigned long)(searchInfo2->hFileInfo.ioFlRLgLen)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlRPyLen) != 0 ) - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlRPyLen) < (unsigned long)(searchInfo1->hFileInfo.ioFlRPyLen)) || - ((unsigned long)(cPB->hFileInfo.ioFlRPyLen) > (unsigned long)(searchInfo2->hFileInfo.ioFlRPyLen)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlCrDat) != 0 ) /* fsSBFlCrDat is same as fsSBDrCrDat */ - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlCrDat) < (unsigned long)(searchInfo1->hFileInfo.ioFlCrDat)) || - ((unsigned long)(cPB->hFileInfo.ioFlCrDat) > (unsigned long)(searchInfo2->hFileInfo.ioFlCrDat)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlMdDat) != 0 ) /* fsSBFlMdDat is same as fsSBDrMdDat */ - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlMdDat) < (unsigned long)(searchInfo1->hFileInfo.ioFlMdDat)) || - ((unsigned long)(cPB->hFileInfo.ioFlMdDat) > (unsigned long)(searchInfo2->hFileInfo.ioFlMdDat)) ) - { - goto Failed; - } - } - - if ( (searchBits & fsSBFlBkDat) != 0 ) /* fsSBFlBkDat is same as fsSBDrBkDat */ - { - if ( ((unsigned long)(cPB->hFileInfo.ioFlBkDat) < (unsigned long)(searchInfo1->hFileInfo.ioFlBkDat)) || - ((unsigned long)(cPB->hFileInfo.ioFlBkDat) > (unsigned long)(searchInfo2->hFileInfo.ioFlBkDat)) ) - { - goto Failed; - } - } - - /* Hey, we passed all of the tests! */ - -Hit: - foundMatch = true; - -/* foundMatch is false if code jumps to Failed */ -Failed: - /* Do we reverse our findings? */ - if ( (searchBits & fsSBNegate) != 0 ) - { - foundMatch = !foundMatch; /* matches are not, not matches are */ - } - - if ( foundMatch ) - { - - /* Move the match into the match buffer */ - userPB->ioMatchPtr[userPB->ioActMatchCount].vRefNum = cPB->hFileInfo.ioVRefNum; - userPB->ioMatchPtr[userPB->ioActMatchCount].parID = cPB->hFileInfo.ioFlParID; - if ( cPB->hFileInfo.ioNamePtr[0] > 63 ) - { - cPB->hFileInfo.ioNamePtr[0] = 63; - } - BlockMoveData(cPB->hFileInfo.ioNamePtr, - userPB->ioMatchPtr[userPB->ioActMatchCount].name, - cPB->hFileInfo.ioNamePtr[0] + 1); - - /* increment the actual count */ - ++(userPB->ioActMatchCount); - } -} - -/*****************************************************************************/ - -/* -** TimeOutTask is executed when the timer goes off. It simply sets the -** stopSearch field to true. After each object is found and possibly added -** to the matches buffer, stopSearch is checked to see if the search should -** continue. -*/ - -#if __WANTPASCALELIMINATION -#undef pascal -#endif - -#if TARGET_RT_MAC_CFM || TARGET_API_MAC_CARBON - -static pascal void TimeOutTask(TMTaskPtr tmTaskPtr) -{ - ((ExtendedTMTaskPtr)tmTaskPtr)->stopSearch = true; -} - -#else - -static pascal TMTaskPtr GetTMTaskPtr(void) - ONEWORDINLINE(0x2e89); /* MOVE.L A1,(SP) */ - -static void TimeOutTask(void) -{ - ((ExtendedTMTaskPtr)GetTMTaskPtr())->stopSearch = true; -} - -#endif - -#if __WANTPASCALELIMINATION -#define pascal -#endif - -/*****************************************************************************/ - -/* -** GetDirModDate returns the modification date of a directory. If there is -** an error getting the modification date, -1 is returned to indicate -** something went wrong. -*/ -static long GetDirModDate(short vRefNum, - long dirID) -{ - CInfoPBRec pb; - Str31 tempName; - long modDate; - - /* Protection against File Sharing problem */ - tempName[0] = 0; - pb.dirInfo.ioNamePtr = tempName; - pb.dirInfo.ioVRefNum = vRefNum; - pb.dirInfo.ioDrDirID = dirID; - pb.dirInfo.ioFDirIndex = -1; /* use ioDrDirID */ - - if ( PBGetCatInfoSync(&pb) == noErr ) - { - modDate = pb.dirInfo.ioDrMdDat; - } - else - { - modDate = -1; - } - - return ( modDate ); -} - -/*****************************************************************************/ - -pascal OSErr IndexedSearch(CSParamPtr pb, - long dirID) -{ - static LevelRecHandle searchStack = NULL; /* static handle to LevelRec stack */ - static Size searchStackSize = 0; /* size of static handle */ - SearchPositionRecPtr catPosition; - long modDate; - short index = -1 ; - ExtendedTMTask timerTask; - OSErr result; - short realVRefNum; - Str63 itemName; - CInfoPBRec cPB; - long tempLong; - Boolean includeFiles; - Boolean includeDirs; - Boolean includeNames; - Str63 upperName; - - timerTask.stopSearch = false; /* don't stop yet! */ - - /* If request has a timeout, install a Time Manager task. */ - if ( pb->ioSearchTime != 0 ) - { - /* Start timer */ - timerTask.theTask.tmAddr = NewTimerUPP(TimeOutTask); - InsTime((QElemPtr)&(timerTask.theTask)); - PrimeTime((QElemPtr)&(timerTask.theTask), pb->ioSearchTime); - } - - /* Check the parameter block passed for things that we don't want to assume */ - /* are OK later in the code. For example, make sure pointers to data structures */ - /* and buffers are not NULL. And while we're in there, see if the request */ - /* specified searching for files, directories, or both, and see if the search */ - /* was by full or partial name. */ - result = VerifyUserPB(pb, &includeFiles, &includeDirs, &includeNames); - if ( result == noErr ) - { - pb->ioActMatchCount = 0; /* no matches yet */ - - if ( includeNames ) - { - /* The search includes seach by full or partial name. */ - /* Make an upper case copy of the match string to pass to */ - /* CheckForMatches. */ - BlockMoveData(pb->ioSearchInfo1->hFileInfo.ioNamePtr, - upperName, - pb->ioSearchInfo1->hFileInfo.ioNamePtr[0] + 1); - /* Use the same non-international call the File Manager uses */ - UpperString(upperName, true); - } - - /* Prevent casting to my type throughout code */ - catPosition = (SearchPositionRecPtr)&pb->ioCatPosition; - - /* Create searchStack first time called */ - if ( searchStack == NULL ) - { - searchStack = (LevelRecHandle)NewHandle(kAdditionalLevelRecs * sizeof(LevelRec)); - } - - /* Make sure searchStack really exists */ - if ( searchStack != NULL ) - { - searchStackSize = GetHandleSize((Handle)searchStack); - - /* See if the search is a new search or a resumed search. */ - if ( catPosition->initialize == 0 ) - { - /* New search. */ - - /* Get the real vRefNum and fill in catPosition->initialize. */ - result = CheckVol(pb->ioNamePtr, pb->ioVRefNum, &realVRefNum, &catPosition->initialize); - if ( result == noErr ) - { - /* clear searchStack */ - catPosition->stackDepth = 0; - - /* use dirID parameter passed and... */ - index = -1; /* start with the passed directory itself! */ - } - } - else - { - /* We're resuming a search. */ - - /* Get the real vRefNum and make sure catPosition->initialize is valid. */ - result = CheckVol(pb->ioNamePtr, pb->ioVRefNum, &realVRefNum, &tempLong); - if ( result == noErr ) - { - /* Make sure the resumed search is to the same volume! */ - if ( catPosition->initialize == tempLong ) - { - /* For resume, catPosition->stackDepth > 0 */ - if ( catPosition->stackDepth > 0 ) - { - /* Position catPosition->stackDepth to access last saved level */ - --(catPosition->stackDepth); - - /* Get the dirID and index for the next item */ - dirID = (*searchStack)[catPosition->stackDepth].dirID; - index = (*searchStack)[catPosition->stackDepth].index; - - /* Check the dir's mod date against the saved mode date on our "stack" */ - modDate = GetDirModDate(realVRefNum, dirID); - if ( modDate != (*searchStack)[catPosition->stackDepth].dirModDate ) - { - result = catChangedErr; - } - } - else - { - /* Invalid catPosition record was passed */ - result = paramErr; - } - } - else - { - /* The volume is not the same */ - result = catChangedErr; - } - } - } - - if ( result == noErr ) - { - /* ioNamePtr and ioVRefNum only need to be set up once. */ - cPB.hFileInfo.ioNamePtr = itemName; - cPB.hFileInfo.ioVRefNum = realVRefNum; - - /* - ** Here's the loop that: - ** Finds the next item on the volume. - ** If noErr, calls the code to check for matches and add matches - ** to the match buffer. - ** Sets up dirID and index for to find the next item on the volume. - ** - ** The looping ends when: - ** (a) an unexpected error is returned by PBGetCatInfo. All that - ** is expected is noErr and fnfErr (after the last item in a - ** directory is found). - ** (b) the caller specified a timeout and our Time Manager task - ** has fired. - ** (c) the number of matches requested by the caller has been found. - ** (d) the last item on the volume was found. - */ - do - { - /* get the next item */ - cPB.hFileInfo.ioFDirIndex = index; - cPB.hFileInfo.ioDirID = dirID; - result = PBGetCatInfoSync(&cPB); - if ( index != -1 ) - { - if ( result == noErr ) - { - /* We found something */ - - CheckForMatches(&cPB, pb, upperName, includeFiles, includeDirs); - - ++index; - if ( (cPB.dirInfo.ioFlAttrib & kioFlAttribDirMask) != 0 ) - { - /* It's a directory */ - - result = CheckStack(catPosition->stackDepth, searchStack, &searchStackSize); - if ( result == noErr ) - { - /* Save the current state on the searchStack */ - /* when we come back, this is where we'll start */ - (*searchStack)[catPosition->stackDepth].dirID = dirID; - (*searchStack)[catPosition->stackDepth].index = index; - (*searchStack)[catPosition->stackDepth].dirModDate = GetDirModDate(realVRefNum, dirID); - - /* position catPosition->stackDepth for next saved level */ - ++(catPosition->stackDepth); - - /* The next item to get is the 1st item in the child directory */ - dirID = cPB.dirInfo.ioDrDirID; - index = 1; - } - } - /* else do nothing for files */ - } - else - { - /* End of directory found (or we had some error and that */ - /* means we have to drop out of this directory). */ - /* Restore last thing put on stack and */ - /* see if we need to continue or quit. */ - if ( catPosition->stackDepth > 0 ) - { - /* position catPosition->stackDepth to access last saved level */ - --(catPosition->stackDepth); - - dirID = (*searchStack)[catPosition->stackDepth].dirID; - index = (*searchStack)[catPosition->stackDepth].index; - - /* Check the dir's mod date against the saved mode date on our "stack" */ - modDate = GetDirModDate(realVRefNum, dirID); - if ( modDate != (*searchStack)[catPosition->stackDepth].dirModDate ) - { - result = catChangedErr; - } - else - { - /* Going back to ancestor directory. */ - /* Clear error so we can continue. */ - result = noErr; - } - } - else - { - /* We hit the bottom of the stack, so we'll let the */ - /* the eofErr drop us out of the loop. */ - result = eofErr; - } - } - } - else - { - /* Special case for index == -1; that means that we're starting */ - /* a new search and so the first item to check is the directory */ - /* passed to us. */ - if ( result == noErr ) - { - /* We found something */ - - CheckForMatches(&cPB, pb, upperName, includeFiles, includeDirs); - - /* Now, set the index to 1 and then we're ready to look inside */ - /* the passed directory. */ - index = 1; - } - } - } while ( (!timerTask.stopSearch) && /* timer hasn't fired */ - (result == noErr) && /* no unexpected errors */ - (pb->ioReqMatchCount > pb->ioActMatchCount) ); /* we haven't found our limit */ - - /* Did we drop out of the loop because of timeout or */ - /* ioReqMatchCount was found? */ - if ( result == noErr ) - { - result = CheckStack(catPosition->stackDepth, searchStack, &searchStackSize); - if ( result == noErr ) - { - /* Either there was a timeout or ioReqMatchCount was reached. */ - /* Save the dirID and index for the next time we're called. */ - - (*searchStack)[catPosition->stackDepth].dirID = dirID; - (*searchStack)[catPosition->stackDepth].index = index; - (*searchStack)[catPosition->stackDepth].dirModDate = GetDirModDate(realVRefNum, dirID); - - /* position catPosition->stackDepth for next saved level */ - - ++(catPosition->stackDepth); - } - } - } - } - else - { - /* searchStack Handle could not be allocated */ - result = memFullErr; - } - } - - if ( pb->ioSearchTime != 0 ) - { - /* Stop Time Manager task here if it was installed */ - RmvTime((QElemPtr)&(timerTask.theTask)); - DisposeTimerUPP(timerTask.theTask.tmAddr); - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr PBCatSearchSyncCompat(CSParamPtr paramBlock) -{ - OSErr result; - Boolean supportsCatSearch; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize; -#if !__MACOSSEVENORLATER - static Boolean fullExtFSDispatchingtested = false; - static Boolean hasFullExtFSDispatching = false; - long response; -#endif - - result = noErr; - -#if !__MACOSSEVENORLATER - /* See if File Manager will pass CatSearch requests to external file systems */ - /* we'll store the results in a static variable so we don't have to call Gestalt */ - /* everytime we're called. (System 7.0 and later always do this) */ - if ( !fullExtFSDispatchingtested ) - { - fullExtFSDispatchingtested = true; - if ( Gestalt(gestaltFSAttr, &response) == noErr ) - { - hasFullExtFSDispatching = ((response & (1L << gestaltFullExtFSDispatching)) != 0); - } - } -#endif - - /* CatSearch is a per volume attribute, so we have to check each time we're */ - /* called to see if it is available on the volume specified. */ - supportsCatSearch = false; -#if !__MACOSSEVENORLATER - if ( hasFullExtFSDispatching ) -#endif - { - infoSize = sizeof(GetVolParmsInfoBuffer); - result = HGetVolParms(paramBlock->ioNamePtr, paramBlock->ioVRefNum, - &volParmsInfo, &infoSize); - if ( result == noErr ) - { - supportsCatSearch = hasCatSearch(&volParmsInfo); - } - } - - /* noErr or paramErr is OK here. */ - /* paramErr just means that GetVolParms isn't supported by this volume */ - if ( (result == noErr) || (result == paramErr) ) - { - if ( supportsCatSearch ) - { - /* Volume supports CatSearch so use it. */ - /* CatSearch is faster than an indexed search. */ - result = PBCatSearchSync(paramBlock); - } - else - { - /* Volume doesn't support CatSearch so */ - /* search using IndexedSearch from root directory. */ - result = IndexedSearch(paramBlock, fsRtDirID); - } - } - - return ( result ); -} - -/*****************************************************************************/ - -pascal OSErr NameFileSearch(ConstStr255Param volName, - short vRefNum, - ConstStr255Param fileName, - FSSpecPtr matches, - long reqMatchCount, - long *actMatchCount, - Boolean newSearch, - Boolean partial) -{ - CInfoPBRec searchInfo1, searchInfo2; - HParamBlockRec pb; - OSErr error; - static CatPositionRec catPosition; - static short lastVRefNum = 0; - - /* get the real volume reference number */ - error = DetermineVRefNum(volName, vRefNum, &vRefNum); - if ( error != noErr ) - return ( error ); - - pb.csParam.ioNamePtr = NULL; - pb.csParam.ioVRefNum = vRefNum; - pb.csParam.ioMatchPtr = matches; - pb.csParam.ioReqMatchCount = reqMatchCount; - if ( partial ) /* tell CatSearch what we're looking for: */ - { - pb.csParam.ioSearchBits = fsSBPartialName + fsSBFlAttrib; /* partial name file matches or */ - } - else - { - pb.csParam.ioSearchBits = fsSBFullName + fsSBFlAttrib; /* full name file matches */ - } - pb.csParam.ioSearchInfo1 = &searchInfo1; - pb.csParam.ioSearchInfo2 = &searchInfo2; - pb.csParam.ioSearchTime = 0; - if ( (newSearch) || /* If caller specified new search */ - (lastVRefNum != vRefNum) ) /* or if last search was to another volume, */ - { - catPosition.initialize = 0; /* then search from beginning of catalog */ - } - pb.csParam.ioCatPosition = catPosition; - pb.csParam.ioOptBuffer = GetTempBuffer(0x00004000, &pb.csParam.ioOptBufSize); - - /* search for fileName */ - searchInfo1.hFileInfo.ioNamePtr = (StringPtr)fileName; - searchInfo2.hFileInfo.ioNamePtr = NULL; - - /* only match files (not directories) */ - searchInfo1.hFileInfo.ioFlAttrib = 0x00; - searchInfo2.hFileInfo.ioFlAttrib = kioFlAttribDirMask; - - error = PBCatSearchSyncCompat((CSParamPtr)&pb); - - if ( (error == noErr) || /* If no errors or the end of catalog was */ - (error == eofErr) ) /* found, then the call was successful so */ - { - *actMatchCount = pb.csParam.ioActMatchCount; /* return the match count */ - } - else - { - *actMatchCount = 0; /* else no matches found */ - } - - if ( (error == noErr) || /* If no errors */ - (error == catChangedErr) ) /* or there was a change in the catalog */ - { - catPosition = pb.csParam.ioCatPosition; - lastVRefNum = vRefNum; - /* we can probably start the next search where we stopped this time */ - } - else - { - catPosition.initialize = 0; - /* start the next search from beginning of catalog */ - } - - if ( pb.csParam.ioOptBuffer != NULL ) - { - DisposePtr(pb.csParam.ioOptBuffer); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr CreatorTypeFileSearch(ConstStr255Param volName, - short vRefNum, - OSType creator, - OSType fileType, - FSSpecPtr matches, - long reqMatchCount, - long *actMatchCount, - Boolean newSearch) -{ - CInfoPBRec searchInfo1, searchInfo2; - HParamBlockRec pb; - OSErr error; - static CatPositionRec catPosition; - static short lastVRefNum = 0; - - /* get the real volume reference number */ - error = DetermineVRefNum(volName, vRefNum, &vRefNum); - if ( error != noErr ) - return ( error ); - - pb.csParam.ioNamePtr = NULL; - pb.csParam.ioVRefNum = vRefNum; - pb.csParam.ioMatchPtr = matches; - pb.csParam.ioReqMatchCount = reqMatchCount; - pb.csParam.ioSearchBits = fsSBFlAttrib + fsSBFlFndrInfo; /* Looking for finder info file matches */ - pb.csParam.ioSearchInfo1 = &searchInfo1; - pb.csParam.ioSearchInfo2 = &searchInfo2; - pb.csParam.ioSearchTime = 0; - if ( (newSearch) || /* If caller specified new search */ - (lastVRefNum != vRefNum) ) /* or if last search was to another volume, */ - { - catPosition.initialize = 0; /* then search from beginning of catalog */ - } - pb.csParam.ioCatPosition = catPosition; - pb.csParam.ioOptBuffer = GetTempBuffer(0x00004000, &pb.csParam.ioOptBufSize); - - /* no fileName */ - searchInfo1.hFileInfo.ioNamePtr = NULL; - searchInfo2.hFileInfo.ioNamePtr = NULL; - - /* only match files (not directories) */ - searchInfo1.hFileInfo.ioFlAttrib = 0x00; - searchInfo2.hFileInfo.ioFlAttrib = kioFlAttribDirMask; - - /* search for creator; if creator = 0x00000000, ignore creator */ - searchInfo1.hFileInfo.ioFlFndrInfo.fdCreator = creator; - if ( creator == (OSType)0x00000000 ) - { - searchInfo2.hFileInfo.ioFlFndrInfo.fdCreator = (OSType)0x00000000; - } - else - { - searchInfo2.hFileInfo.ioFlFndrInfo.fdCreator = (OSType)0xffffffff; - } - - /* search for fileType; if fileType = 0x00000000, ignore fileType */ - searchInfo1.hFileInfo.ioFlFndrInfo.fdType = fileType; - if ( fileType == (OSType)0x00000000 ) - { - searchInfo2.hFileInfo.ioFlFndrInfo.fdType = (OSType)0x00000000; - } - else - { - searchInfo2.hFileInfo.ioFlFndrInfo.fdType = (OSType)0xffffffff; - } - - /* zero all other FInfo fields */ - searchInfo1.hFileInfo.ioFlFndrInfo.fdFlags = 0; - searchInfo1.hFileInfo.ioFlFndrInfo.fdLocation.v = 0; - searchInfo1.hFileInfo.ioFlFndrInfo.fdLocation.h = 0; - searchInfo1.hFileInfo.ioFlFndrInfo.fdFldr = 0; - - searchInfo2.hFileInfo.ioFlFndrInfo.fdFlags = 0; - searchInfo2.hFileInfo.ioFlFndrInfo.fdLocation.v = 0; - searchInfo2.hFileInfo.ioFlFndrInfo.fdLocation.h = 0; - searchInfo2.hFileInfo.ioFlFndrInfo.fdFldr = 0; - - error = PBCatSearchSyncCompat((CSParamPtr)&pb); - - if ( (error == noErr) || /* If no errors or the end of catalog was */ - (error == eofErr) ) /* found, then the call was successful so */ - { - *actMatchCount = pb.csParam.ioActMatchCount; /* return the match count */ - } - else - { - *actMatchCount = 0; /* else no matches found */ - } - - if ( (error == noErr) || /* If no errors */ - (error == catChangedErr) ) /* or there was a change in the catalog */ - { - catPosition = pb.csParam.ioCatPosition; - lastVRefNum = vRefNum; - /* we can probably start the next search where we stopped this time */ - } - else - { - catPosition.initialize = 0; - /* start the next search from beginning of catalog */ - } - - if ( pb.csParam.ioOptBuffer != NULL ) - { - DisposePtr(pb.csParam.ioOptBuffer); - } - - return ( error ); -} - -/*****************************************************************************/ diff --git a/src/mac/classic/morefile/Search.h b/src/mac/classic/morefile/Search.h deleted file mode 100644 index 3fee03dea8..0000000000 --- a/src/mac/classic/morefile/Search.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - File: Search.h - - Contains: IndexedSearch and the PBCatSearch compatibility function. - - Version: Technology: MoreFiles - Release: 1.5.2 - - Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ - -/* - You may incorporate this sample code into your applications without - restriction, though the sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. However, what you are - not permitted to do is to redistribute the source as "DSC Sample Code" - after having made changes. If you're going to re-distribute the source, - we require that you make it clear in the source that the code was - descended from Apple Sample Code, but that you've made changes. -*/ - -#ifndef __SEARCH__ -#define __SEARCH__ - -#ifndef __MACTYPES__ -#include -#endif - -#ifndef __FILES__ -#include -#endif - -#include "Optimization.h" - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_IMPORT -#pragma import on -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -IndexedSearch( - CSParamPtr pb, - long dirID); - - -/* - The IndexedSearch function performs an indexed search in and below the - specified directory using the same parameters (in pb) as is passed to - PBCatSearch. See Inside Macintosh: Files for a description of the - parameter block. - - pb input: A CSParamPtr record specifying the volume to search - and the search criteria. - output: Fields in the parameter block are returned indicating - the number of matches found, the matches, and if the - search ended with noErr, the CatPosition record that - lets you resume a search where the last search left - off. - dirID input: The directory to search. If fsRtDirID is passed, - the entire volume is searched. - - Note: If you use a high-level debugger and use ioSearchTime to limit - the length of time to run the search, you'll want to step over - calls to IndexedSearch because it installs a Time Manager task. - Most high-level debuggers don't deal gracefully with interrupt - driven code. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - eofErr -39 End of catalog found (this is normal!) - paramErr -50 Parameter block has invalid parameters - (see source for VerifyUserPB) or - invalid catPosition record was passed - extFSErr -58 External file system error - no file - system claimed this call. - memFullErr -108 Memory could not be allocated in heap - catChangedErr -1304 Catalog has changed and catalog position - record may be invalid - - __________ - - See also: PBCatSearch, PBCatSearchSyncCompat -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -PBCatSearchSyncCompat(CSParamPtr paramBlock); - - -/* - The PBCatSearchSyncCompat function uses PBCatSearch (if available) or - IndexedSearch (if PBCatSearch is not available) to search a volume - using a set of search criteria that you specify. It builds a list of all - files or directories that meet your specifications. - - pb input: A CSParamPtr record specifying the volume to search - and the search criteria. - output: Fields in the parameter block are returned indicating - the number of matches found, the matches, and if the - search ended with noErr, the CatPosition record that - lets you resume a search where the last search left - off. - - Note: If you use a high-level debugger and use ioSearchTime to limit - the length of time to run the search, you'll want to step over - calls to PBCatSearchSyncCompat because it calls IndexedSearch - which installs a Time Manager task. Most high-level debuggers - don't deal gracefully with interrupt driven code. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - eofErr -39 End of catalog found (this is normal!) - paramErr -50 Parameter block has invalid parameters - (see source for VerifyUserPB) or - invalid catPosition record was passed - extFSErr -58 External file system error - no file - system claimed this call. - memFullErr -108 Memory could not be allocated in heap - catChangedErr -1304 Catalog has changed and catalog position - record may be invalid - afpCatalogChanged -5037 Catalog has changed and search cannot - be resumed - - __________ - - See also: PBCatSearch, IndexedSearch -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -NameFileSearch( - ConstStr255Param volName, - short vRefNum, - ConstStr255Param fileName, - FSSpecPtr matches, - long reqMatchCount, - long * actMatchCount, - Boolean newSearch, - Boolean partial); - - -/* - The NameFileSearch function searches for files with a specific file - name on a volume that supports PBCatSearch. - Note: A result of catChangedErr means the catalog has changed between - searches, but the search can be continued with the possiblity that you - may miss some matches or get duplicate matches. For all other results - (except for noErr), the search cannot be continued. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - fileName input: The name of the file to search for. - matches input: Pointer to array of FSSpec where the match list is - returned. - reqMatchCount input: Maximum number of matches to return (the number of - elements in the matches array). - actMatchCount output: The number of matches actually returned. - newSearch input: If true, start a new search. If false and if - vRefNum is the same as the last call to - NameFileSearch, then start searching at the - position where the last search left off. - partial input: If the partial parameter is false, then only files - that exactly match fileName will be found. If the - partial parameter is true, then all file names that - contain fileName will be found. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - eofErr -39 End of catalog found (this is normal!) - paramErr -50 Parameter block has invalid parameters - (see source for VerifyUserPB) or - invalid catPosition record was passed - extFSErr -58 External file system error - no file - system claimed this call. - memFullErr -108 Memory could not be allocated in heap - catChangedErr -1304 Catalog has changed and catalog position - record may be invalid - afpCatalogChanged -5037 Catalog has changed and search cannot - be resumed - - __________ - - Also see: CreatorTypeFileSearch -*/ - -/*****************************************************************************/ - -EXTERN_API( OSErr ) -CreatorTypeFileSearch( - ConstStr255Param volName, - short vRefNum, - OSType creator, - OSType fileType, - FSSpecPtr matches, - long reqMatchCount, - long * actMatchCount, - Boolean newSearch); - - -/* - The CreatorTypeFileSearch function searches for files with a specific - creator or fileType on a volume that supports PBCatSearch. - Note: A result of catChangedErr means the catalog has changed between - searches, but the search can be continued with the possiblity that you - may miss some matches or get duplicate matches. For all other results - (except for noErr), the search cannot be continued. - - volName input: A pointer to the name of a mounted volume - or nil. - vRefNum input: Volume specification. - creator input: The creator type of the file to search for. - To ignore the creator type, pass 0x00000000 in - this field. - fileType input: The file type of the file to search for. - To ignore the file type, pass 0x00000000 in - this field. - matches input: Pointer to array of FSSpec where the match list is - returned. - reqMatchCount input: Maximum number of matches to return (the number of - elements in the matches array). - actMatchCount output: The number of matches actually returned. - newSearch input: If true, start a new search. If false and if - vRefNum is the same as the last call to - CreatorTypeFileSearch, then start searching at the - position where the last search left off. - - Result Codes - noErr 0 No error - nsvErr -35 Volume not found - ioErr -36 I/O error - eofErr -39 End of catalog found (this is normal!) - paramErr -50 Parameter block has invalid parameters - (see source for VerifyUserPB) or - invalid catPosition record was passed - extFSErr -58 External file system error - no file - system claimed this call. - memFullErr -108 Memory could not be allocated in heap - catChangedErr -1304 Catalog has changed and catalog position - record may be invalid - afpCatalogChanged -5037 Catalog has changed and search cannot - be resumed - - __________ - - Also see: NameFileSearch -*/ - -/*****************************************************************************/ - -#include "OptimizationEnd.h" - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef PRAGMA_IMPORT_OFF -#pragma import off -#elif PRAGMA_IMPORT -#pragma import reset -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __SEARCH__ */ - diff --git a/src/mac/classic/msgdlg.cpp b/src/mac/classic/msgdlg.cpp deleted file mode 100644 index 73548ad9f2..0000000000 --- a/src/mac/classic/msgdlg.cpp +++ /dev/null @@ -1,262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msgdlg.cpp -// Purpose: wxMessageDialog -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "msgdlg.h" -#endif - -#include "wx/app.h" -#include "wx/msgdlg.h" -#include "wx/intl.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -#endif - -wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption, - long style, const wxPoint& pos) -{ - m_caption = caption; - m_message = message; - m_dialogStyle = style; - m_parent = parent; -} - -int wxMessageDialog::ShowModal() -{ - int resultbutton = wxID_CANCEL ; - - short result ; - - wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , wxT("this style is not supported on mac") ) ; - - AlertType alertType = kAlertPlainAlert ; - if (m_dialogStyle & wxICON_EXCLAMATION) - alertType = kAlertNoteAlert ; - else if (m_dialogStyle & wxICON_HAND) - alertType = kAlertStopAlert ; - else if (m_dialogStyle & wxICON_INFORMATION) - alertType = kAlertNoteAlert ; - else if (m_dialogStyle & wxICON_QUESTION) - alertType = kAlertCautionAlert ; - -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) - { - AlertStdCFStringAlertParamRec param ; - wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ; - wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ; - - wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding()); - wxMacCFStringHolder cfText(m_message , m_font.GetEncoding()); - - param.movable = true; - param.flags = 0 ; - - bool skipDialog = false ; - - if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = cfYesString ; - param.cancelText = (CFStringRef) kAlertDefaultCancelText; - param.otherText = cfNoString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = kAlertStdAlertCancelButton; - } - else - { - param.defaultText = cfYesString ; - param.cancelText = NULL; - param.otherText = cfNoString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - // the msw implementation even shows an ok button if it is not specified, we'll do the same - else - { - if (m_dialogStyle & wxCANCEL) - { - // thats a cancel missing - param.defaultText = (CFStringRef) kAlertDefaultOKText ; - param.cancelText = (CFStringRef) kAlertDefaultCancelText ; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - else - { - param.defaultText = (CFStringRef) kAlertDefaultOKText ; - param.cancelText = NULL; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - /* - else - { - skipDialog = true ; - } - */ - - param.position = kWindowDefaultPosition; - if ( !skipDialog ) - { - DialogRef alertRef ; - CreateStandardAlert( alertType , cfTitle , cfText , ¶m , &alertRef ) ; - RunStandardAlert( alertRef , NULL , &result ) ; - } - if ( skipDialog ) - return wxID_CANCEL ; - } - else -#endif - { - AlertStdAlertParamRec param; - - Str255 yesPString ; - Str255 noPString ; - - Str255 pascalTitle ; - Str255 pascalText ; - wxMacStringToPascal( m_caption , pascalTitle ) ; - wxMacStringToPascal( _("Yes") , yesPString ) ; - wxMacStringToPascal( _("No") , noPString ) ; - wxMacStringToPascal( m_message , pascalText ) ; - - param.movable = true; - param.filterProc = NULL ; - if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = yesPString ; - param.cancelText = (StringPtr) kAlertDefaultCancelText; - param.otherText = noPString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = kAlertStdAlertCancelButton; - } - else - { - param.defaultText = yesPString ; - param.cancelText = NULL; - param.otherText = noPString ; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - else if (m_dialogStyle & wxOK) - { - if (m_dialogStyle & wxCANCEL) - { - param.defaultText = (StringPtr) kAlertDefaultOKText ; - param.cancelText = (StringPtr) kAlertDefaultCancelText ; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - else - { - param.defaultText = (StringPtr) kAlertDefaultOKText ; - param.cancelText = NULL; - param.otherText = NULL; - param.helpButton = false ; - param.defaultButton = kAlertStdAlertOKButton; - param.cancelButton = 0; - } - } - else - { - return resultbutton ; - } - - param.position = 0; - - StandardAlert( alertType, pascalTitle, pascalText, ¶m, &result ); - } - - if (m_dialogStyle & wxOK) - { - if (m_dialogStyle & wxCANCEL) - { - //TODO add Cancelbutton - switch( result ) - { - case 1 : - resultbutton = wxID_OK ; - break ; - case 2 : - break ; - case 3 : - break ; - } - } - else - { - switch( result ) - { - case 1 : - resultbutton = wxID_OK ; - break ; - case 2 : - break ; - case 3 : - break ; - } - } - } - else if (m_dialogStyle & wxYES_NO) - { - if (m_dialogStyle & wxCANCEL) - { - switch( result ) - { - case 1 : - resultbutton = wxID_YES ; - break ; - case 2 : - resultbutton = wxID_CANCEL ; - break ; - case 3 : - resultbutton = wxID_NO ; - break ; - } - } - else - { - switch( result ) - { - case 1 : - resultbutton = wxID_YES ; - break ; - case 2 : - break ; - case 3 : - resultbutton = wxID_NO ; - break ; - } - } - } - - return resultbutton ; -} - diff --git a/src/mac/classic/notebmac.cpp b/src/mac/classic/notebmac.cpp deleted file mode 100644 index 9aa4fdf5b9..0000000000 --- a/src/mac/classic/notebmac.cpp +++ /dev/null @@ -1,729 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: notebook.cpp -// Purpose: implementation of wxNotebook -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "notebook.h" -#endif - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/app.h" -#include "wx/string.h" -#include "wx/log.h" -#include "wx/imaglist.h" -#include "wx/image.h" -#include "wx/notebook.h" -#include "wx/mac/uma.h" -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) - - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) - -BEGIN_EVENT_TABLE(wxNotebook, wxControl) - EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) - EVT_MOUSE_EVENTS(wxNotebook::OnMouse) - - EVT_SIZE(wxNotebook::OnSize) - EVT_SET_FOCUS(wxNotebook::OnSetFocus) - EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// The Appearance Manager docs show using tab controls in either edge to edge -// mode, or inset. I think edge to edge conforms better to the other ports, -// and inset mode is better accomplished with space around the wxNotebook rather -// than within it. --Robin - -// CS : had to switch off tight spacing due to 10.3 problems -#define wxMAC_EDGE_TO_EDGE 0 - -static inline int wxMacTabMargin(long nbStyle, long side) -{ - static int tabMargin = -1; - static int otherMargin = -1; - - if ( tabMargin == -1) - { - if ( UMAHasAquaLayout() ) - { - tabMargin = 26; // From Appearance Manager docs for small tab control dimensions -#if wxMAC_EDGE_TO_EDGE - otherMargin = 0; -#else -// otherMargin = 20; - // JACS - this seems fine on 10.3; 20 is way too much - otherMargin = 8; -#endif - } - else - { - tabMargin = 30; -#if wxMAC_EDGE_TO_EDGE - otherMargin = 0; -#else - otherMargin = 16; -#endif - } - } - - // If the style matches the side asked for then return the tab margin, - // but we have to special case wxNB_TOP since it is zero... - if ( side == wxNB_TOP) - { - if ( nbStyle != 0 && nbStyle & (wxNB_LEFT|wxNB_RIGHT|wxNB_BOTTOM)) - { - return otherMargin; - } - else - { - return tabMargin; - } - } - else if ( nbStyle & side) - return tabMargin; - else - return otherMargin; -} - -static inline int wxMacTabLeftMargin(long style) -{ - return wxMacTabMargin(style, wxNB_LEFT); -} - -static inline int wxMacTabTopMargin(long style) -{ - return wxMacTabMargin(style, wxNB_TOP); -} - -static inline int wxMacTabRightMargin(long style) -{ - return wxMacTabMargin(style, wxNB_RIGHT); -} - -static inline int wxMacTabBottomMargin(long style) -{ - return wxMacTabMargin(style, wxNB_BOTTOM); -} - -// ---------------------------------------------------------------------------- -// wxNotebook construction -// ---------------------------------------------------------------------------- - -// common part of all ctors -void wxNotebook::Init() -{ - if ( UMAHasAquaLayout() ) - { - // Should these depend on wxMAC_EDGE_TO_EDGE too? - m_macHorizontalBorder = 7; - m_macVerticalBorder = 8; - } - - m_nSelection = -1; -} - -// default for dynamic class -wxNotebook::wxNotebook() -{ - Init(); -} - -// the same arguments as for wxControl -wxNotebook::wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - Create(parent, id, pos, size, style, name); -} - -// Create() function -bool wxNotebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - int tabstyle = kControlTabSmallNorthProc ; - if ( HasFlag(wxNB_LEFT) ) - tabstyle = kControlTabSmallWestProc ; - else if ( HasFlag( wxNB_RIGHT ) ) - tabstyle = kControlTabSmallEastProc ; - else if ( HasFlag( wxNB_BOTTOM ) ) - tabstyle = kControlTabSmallSouthProc ; - - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - tabstyle , (long) this ) ; - - MacPostControlCreate() ; - return TRUE ; -} - -// dtor -wxNotebook::~wxNotebook() -{ -} - -// ---------------------------------------------------------------------------- -// wxNotebook accessors -// ---------------------------------------------------------------------------- - -void wxNotebook::SetPadding(const wxSize& padding) -{ - // unsupported by OS -} - -void wxNotebook::SetTabSize(const wxSize& sz) -{ - // unsupported by OS -} - -void wxNotebook::SetPageSize(const wxSize& size) -{ - SetSize( CalcSizeFromPage( size ) ); -} - -wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - wxSize sizeTotal = sizePage; - sizeTotal.x += 2 * m_macHorizontalBorder + wxMacTabLeftMargin(GetWindowStyle()) + - wxMacTabRightMargin(GetWindowStyle()) ; - sizeTotal.y += 2 * m_macVerticalBorder + wxMacTabTopMargin(GetWindowStyle()) + - wxMacTabBottomMargin(GetWindowStyle()) ; - - return sizeTotal; -} - -wxSize wxNotebook::DoGetBestSize() const -{ - // calculate the max page size - wxSize size(0, 0); - - size_t count = GetPageCount(); - if ( count ) - { - for ( size_t n = 0; n < count; n++ ) - { - wxSize sizePage = m_pages[n]->GetSize(); - - if ( size.x < sizePage.x ) - size.x = sizePage.x; - if ( size.y < sizePage.y ) - size.y = sizePage.y; - } - } - else // no pages - { - // use some arbitrary default size - size.x = - size.y = 100; - } - - return CalcSizeFromPage(size); -} - -int wxNotebook::SetSelection(size_t nPage) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); - - if ( int(nPage) != m_nSelection ) - { - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId); - event.SetSelection(nPage); - event.SetOldSelection(m_nSelection); - event.SetEventObject(this); - if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) - { - // program allows the page change - event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED); - (void)GetEventHandler()->ProcessEvent(event); - - ChangePage(m_nSelection, nPage); - } - } - - return m_nSelection; -} - -bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage *page = m_pages[nPage]; - page->SetLabel(strText); - MacSetupTabs(); - - return true; -} - -wxString wxNotebook::GetPageText(size_t nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage *page = m_pages[nPage]; - return page->GetLabel(); -} - -int wxNotebook::GetPageImage(size_t nPage) const -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); - - return m_images[nPage]; -} - -bool wxNotebook::SetPageImage(size_t nPage, int nImage) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); - - wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, - _T("invalid image index in SetPageImage()") ); - - if ( nImage != m_images[nPage] ) - { - // if the item didn't have an icon before or, on the contrary, did have - // it but has lost it now, its size will change - but if the icon just - // changes, it won't - m_images[nPage] = nImage; - - MacSetupTabs() ; - } - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxNotebook operations -// ---------------------------------------------------------------------------- - -// remove one page from the notebook, without deleting the window -wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), NULL ); - wxNotebookPage* page = m_pages[nPage] ; - m_pages.RemoveAt(nPage); - - MacSetupTabs(); - - if(m_nSelection >= (int)GetPageCount()) { - m_nSelection = GetPageCount() - 1; - } - if(m_nSelection >= 0) { - m_pages[m_nSelection]->Show(true); - } - return page; -} - -// remove all pages -bool wxNotebook::DeleteAllPages() -{ - WX_CLEAR_ARRAY(m_pages) ; - MacSetupTabs(); - m_nSelection = -1 ; - return TRUE; -} - - -// same as AddPage() but does it at given position -bool wxNotebook::InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - if ( !wxNotebookBase::InsertPage(nPage, pPage, strText, bSelect, imageId) ) - return false; - - wxASSERT_MSG( pPage->GetParent() == this, - _T("notebook pages must have notebook as parent") ); - - // don't show pages by default (we'll need to adjust their size first) - pPage->Show( false ) ; - - pPage->SetLabel(strText); - - m_images.Insert(imageId, nPage); - - MacSetupTabs(); - - wxRect rect = GetPageRect() ; - pPage->SetSize(rect); - if ( pPage->GetAutoLayout() ) { - pPage->Layout(); - } - - - // now deal with the selection - // --------------------------- - - // if the inserted page is before the selected one, we must update the - // index of the selected page - - if ( int(nPage) <= m_nSelection ) - { - m_nSelection++; - // while this still is the same page showing, we need to update the tabs - SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; - } - - // some page should be selected: either this one or the first one if there - // is still no selection - int selNew = -1; - if ( bSelect ) - selNew = nPage; - else if ( m_nSelection == -1 ) - selNew = 0; - - if ( selNew != -1 ) - SetSelection(selNew); - - return true; -} - -/* Added by Mark Newsam -* When a page is added or deleted to the notebook this function updates -* information held in the m_macControl so that it matches the order -* the user would expect. -*/ -void wxNotebook::MacSetupTabs() -{ - SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; - - wxNotebookPage *page; - ControlTabInfoRec info; - - const size_t countPages = GetPageCount(); - for(size_t ii = 0; ii < countPages; ii++) - { - page = m_pages[ii]; - info.version = 0; - info.iconSuiteID = 0; - wxMacStringToPascal( page->GetLabel() , info.name ) ; - - SetControlData( (ControlHandle) m_macControl, ii+1, kControlTabInfoTag, - sizeof( ControlTabInfoRec) , (char*) &info ) ; - SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ; -#if TARGET_CARBON - if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 ) - { - // tab controls only support very specific types of images, therefore we are doing an odyssee - // accross the icon worlds (even Apple DTS did not find a shorter path) - // in order not to pollute the icon registry we put every icon into (OSType) 1 and immediately - // afterwards Unregister it (IconRef is ref counted, so it will stay on the tab even if we - // unregister it) in case this will ever lead to having the same icon everywhere add some kind - // of static counter - const wxBitmap* bmap = GetImageList()->GetBitmap( GetPageImage(ii ) ) ; - if ( bmap ) - { - wxBitmap scaledBitmap ; - if ( bmap->GetWidth() != 16 || bmap->GetHeight() != 16 ) - { - scaledBitmap = wxBitmap( bmap->ConvertToImage().Scale(16,16) ) ; - bmap = &scaledBitmap ; - } - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , *bmap , kControlContentPictHandle) ; - IconFamilyHandle iconFamily = (IconFamilyHandle) NewHandle(0) ; - OSErr err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ; - wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ; - IconRef iconRef ; - err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) 1, iconFamily, &iconRef ) ; - wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ; - info.contentType = kControlContentIconRef ; - info.u.iconRef = iconRef ; - SetControlData( (ControlHandle) m_macControl, ii+1,kControlTabImageContentTag, - sizeof( info ), (Ptr)&info ); - wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ; - if ( UMAGetSystemVersion() < 0x1030 ) - { - UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; - } - - ReleaseIconRef( iconRef ) ; - DisposeHandle( (Handle) iconFamily ) ; - } - } -#endif - } - Rect bounds; - GetControlBounds((ControlHandle)m_macControl, &bounds); - InvalWindowRect((WindowRef)MacGetRootWindow(), &bounds); -} - -wxRect wxNotebook::GetPageRect() const -{ - // fit the notebook page to the tab control's display area - int w, h; - GetSize(&w, &h); - - return wxRect( - wxMacTabLeftMargin(GetWindowStyle()) + m_macHorizontalBorder, - wxMacTabTopMargin(GetWindowStyle()) + m_macVerticalBorder, - w - wxMacTabLeftMargin(GetWindowStyle()) - wxMacTabRightMargin(GetWindowStyle()) - 2*m_macHorizontalBorder, - h - wxMacTabTopMargin(GetWindowStyle()) - wxMacTabBottomMargin(GetWindowStyle()) - 2*m_macVerticalBorder); -} -// ---------------------------------------------------------------------------- -// wxNotebook callbacks -// ---------------------------------------------------------------------------- - -// @@@ OnSize() is used for setting the font when it's called for the first -// time because doing it in ::Create() doesn't work (for unknown reasons) -void wxNotebook::OnSize(wxSizeEvent& event) -{ - - unsigned int nCount = m_pages.Count(); - wxRect rect = GetPageRect() ; - for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { - wxNotebookPage *pPage = m_pages[nPage]; - pPage->SetSize(rect); - if ( pPage->GetAutoLayout() ) { - pPage->Layout(); - } - } - - // Processing continues to next OnSize - event.Skip(); -} - -void wxNotebook::OnSelChange(wxNotebookEvent& event) -{ - // is it our tab control? - if ( event.GetEventObject() == this ) - ChangePage(event.GetOldSelection(), event.GetSelection()); - - // we want to give others a chance to process this message as well - event.Skip(); -} - -void wxNotebook::OnSetFocus(wxFocusEvent& event) -{ - // set focus to the currently selected page if any - if ( m_nSelection != -1 ) - m_pages[m_nSelection]->SetFocus(); - - event.Skip(); -} - -void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) -{ - if ( event.IsWindowChange() ) { - // change pages - AdvanceSelection(event.GetDirection()); - } - else { - // we get this event in 2 cases - // - // a) one of our pages might have generated it because the user TABbed - // out from it in which case we should propagate the event upwards and - // our parent will take care of setting the focus to prev/next sibling - // - // or - // - // b) the parent panel wants to give the focus to us so that we - // forward it to our selected page. We can't deal with this in - // OnSetFocus() because we don't know which direction the focus came - // from in this case and so can't choose between setting the focus to - // first or last panel child - wxWindow *parent = GetParent(); - // the cast is here to fic a GCC ICE - if ( ((wxWindow*)event.GetEventObject()) == parent ) - { - // no, it doesn't come from child, case (b): forward to a page - if ( m_nSelection != -1 ) - { - // so that the page knows that the event comes from it's parent - // and is being propagated downwards - event.SetEventObject(this); - - wxWindow *page = m_pages[m_nSelection]; - if ( !page->GetEventHandler()->ProcessEvent(event) ) - { - page->SetFocus(); - } - //else: page manages focus inside it itself - } - else - { - // we have no pages - still have to give focus to _something_ - SetFocus(); - } - } - else - { - // it comes from our child, case (a), pass to the parent - if ( parent ) { - event.SetCurrentFocus(this); - parent->GetEventHandler()->ProcessEvent(event); - } - } - } -} - -// ---------------------------------------------------------------------------- -// wxNotebook base class virtuals -// ---------------------------------------------------------------------------- - -#if wxUSE_CONSTRAINTS - -// override these 2 functions to do nothing: everything is done in OnSize - -void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse)) -{ - // don't set the sizes of the pages - their correct size is not yet known - wxControl::SetConstraintSizes(FALSE); -} - -bool wxNotebook::DoPhase(int WXUNUSED(nPhase)) -{ - return TRUE; -} - -#endif // wxUSE_CONSTRAINTS - -void wxNotebook::Command(wxCommandEvent& event) -{ - wxFAIL_MSG(wxT("wxNotebook::Command not implemented")); -} - -// ---------------------------------------------------------------------------- -// wxNotebook helper functions -// ---------------------------------------------------------------------------- - -// hide the currently active panel and show the new one -void wxNotebook::ChangePage(int nOldSel, int nSel) -{ - if ( nOldSel != -1 ) - { - m_pages[nOldSel]->Show(FALSE); - } - - if ( nSel != -1 ) - { - wxNotebookPage *pPage = m_pages[nSel]; - pPage->Show(TRUE); - pPage->SetFocus(); - } - - m_nSelection = nSel; - SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; -} - - -void wxNotebook::OnMouse( wxMouseEvent &event ) -{ - if ( (ControlHandle) m_macControl == NULL ) - { - event.Skip() ; - return ; - } - - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - - control = (ControlHandle) m_macControl ; - if ( control && ::IsControlActive( control ) ) - { - { - wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId, - ::GetControl32BitValue(control) - 1, m_nSelection); - changing.SetEventObject(this); - GetEventHandler()->ProcessEvent(changing); - - if(changing.IsAllowed()) - { - controlpart = ::HandleControlClick(control, localwhere, modifiers, - (ControlActionUPP) -1); - wxTheApp->s_lastMouseDown = 0 ; - - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, - ::GetControl32BitValue(control) - 1, m_nSelection); - event.SetEventObject(this); - - GetEventHandler()->ProcessEvent(event); - } - } - } - } -} - - -void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ -#if 0 - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControl32BitValue((ControlHandle)m_macControl) - 1, m_nSelection); - event.SetEventObject(this); - - ProcessEvent(event); -#endif -} - diff --git a/src/mac/classic/palette.cpp b/src/mac/classic/palette.cpp deleted file mode 100644 index 60a0de6a8a..0000000000 --- a/src/mac/classic/palette.cpp +++ /dev/null @@ -1,118 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.cpp -// Purpose: wxPalette -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "palette.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_PALETTE - -#include "wx/palette.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) -#endif - -/* - * Palette - * - */ - -wxPaletteRefData::wxPaletteRefData() -{ - m_palette = NULL ; - m_count = 0 ; -} - -wxPaletteRefData::~wxPaletteRefData() -{ - if (m_palette != NULL) { - delete[] m_palette ; - m_palette = NULL; - } -} - -wxPalette::wxPalette() -{ -} - -wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - Create(n, red, green, blue); -} - -wxPalette::~wxPalette() -{ -} - -bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - UnRef(); - - m_refData = new wxPaletteRefData; - - M_PALETTEDATA->m_count = n ; - M_PALETTEDATA->m_palette = new wxColour[n] ; - - for ( int i = 0 ; i < n ; ++i) - { - M_PALETTEDATA->m_palette[i].Set( red[i] , green[i] , blue[i] ) ; - } - - return FALSE; -} - -int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const -{ - if ( !m_refData ) - return -1; - - long bestdiff = 3 * 256 ; - long bestpos = 0 ; - long currentdiff ; - - for ( int i = 0 ; i < M_PALETTEDATA->m_count ; ++i ) - { - const wxColour& col = &M_PALETTEDATA->m_palette[i] ; - currentdiff = abs ( col.Red() - red ) + abs( col.Green() - green ) + abs ( col.Blue() - blue ) ; - if ( currentdiff < bestdiff ) - { - bestdiff = currentdiff ; - bestpos = i ; - if ( bestdiff == 0 ) - break ; - } - } - - return bestpos; -} - -bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const -{ - if ( !m_refData ) - return FALSE; - - if (index < 0 || index >= M_PALETTEDATA->m_count) - return FALSE; - - const wxColour& col = &M_PALETTEDATA->m_palette[index] ; - *red = col.Red() ; - *green = col.Green() ; - *blue = col.Blue() ; - - return TRUE; -} - -#endif -// wxUSE_PALETTE - diff --git a/src/mac/classic/pen.cpp b/src/mac/classic/pen.cpp deleted file mode 100644 index fea55ab34e..0000000000 --- a/src/mac/classic/pen.cpp +++ /dev/null @@ -1,186 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp -// Purpose: wxPen -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "pen.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/pen.h" - -#if !USE_SHARED_LIBRARIES -IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) -#endif - -wxPenRefData::wxPenRefData() -{ - m_style = wxSOLID; - m_width = 1; - m_join = wxJOIN_ROUND ; - m_cap = wxCAP_ROUND ; - m_nbDash = 0 ; - m_dash = 0 ; -} - -wxPenRefData::wxPenRefData(const wxPenRefData& data) -: wxGDIRefData() -{ - m_style = data.m_style; - m_width = data.m_width; - m_join = data.m_join; - m_cap = data.m_cap; - m_nbDash = data.m_nbDash; - m_dash = data.m_dash; - m_colour = data.m_colour; -} - -wxPenRefData::~wxPenRefData() -{ -} - -// Pens - -wxPen::wxPen() -{ -} - -wxPen::~wxPen() -{ -} - -// Should implement Create -wxPen::wxPen(const wxColour& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = 0 ; - - RealizeResource(); -} - -wxPen::wxPen(const wxBitmap& stipple, int Width) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_stipple = stipple; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = wxSTIPPLE; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = 0 ; - - RealizeResource(); -} - -void wxPen::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxPenRefData(); - } - else - { - wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxPen::SetColour(const wxColour& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - Unshare(); - - M_PENDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxPen::SetWidth(int Width) -{ - Unshare(); - - M_PENDATA->m_width = Width; - - RealizeResource(); -} - -void wxPen::SetStyle(int Style) -{ - Unshare(); - - M_PENDATA->m_style = Style; - - RealizeResource(); -} - -void wxPen::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_PENDATA->m_stipple = Stipple; - M_PENDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) -{ - Unshare(); - - M_PENDATA->m_nbDash = nb_dashes; - M_PENDATA->m_dash = (wxDash *)Dash; - - RealizeResource(); -} - -void wxPen::SetJoin(int Join) -{ - Unshare(); - - M_PENDATA->m_join = Join; - - RealizeResource(); -} - -void wxPen::SetCap(int Cap) -{ - Unshare(); - - M_PENDATA->m_cap = Cap; - - RealizeResource(); -} - -bool wxPen::RealizeResource() -{ - // nothing to do here for mac - return TRUE; -} - - diff --git a/src/mac/classic/pnghand.cpp b/src/mac/classic/pnghand.cpp deleted file mode 100644 index f25141d7e9..0000000000 --- a/src/mac/classic/pnghand.cpp +++ /dev/null @@ -1,904 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pnghand.cpp -// Purpose: Implements a PNG reader class + handler -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -# pragma implementation "pngread.h" -# pragma implementation "pnghand.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -# pragma hdrstop -#endif - -#include -#include -#include - -#if wxUSE_IOSTREAMH -# include -#else -# include -#endif - -#ifndef __DARWIN__ -# include -#endif -#include "wx/msgdlg.h" -#include "wx/palette.h" -#include "wx/bitmap.h" -#include "wx/mac/pnghand.h" -#include "wx/mac/pngread.h" -#include "wx/mac/private.h" - -extern "C" { -#include "png.h" -} - -extern "C" void png_read_init PNGARG((png_structp png_ptr)); -extern "C" void png_write_init PNGARG((png_structp png_ptr)); - -extern CTabHandle wxMacCreateColorTable( int numColors ) ; -extern void wxMacDestroyColorTable( CTabHandle colors ) ; -extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ; -extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ; -extern void wxMacDestroyGWorld( GWorldPtr gw ) ; - -void -ima_png_error(png_struct *png_ptr, char *message) -{ - wxMessageBox(wxString::FromAscii(message), wxT("PNG error")); - longjmp(png_ptr->jmpbuf, 1); -} - - -// static wxGifReaderIter* iter; -wxPalette *wxCopyPalette(const wxPalette *cmap); - -wxPNGReader::wxPNGReader(void) -{ - filetype = 0; - RawImage = NULL; // Image data - - Width = 0; Height = 0; // Dimensions - Depth = 0; // (bits x pixel) - ColorType = 0; // Bit 1 = Palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - EfeWidth = 0; // Efective Width - - lpbi = NULL; - bgindex = -1; - m_palette = 0; - imageOK = FALSE; -} - -wxPNGReader::wxPNGReader ( char* ImageFileName ) -{ - imageOK = FALSE; - filetype = 0; - RawImage = NULL; // Image data - - Width = 0; Height = 0; // Dimensions - Depth = 0; // (bits x pixel) - ColorType = 0; // Bit 1 = m_palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - EfeWidth = 0; // Efective Width - - lpbi = NULL; - bgindex = -1; - m_palette = 0; - - imageOK = ReadFile (ImageFileName); -} - -void -wxPNGReader::Create(int width, int height, int depth, int colortype) -{ - Width = width; Height = height; Depth = depth; - ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0); - delete m_palette; - m_palette = NULL; - delete[] RawImage; - RawImage = NULL; - - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - } - lpbi = wxMacCreateGWorld( Width , Height , Depth); - if (lpbi) - { - EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4; - int bitwidth = width ; - if ( EfeWidth > bitwidth ) - bitwidth = EfeWidth ; - - RawImage = (byte*) new char[ ( bitwidth * Height * ((Depth+7)>>3) ) ]; - imageOK = TRUE; - } -} - -wxPNGReader::~wxPNGReader ( ) -{ - if (RawImage != NULL) { - delete[] RawImage ; - RawImage = NULL; - } - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - lpbi = NULL; - } - if (m_palette != NULL) { - delete m_palette; - m_palette = NULL; - } -} - - -int wxPNGReader::GetIndex(int x, int y) -{ - if (!Inside(x, y) || (Depth>8)) return -1; - - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - int index = (int)(*ImagePointer); - return index; -} - -bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b) -{ - if (!Inside(x, y)) return FALSE; - - if (m_palette) { - return m_palette->GetRGB(GetIndex(x, y), r, g, b); - /* PALETTEENTRY entry; - ::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry); - *r = entry.peRed; - *g = entry.peGreen; - *b = entry.peBlue; */ - } else { - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - *b = ImagePointer[0]; - *g = ImagePointer[1]; - *r = ImagePointer[2]; - } - return TRUE; -} - - -bool wxPNGReader::SetIndex(int x, int y, int index) -{ - if (!Inside(x, y) || (Depth>8)) return FALSE; - - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - *ImagePointer = index; - - return TRUE; -} - -bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b) -{ - if (!Inside(x, y)) return FALSE; - - if (ColorType & COLORTYPE_PALETTE) - { - if (!m_palette) return FALSE; - SetIndex(x, y, m_palette->GetPixel(r, g, b)); - - } else { - ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3); - ImagePointer[0] = b; - ImagePointer[1] = g; - ImagePointer[2] = r; - } - - return TRUE; -} - -bool wxPNGReader::SetPalette(wxPalette* colourmap) -{ - delete m_palette ; - if (!colourmap) - return FALSE; - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - m_palette = new wxPalette( *colourmap ); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -bool -wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b) -{ - delete m_palette ; - m_palette = new wxPalette(); - if (!m_palette) - return FALSE; - - if (!g) g = r; - if (!b) b = g; - m_palette->Create(n, r, g, b); - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -bool -wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct) -{ - delete m_palette ; - m_palette = new wxPalette(); - if (!m_palette) - return FALSE; - - byte r[256], g[256], b[256]; - - for(int i=0; iCreate(n, r, g, b); - ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); - return true ; - // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); -} - -void wxPNGReader::NullData() -{ - if (lpbi) { - wxMacDestroyGWorld( (GWorldPtr) lpbi ) ; - lpbi = NULL; - } - if (m_palette != NULL) { - delete m_palette; - m_palette = NULL; - } -} - -wxBitmap* wxPNGReader::GetBitmap(void) -{ - wxBitmap *bitmap = new wxBitmap; - if ( InstantiateBitmap(bitmap) ) - return bitmap; - else - { - delete bitmap; - return NULL; - } -} - -bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap) -{ - if ( lpbi ) - { - bitmap->SetHBITMAP((WXHBITMAP) lpbi); - bitmap->SetWidth(GetWidth()); - bitmap->SetHeight(GetHeight()); - bitmap->SetDepth(GetDepth()); - if ( GetDepth() > 1 && m_palette ) - bitmap->SetPalette(*m_palette); - bitmap->SetOk(TRUE); - - - // Make a mask if appropriate - /* - if ( bgindex > -1 ) - { - wxMask *mask = CreateMask(); - bitmap->SetMask(mask); - } - */ - lpbi = NULL ; // bitmap has taken over ownership - return TRUE; - } - else - { - return FALSE; - } - /* - HDC dc = ::CreateCompatibleDC(NULL); - - if (dc) - { - // tmpBitmap is a dummy, to satisfy ::CreateCompatibleDC (it - // is a memory dc that must have a bitmap selected into it) - HDC dc2 = GetDC(NULL); - HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight()); - ReleaseDC(NULL, dc2); - HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap); - - if ( m_palette ) - { - HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) m_palette->GetHPALETTE(), FALSE); - ::RealizePalette(dc); - } - - HBITMAP hBitmap = ::CreateDIBitmap(dc, lpbi, - CBM_INIT, RawImage, (LPBITMAPINFO) lpbi, DIB_PAL_COLORS); - - ::SelectPalette(dc, NULL, TRUE); - ::SelectObject(dc, oldBitmap); - ::DeleteObject(tmpBitmap); - ::DeleteDC(dc); - - if ( hBitmap ) - { - bitmap->SetHBITMAP((WXHBITMAP) hBitmap); - bitmap->SetWidth(GetWidth()); - bitmap->SetHeight(GetHeight()); - bitmap->SetDepth(GetDepth()); - if ( GetDepth() > 1 && m_palette ) - bitmap->SetPalette(*m_palette); - bitmap->SetOk(TRUE); - - - // Make a mask if appropriate - if ( bgindex > -1 ) - { - wxMask *mask = CreateMask(); - bitmap->SetMask(mask); - } - return TRUE; - } - else - { - return FALSE; - } - } - else - { - return FALSE; - } - */ - return false ; -} - -wxPalette *wxCopyPalette(const wxPalette *cmap) -{ - wxPalette *newCmap = new wxPalette( *cmap ) ; - return newCmap; -} - -wxMask *wxPNGReader::CreateMask(void) -{ -/* -HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); - - HDC dc = ::CreateCompatibleDC(NULL); - HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); - - int bgIndex = GetBGIndex(); - - int x,y; - - for (x=0; xSetMaskBitmap((WXHBITMAP) hBitmap); - return mask; - */ - return NULL ; -} - -bool wxPNGReader::ReadFile(char * ImageFileName) -{ - int number_passes; - - if (ImageFileName) - strcpy(filename, ImageFileName); - - FILE *fp; - png_struct *png_ptr; - png_info *info_ptr; - wxPNGReaderIter iter(this); - - /* open the file */ - fp = fopen( ImageFileName , "rb" ); - - if (!fp) - return FALSE; - - /* allocate the necessary structures */ - png_ptr = new (png_struct); - if (!png_ptr) - { - fclose(fp); - return FALSE; - } - - info_ptr = new (png_info); - if (!info_ptr) - { - fclose(fp); - delete png_ptr; - return FALSE; - } - /* set error handling */ - if (setjmp(png_ptr->jmpbuf)) - { - png_read_destroy(png_ptr, info_ptr, (png_info *)0); - fclose(fp); - delete png_ptr; - delete info_ptr; - - /* If we get here, we had a problem reading the file */ - return FALSE; - } - //png_set_error(ima_png_error, NULL); - - /* initialize the structures, info first for error handling */ - png_info_init(info_ptr); - png_read_init(png_ptr); - - /* set up the input control */ - png_init_io(png_ptr, fp); - - /* read the file information */ - png_read_info(png_ptr, info_ptr); - - /* allocate the memory to hold the image using the fields - of png_info. */ - png_color_16 my_background={ 0, 31, 127, 255, 0 }; - - if (info_ptr->valid & PNG_INFO_bKGD) - { - png_set_background(png_ptr, &(info_ptr->background), - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - if ( info_ptr->num_palette > 0 ) - bgindex = info_ptr->background.index; - } - else { - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - - // Added by JACS: guesswork! - if ( info_ptr->num_trans != 0 ) - bgindex = info_ptr->num_trans - 1 ; - } - - /* tell libpng to strip 16 bit depth files down to 8 bits */ - if (info_ptr->bit_depth == 16) - png_set_strip_16(png_ptr); - - int pixel_depth=(info_ptr->pixel_depth<24) ? info_ptr->pixel_depth: 24; - Create(info_ptr->width, info_ptr->height, pixel_depth, - info_ptr->color_type); - - if (info_ptr->num_palette>0) - { - SetPalette((int)info_ptr->num_palette, (rgb_color_struct*)info_ptr->palette); - } - - int row_stride = info_ptr->width * ((pixel_depth+7)>>3); - // printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride); - // printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth); - - byte *row_pointers = new byte[row_stride]; - - /* turn on interlace handling */ - if (info_ptr->interlace_type) - number_passes = png_set_interlace_handling(png_ptr); - else - number_passes = 1; - // printf("NP = %d ", number_passes); - - for (int pass=0; pass< number_passes; pass++) - { - iter.upset(); - int y=0; - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - // ignore shapedc - SetGWorld( (GWorldPtr) lpbi , NULL ) ; - do - { - // (unsigned char *)iter.GetRow(); - if (info_ptr->interlace_type) - { - if (pass>0) - iter.GetRow(row_pointers, row_stride); - png_read_row(png_ptr, row_pointers, NULL); - } - else - png_read_row(png_ptr, row_pointers, NULL); - - if ( info_ptr->palette ) - { - if ( pixel_depth == 8 ) - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - - int index = row_pointers[i] ; - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - /* - png_color_struct* color ; - RGBColor col ; - unsigned char* p = &row_pointers[0] ; - PenNormal() ; - MoveTo( 0 , y ) ; - int index = *p ; - color = &info_ptr->palette[index] ; - col.red = (color->red << 8) | color->red ; - col.green = (color->green << 8) | color->green ; - col.blue = (color->blue << 8) | color->blue ; - RGBForeColor( &col ) ; - col.red = col.green = col.blue = 0xFFFF ; - RGBBackColor( &col ) ; - for ( int i = 0 ; i < info_ptr->width ; ++i , ++p) - { - if ( *p != index ) - { - LineTo( i , y ) ; - index = *p ; - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - RGBForeColor( &col ) ; - } - } - LineTo( info_ptr->width , y ) ; - */ - } - else - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - - int byte = ( i * pixel_depth ) / 8 ; - int offset = ( 8 - pixel_depth ) - ( i * pixel_depth ) % 8 ; - - int index = ( row_pointers[byte] >> offset ) & ( 0xFF >> ( 8 - pixel_depth ) ); - color = &info_ptr->palette[index] ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - } - } - else - { - for ( size_t i = 0 ; i < info_ptr->width ; ++i ) - { - png_color_struct* color ; - RGBColor col ; - color =(png_color_struct*) (&row_pointers[i*3]) ; - col.red = (((int)color->red) << 8) | ((int)color->red) ; - col.green = (((int)color->green) << 8) | ((int)color->green) ; - col.blue = (((int)color->blue) << 8) | ((int)color->blue) ; - SetCPixel( i, y, &col); - } - } - if (number_passes) - iter.SetRow(row_pointers, row_stride); - y++; - } - while(iter.PrevRow()); - SetGWorld( origPort , origDevice ) ; - - // printf("Y=%d ",y); - } - delete[] row_pointers; - - /* read the rest of the file, getting any additional chunks - in info_ptr */ - png_read_end(png_ptr, info_ptr); - - /* clean up after the read, and free any memory allocated */ - png_read_destroy(png_ptr, info_ptr, (png_info *)0); - - /* free the structures */ - delete png_ptr; - delete info_ptr; - - /* close the file */ - fclose(fp); - - /* that's it */ - return TRUE; -} - - -/* write a png file */ - -bool wxPNGReader::SaveFile(char * ImageFileName) -{ - if (ImageFileName) - strcpy(filename, ImageFileName); - - wxPNGReaderIter iter(this); - FILE *fp; - png_struct *png_ptr; - png_info *info_ptr; - - /* open the file */ - fp = fopen(filename, "wb"); - if (!fp) - return FALSE; - - /* allocate the necessary structures */ - png_ptr = new (png_struct); - if (!png_ptr) - { - fclose(fp); - return FALSE; - } - - info_ptr = new (png_info); - if (!info_ptr) - { - fclose(fp); - delete png_ptr; - return FALSE; - } - - /* set error handling */ - if (setjmp(png_ptr->jmpbuf)) - { - png_write_destroy(png_ptr); - fclose(fp); - delete png_ptr; - delete info_ptr; - - /* If we get here, we had a problem reading the file */ - return FALSE; - } - //png_set_error(ima_png_error, NULL); - - // printf("writig pg %s ", filename); - /* initialize the structures */ - png_info_init(info_ptr); - png_write_init(png_ptr); - - int row_stride = GetWidth() * ((GetDepth()+7)>>3); - /* set up the output control */ - png_init_io(png_ptr, fp); - - /* set the file information here */ - info_ptr->width = GetWidth(); - info_ptr->height = GetHeight(); - info_ptr->pixel_depth = GetDepth(); - info_ptr->channels = (GetDepth()>8) ? 3: 1; - info_ptr->bit_depth = GetDepth()/info_ptr->channels; - info_ptr->color_type = GetColorType(); - info_ptr->compression_type = info_ptr->filter_type = info_ptr->interlace_type=0; - info_ptr->valid = 0; - info_ptr->rowbytes = row_stride; - - - // printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels); - /* set the palette if there is one */ - if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette()) - { - // printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); - info_ptr->valid |= PNG_INFO_PLTE; - info_ptr->palette = new png_color[256]; - info_ptr->num_palette = 256; - for (int i=0; i<256; i++) - GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); - } - // printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); - - - /* optional significant bit chunk */ - // info_ptr->valid |= PNG_INFO_sBIT; - // info_ptr->sig_bit = true_bit_depth; - - /* optional gamma chunk */ - // info_ptr->valid |= PNG_INFO_gAMA; - // info_ptr->gamma = gamma; - - /* other optional chunks */ - - /* write the file information */ - png_write_info(png_ptr, info_ptr); - - /* set up the transformations you want. Note that these are - all optional. Only call them if you want them */ - - /* shift the pixels up to a legal bit depth and fill in - as appropriate to correctly scale the image */ - // png_set_shift(png_ptr, &(info_ptr->sig_bit)); - - /* pack pixels into bytes */ - // png_set_packing(png_ptr); - - /* flip bgr pixels to rgb */ - // png_set_bgr(png_ptr); - - /* swap bytes of 16 bit files to most significant bit first */ - // png_set_swap(png_ptr); - - /* get rid of filler bytes, pack rgb into 3 bytes */ - // png_set_rgbx(png_ptr); - - /* If you are only writing one row at a time, this works */ - - byte *row_pointers = new byte[row_stride]; - iter.upset(); - do { - // (unsigned char *)iter.GetRow(); - iter.GetRow(row_pointers, row_stride); - png_write_row(png_ptr, row_pointers); - } while(iter.PrevRow()); - - delete[] row_pointers; - - /* write the rest of the file */ - png_write_end(png_ptr, info_ptr); - - /* clean up after the write, and free any memory allocated */ - png_write_destroy(png_ptr); - - /* if you malloced the palette, free it here */ - if (info_ptr->palette) - delete[] (info_ptr->palette); - - /* free the structures */ - delete png_ptr; - delete info_ptr; - - /* close the file */ - fclose(fp); - - /* that's it */ - return TRUE; -} - -static int Power(int x, int y) -{ - int z = 1; - int i; - for ( i = 0; i < y; i++) - { - z *= x; - } - return z; -} - -static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', -'C', 'D', 'E', 'F' }; - -static void DecToHex(int dec, char *buf) -{ - int firstDigit = (int)(dec/16.0); - int secondDigit = (int)(dec - (firstDigit*16.0)); - buf[0] = hexArray[firstDigit]; - buf[1] = hexArray[secondDigit]; - buf[2] = 0; -} - - -bool wxPNGReader::SaveXPM(char *filename, char *name) -{ - char nameStr[256]; - if ( name ) - strcpy(nameStr, name); - else - { - wxString str = wxString::FromAscii(filename) ; - wxStripExtension( str ) ; - strcpy(nameStr, str.ToAscii() ); - } - - if ( GetDepth() > 4 ) - { - // Only a depth of 4 and below allowed - return FALSE; - } - - if ( !GetPalette() ) - return FALSE; - - wxSTD ofstream str(filename); - if ( str.bad() ) - return FALSE; - - int noColours = Power(2, GetDepth()); - - // Output header - str << "/* XPM */\n"; - str << "static char * " << nameStr << "_xpm[] = {\n"; - str << "\"" << GetWidth() << " " << GetHeight() << " " << noColours << " 1\",\n"; - - // Output colourmap - int base = 97 ; // start from 'a' - - unsigned char red, green, blue; - char hexBuf[4]; - int i; - for ( i = 0; i < noColours; i ++) - { - str << "\"" << (char)(base + i) << " c #"; - GetPalette()->GetRGB(i, &red, &green, &blue); - DecToHex(red, hexBuf); - str << hexBuf; - DecToHex(green, hexBuf); - str << hexBuf; - DecToHex(blue, hexBuf); - str << hexBuf; - str << "\",\n"; - } - - // Output the data - int x, y; - for ( y = 0; y < GetHeight(); y++) - { - str << "\""; - for ( x = 0; x < GetWidth(); x++) - { - int index = GetIndex(x, y); - str << (char)(base + index) ; - } - str << "\",\n"; - } - - str << "};\n"; - str.flush(); - - return TRUE; -} - - -IMPLEMENT_DYNAMIC_CLASS(wxPNGFileHandler, wxBitmapHandler) - -bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) -{ - wxPNGReader reader; - if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) ) - { - return reader.InstantiateBitmap(bitmap); - } - else - return FALSE; -} - -bool wxPNGFileHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal) -{ - return FALSE; -} - diff --git a/src/mac/classic/printdlg.cpp b/src/mac/classic/printdlg.cpp deleted file mode 100644 index 89f2789250..0000000000 --- a/src/mac/classic/printdlg.cpp +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.cpp -// Purpose: wxPrintDialog, wxPageSetupDialog -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "printdlg.h" -#endif - -#include "wx/object.h" -#include "wx/printdlg.h" -#include "wx/dcprint.h" -#include "wx/msgdlg.h" -#include "wx/mac/private/print.h" - -// Use generic page setup dialog: use your own native one if one exists. - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog) -IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog) -#endif - -wxPrintDialog::wxPrintDialog() -{ - m_dialogParent = NULL; - m_printerDC = NULL; - m_destroyDC = TRUE; -} - -wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data) -{ - Create(p, data); -} - -wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data) -{ - wxPrintDialogData data2; - if ( data ) - data2 = *data; - - Create(p, &data2); -} - -bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data) -{ - m_dialogParent = p; - m_printerDC = NULL; - m_destroyDC = TRUE; - - if ( data ) - m_printDialogData = *data; - - return TRUE; -} - -wxPrintDialog::~wxPrintDialog() -{ - if (m_destroyDC && m_printerDC) { - delete m_printerDC; - m_printerDC = NULL; - } -} - -int wxPrintDialog::ShowModal() -{ - m_printDialogData.ConvertToNative() ; - int result = m_printDialogData.GetPrintData().m_nativePrintData->ShowPrintDialog() ; - if ( result == wxID_OK ) - m_printDialogData.ConvertFromNative() ; - - return result ; -} - -wxDC *wxPrintDialog::GetPrintDC() -{ - return new wxPrinterDC( m_printDialogData.GetPrintData() ) ; -} - -/* -* wxPageSetupDialog -*/ - -wxPageSetupDialog::wxPageSetupDialog(): -wxDialog() -{ - m_dialogParent = NULL; -} - -wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data): -wxDialog() -{ - Create(p, data); -} - -bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data) -{ - m_dialogParent = p; - - if (data) - m_pageSetupData = (*data); - - return TRUE; -} - -wxPageSetupDialog::~wxPageSetupDialog() -{ -} - -int wxPageSetupDialog::ShowModal() -{ - m_pageSetupData.ConvertToNative() ; - int result = m_pageSetupData.GetPrintData().m_nativePrintData->ShowPageSetupDialog() ; - if (result == wxID_OK ) - m_pageSetupData.ConvertFromNative() ; - - return result ; -} - diff --git a/src/mac/classic/printmac.cpp b/src/mac/classic/printmac.cpp deleted file mode 100644 index a053eb7d80..0000000000 --- a/src/mac/classic/printmac.cpp +++ /dev/null @@ -1,781 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printwin.cpp -// Purpose: wxMacPrinter framework -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "printwin.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/dc.h" -#include "wx/app.h" -#include "wx/msgdlg.h" -#endif - -#include "wx/mac/uma.h" - -#include "wx/mac/printmac.h" -#include "wx/mac/private/print.h" - -#define mm2pt 2.83464566929 -#define pt2mm 0.352777777778 - -#include "wx/dcprint.h" -#include "wx/printdlg.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxMacPrinter, wxPrinterBase) -IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase) -#endif - -#if TARGET_CARBON - -wxNativePrintData* wxNativePrintData::Create() -{ - return new wxMacCarbonPrintData() ; -} - -wxMacCarbonPrintData::wxMacCarbonPrintData() -{ - m_macPageFormat = kPMNoPageFormat; - m_macPrintSettings = kPMNoPrintSettings; - m_macPrintSession = kPMNoReference ; - ValidateOrCreate() ; -} - -wxMacCarbonPrintData::~wxMacCarbonPrintData() -{ - if (m_macPageFormat != kPMNoPageFormat) - { - (void)PMRelease(m_macPageFormat); - m_macPageFormat = kPMNoPageFormat; - } - - if (m_macPrintSettings != kPMNoPrintSettings) - { - (void)PMRelease(m_macPrintSettings); - m_macPrintSettings = kPMNoPrintSettings; - } - - if ( m_macPrintSession != kPMNoReference ) - { - (void)PMRelease(m_macPrintSession); - m_macPrintSession = kPMNoReference; - } -} - -void wxMacCarbonPrintData::ValidateOrCreate() -{ - OSStatus err = noErr ; - if ( m_macPrintSession == kPMNoReference ) - { - err = PMCreateSession( (PMPrintSession *) &m_macPrintSession ) ; - } - // Set up a valid PageFormat object. - if ( m_macPageFormat == kPMNoPageFormat) - { - err = PMCreatePageFormat((PMPageFormat *) &m_macPageFormat); - - // Note that PMPageFormat is not session-specific, but calling - // PMSessionDefaultPageFormat assigns values specific to the printer - // associated with the current printing session. - if ((err == noErr) && - ( m_macPageFormat != kPMNoPageFormat)) - { - err = PMSessionDefaultPageFormat((PMPrintSession) m_macPrintSession, - (PMPageFormat) m_macPageFormat); - } - } - else - { - err = PMSessionValidatePageFormat((PMPrintSession) m_macPrintSession, - (PMPageFormat) m_macPageFormat, - kPMDontWantBoolean); - } - - // Set up a valid PrintSettings object. - if ( m_macPrintSettings == kPMNoPrintSettings) - { - err = PMCreatePrintSettings((PMPrintSettings *) &m_macPrintSettings); - - // Note that PMPrintSettings is not session-specific, but calling - // PMSessionDefaultPrintSettings assigns values specific to the printer - // associated with the current printing session. - if ((err == noErr) && - ( m_macPrintSettings != kPMNoPrintSettings)) - { - err = PMSessionDefaultPrintSettings((PMPrintSession) m_macPrintSession, - (PMPrintSettings) m_macPrintSettings); - } - } - else - { - err = PMSessionValidatePrintSettings((PMPrintSession) m_macPrintSession, - (PMPrintSettings) m_macPrintSettings, - kPMDontWantBoolean); - } -} - -void wxMacCarbonPrintData::TransferFrom( wxPrintData* data ) -{ - ValidateOrCreate() ; - PMSetCopies( (PMPrintSettings) m_macPrintSettings , data->GetNoCopies() , false ) ; - PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data->GetOrientation() == wxLANDSCAPE ) ? - kPMLandscape : kPMPortrait , false ) ; - // collate cannot be set -#if 0 // not yet tested - if ( m_printerName.Length() > 0 ) - PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ; -#endif - PMColorMode color ; - PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ; - if ( data->GetColour() ) - { - if ( color == kPMBlackAndWhite ) - PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMColor ) ; - } - else - PMSetColorMode( (PMPrintSettings) m_macPrintSettings, kPMBlackAndWhite ) ; - - // PMDuplexMode not yet accessible via API - // PMQualityMode not yet accessible via API - // todo paperSize -} - -void wxMacCarbonPrintData::TransferTo( wxPrintData* data ) -{ - OSStatus err = noErr ; - - UInt32 copies ; - err = PMGetCopies( m_macPrintSettings , &copies ) ; - if ( err == noErr ) - data->SetNoCopies( copies ) ; - - PMOrientation orientation ; - err = PMGetOrientation( m_macPageFormat , &orientation ) ; - if ( err == noErr ) - { - if ( orientation == kPMPortrait || orientation == kPMReversePortrait ) - data->SetOrientation( wxPORTRAIT ); - else - data->SetOrientation( wxLANDSCAPE ); - } - - // collate cannot be set -#if 0 - { - wxMacCFStringHolder name ; - PMPrinter printer ; - PMSessionGetCurrentPrinter( m_macPrintSession , - &printer ) ; - m_printerName = name.AsString() ; - } -#endif - - PMColorMode color ; - err = PMGetColorMode( m_macPrintSettings, &color ) ; - if ( err == noErr ) - data->SetColour( !(color == kPMBlackAndWhite) ) ; - - // PMDuplexMode not yet accessible via API - // PMQualityMode not yet accessible via API - // todo paperSize - PMRect rPaper; - err = PMGetUnadjustedPaperRect( m_macPageFormat, &rPaper); - if ( err == noErr ) - { - data->SetPaperSize( wxSize ( - (int)(( rPaper.right - rPaper.left ) * pt2mm + 0.5 ) , - (int)(( rPaper.bottom - rPaper.top ) * pt2mm + 0.5 ) ) ); - } -} - -void wxMacCarbonPrintData::TransferFrom( wxPageSetupData *data ) -{ - // should we setup the page rect here ? - // since MacOS sometimes has two same paper rects with different - // page rects we could make it roundtrip safe perhaps -#if TARGET_CARBON -#else -#endif -} - -void wxMacCarbonPrintData::TransferTo( wxPageSetupData* data ) -{ - PMRect rPaper; - OSStatus err = PMGetUnadjustedPaperRect(m_macPageFormat, &rPaper); - if ( err == noErr ) - { - PMRect rPage ; - err = PMGetUnadjustedPageRect(m_macPageFormat , &rPage ) ; - if ( err == noErr ) - { - data->SetMinMarginTopLeft( wxPoint ( - (int)(((double) rPage.left - rPaper.left ) * pt2mm) , - (int)(((double) rPage.top - rPaper.top ) * pt2mm) ) ) ; - - data->SetMinMarginBottomRight( wxPoint ( - (wxCoord)(((double) rPaper.right - rPage.right ) * pt2mm), - (wxCoord)(((double) rPaper.bottom - rPage.bottom ) * pt2mm)) ) ; - } - } -} - -void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data ) -{ - UInt32 minPage , maxPage ; - PMGetPageRange( m_macPrintSettings , &minPage , &maxPage ) ; - data->SetMinPage( minPage ) ; - data->SetMaxPage( maxPage ) ; - UInt32 copies ; - PMGetCopies( m_macPrintSettings , &copies ) ; - data->SetNoCopies( copies ) ; - UInt32 from , to ; - PMGetFirstPage( m_macPrintSettings , &from ) ; - PMGetLastPage( m_macPrintSettings , &to ) ; - data->SetFromPage( from ) ; - data->SetToPage( to ) ; -} - -void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data ) -{ - PMSetPageRange( m_macPrintSettings , data->GetMinPage() , data->GetMaxPage() ) ; - PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ; - PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ; - - int toPage = data->GetToPage(); - if (toPage < 1) - toPage = data->GetFromPage(); - PMSetLastPage( m_macPrintSettings , toPage , false ) ; -} - -void wxMacCarbonPrintData::CopyFrom( wxNativePrintData* d ) -{ - wxMacCarbonPrintData *data = (wxMacCarbonPrintData*) d ; - if ( data->m_macPrintSession != kPMNoReference ) - PMRetain( data->m_macPrintSession ) ; - if ( m_macPrintSession != kPMNoReference ) - { - PMRelease( m_macPrintSession ) ; - m_macPrintSession = kPMNoReference ; - } - if ( data->m_macPrintSession != kPMNoReference ) - m_macPrintSession = data->m_macPrintSession ; - - if ( data->m_macPrintSettings != kPMNoPrintSettings ) - PMRetain( data->m_macPrintSettings ) ; - if ( m_macPrintSettings != kPMNoPrintSettings ) - { - PMRelease( m_macPrintSettings ) ; - m_macPrintSettings = kPMNoPrintSettings ; - } - if ( data->m_macPrintSettings != kPMNoPrintSettings ) - m_macPrintSettings = data->m_macPrintSettings ; - - if ( data->m_macPageFormat != kPMNoPageFormat ) - PMRetain( data->m_macPageFormat ) ; - if ( m_macPageFormat != kPMNoPageFormat ) - { - PMRelease( m_macPageFormat ) ; - m_macPageFormat = kPMNoPageFormat ; - } - if ( data->m_macPageFormat != kPMNoPageFormat ) - m_macPageFormat = data->m_macPageFormat ; -} - -int wxMacCarbonPrintData::ShowPrintDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - Boolean accepted; - - { - // Display the Print dialog. - if (err == noErr) - { - err = PMSessionPrintDialog( m_macPrintSession, - m_macPrintSettings, - m_macPageFormat, - &accepted); - if ((err == noErr) && !accepted) - { - err = kPMCancel; // user clicked Cancel button - } - } - if ( err == noErr ) - { - result = wxID_OK ; - } - } - if ((err != noErr) && (err != kPMCancel)) - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return result ; -} - -int wxMacCarbonPrintData::ShowPageSetupDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - Boolean accepted; - { - // Display the Page Setup dialog. - if (err == noErr) - { - err = PMSessionPageSetupDialog( m_macPrintSession, - m_macPageFormat, - &accepted); - if ((err == noErr) && !accepted) - { - err = kPMCancel; // user clicked Cancel button - } - } - - // If the user did not cancel, flatten and save the PageFormat object - // with our document. - if (err == noErr) { - result = wxID_OK ; - } - } - if ((err != noErr) && (err != kPMCancel)) - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - - return result ; -} - -#else - -wxNativePrintData* wxNativePrintData::Create() -{ - return new wxMacClassicPrintData() ; -} - -wxMacClassicPrintData::wxMacClassicPrintData() -{ - m_macPrintSettings = NULL ; - ValidateOrCreate() ; -} - -wxMacClassicPrintData::~wxMacClassicPrintData() -{ - wxASSERT( m_macPrintSettings ); - DisposeHandle( (Handle) m_macPrintSettings ) ; -} - -void wxMacClassicPrintData::ValidateOrCreate() -{ - if ( m_macPrintSettings == NULL ) - { - m_macPrintSettings = (THPrint) NewHandleClear( sizeof( TPrint ) ); - (**m_macPrintSettings).iPrVersion = 0; // something invalid - - (**m_macPrintSettings).prInfo.iHRes = 72; - (**m_macPrintSettings).prInfo.iVRes = 72; - Rect r1 = { 0, 0, 8*72 - 2 * 18, 11*72 - 2 * 36 }; - (**m_macPrintSettings).prInfo.rPage = r1;// must have its top left & (0,0) - - Rect r2 = { -18, -36, 8*72 - 18, 11*72 - 36 }; - (**m_macPrintSettings).rPaper = r2; - (**m_macPrintSettings).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch - (**m_macPrintSettings).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch - } - else - { - } -} - -void wxMacClassicPrintData::TransferFrom( wxPrintData* data ) -{ - ValidateOrCreate() ; - (**m_macPrintSettings).prJob.iCopies = data->GetNoCopies() ; - // on mac the paper rect has a negative top left corner, because the page rect (printable area) is at 0,0 - // if all printing data is consolidated in on structure we will be able to set additional infos about pages -} - -void wxMacClassicPrintData::TransferTo( wxPrintData* data ) -{ - data->SetNoCopies( (**m_macPrintSettings).prJob.iCopies ); - data->SetPaperSize( wxSize( - ((double) (**m_macPrintSettings).rPaper.right - (**m_macPrintSettings).rPaper.left ) * pt2mm , - ((double) (**m_macPrintSettings).rPaper.bottom - (**m_macPrintSettings).rPaper.top ) * pt2mm ) ) ; -} - -void wxMacClassicPrintData::TransferFrom( wxPageSetupData *data ) -{ -} - -void wxMacClassicPrintData::TransferTo( wxPageSetupData* data ) -{ - data->SetMinMarginTopLeft( wxPoint( - ((double) (**m_macPrintSettings).prInfo.rPage.left -(**m_macPrintSettings).rPaper.left ) * pt2mm , - ((double) (**m_macPrintSettings).prInfo.rPage.top -(**m_macPrintSettings).rPaper.top ) * pt2mm ) ) ; - data->SetMinMarginBottomRight( wxPoint( - ((double) (**m_macPrintSettings).rPaper.right - (**m_macPrintSettings).prInfo.rPage.right ) * pt2mm , - ((double)(**m_macPrintSettings).rPaper.bottom - (**m_macPrintSettings).prInfo.rPage.bottom ) * pt2mm ) ) ; -} - -void wxMacClassicPrintData::TransferFrom( wxPrintDialogData* data ) -{ - int toPage = data->GetToPage(); - if (toPage < 1) - toPage = data->GetFromPage(); - (**m_macPrintSettings).prJob.iFstPage = data->GetFromPage() ; - (**m_macPrintSettings).prJob.iLstPage = toPage; -} - -void wxMacClassicPrintData::TransferTo( wxPrintDialogData* data ) -{ - data->SetFromPage( (**m_macPrintSettings).prJob.iFstPage ) ; - data->SetToPage( (**m_macPrintSettings).prJob.iLstPage ) ; -} - -void wxMacClassicPrintData::CopyFrom( wxNativePrintData* data ) -{ - DisposeHandle( (Handle) m_macPrintSettings ) ; - m_macPrintSettings = ((wxMacClassicPrintData*)data)->m_macPrintSettings; - HandToHand( (Handle*) &m_macPrintSettings ); -} - -int wxMacClassicPrintData::ShowPrintDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - err = ::UMAPrOpen() ; - if ( err == noErr ) - { - if ( ::PrJobDialog( m_macPrintSettings ) ) - { - result = wxID_OK ; - } - - } - else - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxT(""), wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - ::UMAPrClose() ; - - return result ; -} - -int wxMacClassicPrintData::ShowPageSetupDialog() -{ - int result = wxID_CANCEL ; - OSErr err = noErr ; - wxString message ; - - err = ::UMAPrOpen() ; - if ( err == noErr ) - { - if ( ::PrStlDialog( m_macPrintSettings ) ) - { - result = wxID_OK ; - } - - } - else - { - message.Printf( wxT("Print Error %d"), err ) ; - wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ; - dialog.ShowModal(); - } - ::UMAPrClose() ; - return result ; -} - -#endif - -/* -* Printer -*/ - -wxMacPrinter::wxMacPrinter(wxPrintDialogData *data): -wxPrinterBase(data) -{ -} - -wxMacPrinter::~wxMacPrinter(void) -{ -} - -bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) -{ - sm_abortIt = FALSE; - sm_abortWindow = NULL; - - if (!printout) - return FALSE; - - printout->SetIsPreview(FALSE); - if (m_printDialogData.GetMinPage() < 1) - m_printDialogData.SetMinPage(1); - if (m_printDialogData.GetMaxPage() < 1) - m_printDialogData.SetMaxPage(9999); - - // Create a suitable device context - wxDC *dc = NULL; - if (prompt) - { - wxPrintDialog dialog(parent, & m_printDialogData); - if (dialog.ShowModal() == wxID_OK) - { - dc = dialog.GetPrintDC(); - m_printDialogData = dialog.GetPrintDialogData(); - } - } - else - { - dc = new wxPrinterDC( m_printDialogData.GetPrintData() ) ; - } - - - // May have pressed cancel. - if (!dc || !dc->Ok()) - { - if (dc) delete dc; - return FALSE; - } - - // on the mac we have always pixels as addressing mode with 72 dpi - - printout->SetPPIScreen(72, 72); - printout->SetPPIPrinter(72, 72); - - // Set printout parameters - printout->SetDC(dc); - - int w, h; - wxCoord ww, hh; - dc->GetSize(&w, &h); - printout->SetPageSizePixels((int)w, (int)h); - dc->GetSizeMM(&ww, &hh); - printout->SetPageSizeMM((int)ww, (int)hh); - - // Create an abort window - wxBeginBusyCursor(); - - printout->OnPreparePrinting(); - - // Get some parameters from the printout, if defined - int fromPage, toPage; - int minPage, maxPage; - printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); - - if (maxPage == 0) - { - wxEndBusyCursor(); - return FALSE; - } - - // Only set min and max, because from and to have been - // set by the user - m_printDialogData.SetMinPage(minPage); - m_printDialogData.SetMaxPage(maxPage); - - wxWindow *win = CreateAbortWindow(parent, printout); - wxSafeYield(win,true); - - if (!win) - { - wxEndBusyCursor(); - wxMessageBox(wxT("Sorry, could not create an abort dialog."), wxT("Print Error"), wxOK, parent); - delete dc; - return FALSE; - } - sm_abortWindow = win; - sm_abortWindow->Show(TRUE); - wxSafeYield(win,true); - - printout->OnBeginPrinting(); - - bool keepGoing = TRUE; - - int copyCount; - for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++) - { - if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage())) - { - wxEndBusyCursor(); - wxMessageBox(wxT("Could not start printing."), wxT("Print Error"), wxOK, parent); - break; - } - if (sm_abortIt) - break; - - int pn; - for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn); - pn++) - { - if (sm_abortIt) - { - keepGoing = FALSE; - break; - } - else - { -#if TARGET_CARBON - if ( UMAGetSystemVersion() >= 0x1000 ) -#endif - { - GrafPtr thePort ; - GetPort( &thePort ) ; - wxSafeYield(win,true); - SetPort( thePort ) ; - } - dc->StartPage(); - keepGoing = printout->OnPrintPage(pn); - dc->EndPage(); - } - } - printout->OnEndDocument(); - } - - printout->OnEndPrinting(); - - if (sm_abortWindow) - { - sm_abortWindow->Show(FALSE); - delete sm_abortWindow; - sm_abortWindow = NULL; - } - - wxEndBusyCursor(); - - delete dc; - - return TRUE; -} - -wxDC* wxMacPrinter::PrintDialog(wxWindow *parent) -{ - wxDC* dc = (wxDC*) NULL; - - wxPrintDialog dialog(parent, & m_printDialogData); - int ret = dialog.ShowModal(); - - if (ret == wxID_OK) - { - dc = dialog.GetPrintDC(); - m_printDialogData = dialog.GetPrintDialogData(); - } - - return dc; -} - -bool wxMacPrinter::Setup(wxWindow *parent) -{ - wxPrintDialog dialog(parent, & m_printDialogData); - dialog.GetPrintDialogData().SetSetupDialog(TRUE); - - int ret = dialog.ShowModal(); - - if (ret == wxID_OK) - { - m_printDialogData = dialog.GetPrintDialogData(); - } - - return (ret == wxID_OK); -} - -/* -* Print preview -*/ - -wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintDialogData *data) - : wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - DetermineScaling(); -} - -wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): -wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - DetermineScaling(); -} - -wxMacPrintPreview::~wxMacPrintPreview(void) -{ -} - -bool wxMacPrintPreview::Print(bool interactive) -{ - if (!m_printPrintout) - return FALSE; - wxMacPrinter printer(&m_printDialogData); - return printer.Print(m_previewFrame, m_printPrintout, interactive); -} - -void wxMacPrintPreview::DetermineScaling(void) -{ - int screenWidth , screenHeight ; - wxDisplaySize( &screenWidth , &screenHeight ) ; - - m_previewPrintout->SetPPIScreen( 72 , 72 ) ; - m_previewPrintout->SetPPIPrinter( 72 , 72 ) ; - m_previewPrintout->SetPageSizeMM( (int) (8.0 * 25.6), (int) (11.0 * 25.6) ); - m_previewPrintout->SetPageSizePixels( 8 * 72 , 11 * 72 ) ; - m_pageWidth = 8 * 72 ; - m_pageHeight = 11 * 72 ; - m_previewScale = 1 ; - - // Get a device context for the currently selected printer - wxPrinterDC printerDC(m_printDialogData.GetPrintData()); - if (printerDC.Ok()) - { - int x , y ; - wxCoord ww, hh; - printerDC.GetSizeMM(&ww, &hh); - printerDC.GetSize( &x , &y ) ; - m_previewPrintout->SetPageSizeMM((int)ww, (int)hh); - m_previewPrintout->SetPageSizePixels( x , y) ; - m_pageWidth = x ; - m_pageHeight = y ; - m_isOk = true ; - } - else - { - m_isOk = false ; - } - // At 100%, the page should look about page-size on the screen. - // m_previewScale = (float)((float)screenWidth/(float)printerWidth); - // m_previewScale = m_previewScale * (float)((float)screenXRes/(float)printerXRes); - - m_previewScale = 1 ; -} diff --git a/src/mac/classic/radiobox.cpp b/src/mac/classic/radiobox.cpp deleted file mode 100644 index 103d68ca44..0000000000 --- a/src/mac/classic/radiobox.cpp +++ /dev/null @@ -1,580 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp -// Purpose: wxRadioBox -// Author: Stefan Csomor -// Modified by: JS Lair (99/11/15) first implementation -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radioboxbase.h" -#pragma implementation "radiobox.h" -#endif - -//------------------------------------------------------------------------------------- -// headers -//------------------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/arrstr.h" - -#include "wx/radiobox.h" -#include "wx/radiobut.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif - -//------------------------------------------------------------------------------------- -// ¥ wxRadioBox() -//------------------------------------------------------------------------------------- -// Default constructor -BEGIN_EVENT_TABLE(wxRadioBox, wxControl) -EVT_RADIOBUTTON( -1 , wxRadioBox::OnRadioButton ) -END_EVENT_TABLE() - -void wxRadioBox::OnRadioButton( wxCommandEvent &outer ) -{ - if ( outer.IsChecked() ) - { - wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId); - int i = GetSelection() ; - event.SetInt( i ); - event.SetString( GetString( i ) ); - event.SetEventObject( this ); - ProcessCommand(event); - } -} - -wxRadioBox::wxRadioBox() -{ - m_noItems = 0; - m_noRowsOrCols = 0; - m_majorDim = 0 ; - m_radioButtonCycle = NULL; -} - -//------------------------------------------------------------------------------------- -// ¥ wxRadioBox(wxWindow*, wxWindowID, const wxString&, const wxPoint&, -// const wxSize&, int, const wxString[], int, long, -// const wxValidator&, const wxString&) -//------------------------------------------------------------------------------------- -// Contructor, creating and showing a radiobox -// -// inline defined -// - -//------------------------------------------------------------------------------------- -// ¥ ~wxRadioBox -//------------------------------------------------------------------------------------- -// Destructor, destroying the radiobox item - -wxRadioBox::~wxRadioBox() -{ - m_isBeingDeleted = TRUE; - - wxRadioButton *next,*current; - - current=m_radioButtonCycle->NextInCycle(); - next=current->NextInCycle(); - while (current!=m_radioButtonCycle) { - delete current; - current=next; - next=current->NextInCycle(); - } - delete current; -} - -//------------------------------------------------------------------------------------- -// ¥ Create -//------------------------------------------------------------------------------------- -// Create the radiobox for two-step construction - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - wxCArrayString chs(choices); - - return Create(parent, id, label, pos, size, chs.GetCount(), - chs.GetStrings(), majorDim, style, val, name); -} - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, const wxSize& size, - int n, const wxString choices[], - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, val, name) ) - return false; - - int i; - - m_noItems = n; - m_noRowsOrCols = majorDim; - m_radioButtonCycle = NULL; - - if (majorDim==0) - m_majorDim = n ; - else - m_majorDim = majorDim ; - - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlGroupBoxTextTitleProc , (long) this ) ; - - for (i = 0; i < n; i++) - { - wxRadioButton *radBtn = new wxRadioButton - ( - this, - wxID_ANY, - wxStripMenuCodes(choices[i]), - wxPoint(5,20*i+10), - wxDefaultSize, - i == 0 ? wxRB_GROUP : 0 - ); - if ( i == 0 ) - m_radioButtonCycle = radBtn ; - // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); - } - - SetSelection(0); - MacPostControlCreate() ; - - return TRUE; -} - - -//------------------------------------------------------------------------------------- -// ¥ Enable(bool) -//------------------------------------------------------------------------------------- -// Enables or disables the entire radiobox - -bool wxRadioBox::Enable(bool enable) -{ - int i; - wxRadioButton *current; - - if (!wxControl::Enable(enable)) - return false; - - current = m_radioButtonCycle; - for (i = 0; i < m_noItems; i++) { - current->Enable(enable); - current = current->NextInCycle(); - } - return true; -} - -//------------------------------------------------------------------------------------- -// ¥ Enable(int, bool) -//------------------------------------------------------------------------------------- -// Enables or disables an given button - -void wxRadioBox::Enable(int item, bool enable) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - - i = 0; - current = m_radioButtonCycle; - while (i != item) { - i++; - current = current->NextInCycle(); - } - current->Enable(enable); -} - -//------------------------------------------------------------------------------------- -// ¥ GetLabel() -//------------------------------------------------------------------------------------- -// Returns the radiobox label - -wxString wxRadioBox::GetLabel() const -{ - return wxControl::GetLabel(); -} - -//------------------------------------------------------------------------------------- -// ¥ GetLabel(int) -//------------------------------------------------------------------------------------- -// Returns the label for the given button - -wxString wxRadioBox::GetString(int item) const -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return wxEmptyString; - - i = 0; - current = m_radioButtonCycle; - while (i != item) { - i++; - current = current->NextInCycle(); - } - return current->GetLabel(); -} - -//------------------------------------------------------------------------------------- -// ¥ GetSelection -//------------------------------------------------------------------------------------- -// Returns the zero-based position of the selected button - -int wxRadioBox::GetSelection() const -{ - int i; - wxRadioButton *current; - - i=0; - current=m_radioButtonCycle; - while (!current->GetValue()) { - i++; - current=current->NextInCycle(); - } - - return i; -} - -//------------------------------------------------------------------------------------- -// ¥ Number -//------------------------------------------------------------------------------------- -// Returns the number of buttons in the radiobox -// -// inline defined -// - -//------------------------------------------------------------------------------------- -// ¥ SetLabel(const wxString&) -//------------------------------------------------------------------------------------- -// Sets the radiobox label - -void wxRadioBox::SetLabel(const wxString& label) -{ - return wxControl::SetLabel(label); -} - -//------------------------------------------------------------------------------------- -// ¥ SetLabel(int, const wxString&) -//------------------------------------------------------------------------------------- -// Sets the label of a given button - -void wxRadioBox::SetString(int item,const wxString& label) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - return current->SetLabel(label); -} - -//------------------------------------------------------------------------------------- -// ¥ SetSelection -//------------------------------------------------------------------------------------- -// Sets a button by passing the desired position. This does not cause -// wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted - -void wxRadioBox::SetSelection(int item) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - current->SetValue(true); - -} - -//------------------------------------------------------------------------------------- -// ¥ Show(bool) -//------------------------------------------------------------------------------------- -// Shows or hides the entire radiobox - -bool wxRadioBox::Show(bool show) -{ - int i; - wxRadioButton *current; - - wxControl::Show(show); - - current=m_radioButtonCycle; - for (i=0;iShow(show); - current=current->NextInCycle(); - } - return true; -} - -//------------------------------------------------------------------------------------- -// ¥ Show(int, bool) -//------------------------------------------------------------------------------------- -// Shows or hides the given button - -void wxRadioBox::Show(int item, bool show) -{ - int i; - wxRadioButton *current; - - if ((item < 0) || (item >= m_noItems)) - return; - i=0; - current=m_radioButtonCycle; - while (i!=item) { - i++; - current=current->NextInCycle(); - } - current->Show(show); -} - -//------------------------------------------------------------------------------------- -// ¥ Command -//------------------------------------------------------------------------------------- -// Simulates the effect of the user issuing a command to the item - -void wxRadioBox::Command (wxCommandEvent & event) -{ - SetSelection (event.GetInt()); - ProcessCommand (event); -} - -//------------------------------------------------------------------------------------- -// ¥ SetFocus -//------------------------------------------------------------------------------------- -// Sets the selected button to receive keyboard input - -void wxRadioBox::SetFocus() -{ - int i; - wxRadioButton *current; - - i=0; - current=m_radioButtonCycle; - while (!current->GetValue()) { - i++; - current=current->NextInCycle(); - } - current->SetFocus(); -} - - -//------------------------------------------------------------------------------------- -// ¥ DoSetSize -//------------------------------------------------------------------------------------- -// Simulates the effect of the user issuing a command to the item - -#define RADIO_SIZE 20 - -void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - int i; - wxRadioButton *current; - - // define the position - - int x_current, y_current; - int x_offset,y_offset; - int widthOld, heightOld; - GetSize(&widthOld, &heightOld); - - x_offset = x; - y_offset = y; - GetPosition(&x_current, &y_current); - if ((x == -1) && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - x_offset = x_current; - if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - y_offset = y_current; - - // define size - - int charWidth,charHeight; - int maxWidth,maxHeight; - int eachWidth[128],eachHeight[128]; - int totWidth,totHeight; - - SetFont(GetParent()->GetFont()); - GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight); - charWidth/=52; - - maxWidth=-1; - maxHeight=-1; - for (i = 0 ; i < m_noItems; i++) - { - GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i]); - eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE); - eachHeight[i] = (int)((3*eachHeight[i])/2); - if (maxWidth= 0x1030 ) - { - //need to add a few more pixels for the top border on panther - y_start = y_start + 5; //how many exactly should this be to meet the HIG? - } - x_offset = x_start; - y_offset = y_start; - - current=m_radioButtonCycle; - for ( i = 0 ; i < m_noItems; i++) - { - if (i&&((i%m_majorDim)==0)) // not to do for the zero button! - { - if (m_windowStyle & wxRA_VERTICAL) - { - x_offset += maxWidth + charWidth; - y_offset = y_start; - } - else - { - x_offset = x_start; - y_offset += maxHeight ; /*+ charHeight/2;*/ - } - } - - current->SetSize(x_offset,y_offset,eachWidth[i],eachHeight[i]); - current=current->NextInCycle(); - - if (m_windowStyle & wxRA_SPECIFY_ROWS) - y_offset += maxHeight ; /*+ charHeight/2;*/ - else - x_offset += maxWidth + charWidth; - } -} - -wxSize wxRadioBox::DoGetBestSize() const -{ - int charWidth, charHeight; - int maxWidth, maxHeight; - int eachWidth, eachHeight; - int totWidth, totHeight; - - wxFont font = GetParent()->GetFont(); - GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), - &charWidth, &charHeight, NULL, NULL, &font); - charWidth /= 52; - - maxWidth = -1; - maxHeight = -1; - - for (int i = 0 ; i < m_noItems; i++) - { - GetTextExtent(GetString(i), &eachWidth, &eachHeight); - eachWidth = (int)(eachWidth + RADIO_SIZE) ; - eachHeight = (int)((3 * eachHeight) / 2); - if (maxWidth < eachWidth) maxWidth = eachWidth; - if (maxHeight < eachHeight) maxHeight = eachHeight; - } - - totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight ; - totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth; - - if ( UMAGetSystemVersion() >= 0x1030 ) - { - //need to add a few more pixels for the static boxborder on panther - totHeight = totHeight + 10; //how many exactly should this be to meet the HIG? - } - // handle radio box title as well - GetTextExtent(GetTitle(), &eachWidth, NULL); - eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ; - if (totWidth < eachWidth) - totWidth = eachWidth; - - return wxSize(totWidth, totHeight); -} -//------------------------------------------------------------------------------------- -// ¥ GetNumVer -//------------------------------------------------------------------------------------- -// return the number of buttons in the vertical direction - -int wxRadioBox::GetRowCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return m_majorDim; - } - else - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } -} - -//------------------------------------------------------------------------------------- -// ¥ GetNumHor -//------------------------------------------------------------------------------------- -// return the number of buttons in the horizontal direction - -int wxRadioBox::GetColumnCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } - else - { - return m_majorDim; - } -} - - - - - diff --git a/src/mac/classic/radiobut.cpp b/src/mac/classic/radiobut.cpp deleted file mode 100644 index 991c8be68f..0000000000 --- a/src/mac/classic/radiobut.cpp +++ /dev/null @@ -1,150 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp -// Purpose: wxRadioButton -// Author: AUTHOR -// Modified by: JS Lair (99/11/15) adding the cyclic groupe notion for radiobox -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobut.h" -#endif - -#include "wx/defs.h" - -#include "wx/radiobut.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) -#endif - -#include "wx/mac/uma.h" - -bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlRadioButtonProc , (long) this ) ; - - MacPostControlCreate() ; - - m_cycle = this ; - - if (HasFlag(wxRB_GROUP)) - { - AddInCycle( NULL ) ; - } - else - { - /* search backward for last group start */ - wxRadioButton *chief = (wxRadioButton*) NULL; - wxWindowList::Node *node = parent->GetChildren().GetLast(); - while (node) - { - wxWindow *child = node->GetData(); - if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) ) - { - chief = (wxRadioButton*) child; - if (child->HasFlag(wxRB_GROUP)) break; - } - node = node->GetPrevious(); - } - AddInCycle( chief ) ; - } - return TRUE; -} - -void wxRadioButton::SetValue(bool val) -{ - wxRadioButton *cycle; - if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val ) - return ; - - ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ; - if (val) - { - cycle=this->NextInCycle(); - if (cycle!=NULL) { - while (cycle!=this) { - cycle->SetValue(false); - cycle=cycle->NextInCycle(); - } - } - } - MacRedrawControl() ; -} - -bool wxRadioButton::GetValue() const -{ - return ::GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxRadioButton::Command (wxCommandEvent & event) -{ - SetValue ( (event.GetInt() != 0) ); - ProcessCommand (event); -} - -void wxRadioButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - if ( GetValue() ) - return ; - - wxRadioButton *cycle, *old = NULL ; - cycle=this->NextInCycle(); - if (cycle!=NULL) { - while (cycle!=this) { - if ( cycle->GetValue() ) { - old = cycle ; - cycle->SetValue(false); - } - cycle=cycle->NextInCycle(); - } - } - - SetValue(true) ; - - if ( old ) { - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, old->m_windowId ); - event.SetEventObject(old); - event.SetInt( false ); - old->ProcessCommand(event); - } - wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId ); - event2.SetEventObject(this); - event2.SetInt( true ); - ProcessCommand(event2); -} - -wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle) -{ - wxRadioButton *next,*current; - - if (cycle==NULL) { - m_cycle=this; - return(this); - } - else { - current=cycle; - while ((next=current->m_cycle)!=cycle) - current=current->m_cycle; - m_cycle=cycle; - current->m_cycle=this; - return(cycle); - } -} diff --git a/src/mac/classic/region.cpp b/src/mac/classic/region.cpp deleted file mode 100644 index a3cf8cef7b..0000000000 --- a/src/mac/classic/region.cpp +++ /dev/null @@ -1,437 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// File: region.cpp -// Purpose: Region class -// Author: Stefan Csomor -// Created: Fri Oct 24 10:46:34 MET 1997 -// RCS-ID: $Id$ -// Copyright: (c) 1997 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "region.h" -#endif - -#include "wx/region.h" -#include "wx/gdicmn.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) -#endif - -//----------------------------------------------------------------------------- -// wxRegionRefData implementation -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxRegionRefData : public wxGDIRefData { -public: - wxRegionRefData() - { - m_macRgn = NewRgn() ; - } - - wxRegionRefData(const wxRegionRefData& data) - : wxGDIRefData() - { - m_macRgn = NewRgn() ; - CopyRgn( data.m_macRgn , m_macRgn ) ; - } - - ~wxRegionRefData() - { - DisposeRgn( m_macRgn ) ; - } - RgnHandle m_macRgn ; -}; - -#define M_REGION (((wxRegionRefData*)m_refData)->m_macRgn) -#define OTHER_M_REGION(a) (((wxRegionRefData*)(a.m_refData))->m_macRgn) - -//----------------------------------------------------------------------------- -// wxRegion -//----------------------------------------------------------------------------- - -/*! - * Create an empty region. - */ -wxRegion::wxRegion() -{ - m_refData = new wxRegionRefData; -} - -wxRegion::wxRegion(WXHRGN hRegion ) -{ - m_refData = new wxRegionRefData; - CopyRgn( (RgnHandle) hRegion , (RgnHandle) M_REGION ) ; -} - -wxRegion::wxRegion(long x, long y, long w, long h) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , x , y , x+w , y+h ) ; -} - -wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , topLeft.x , topLeft.y , bottomRight.x , bottomRight.y ) ; -} - -wxRegion::wxRegion(const wxRect& rect) -{ - m_refData = new wxRegionRefData; - SetRectRgn( (RgnHandle) M_REGION , rect.x , rect.y , rect.x+rect.width , rect.y+rect.height ) ; -} - -/*! - * Destroy the region. - */ -wxRegion::~wxRegion() -{ - // m_refData unrefed in ~wxObject -} - -//----------------------------------------------------------------------------- -//# Modify region -//----------------------------------------------------------------------------- - -//! Clear current region -void wxRegion::Clear() -{ - UnRef(); -} - -//! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) - { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - RgnHandle rgn = NewRgn() ; - SetRectRgn( rgn , x , y, x+width,y + height ) ; - - switch (op) - { - case wxRGN_AND: - SectRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_OR: - UnionRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_XOR: - XorRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_DIFF: - DiffRgn( M_REGION , rgn , M_REGION ) ; - break ; - case wxRGN_COPY: - default: - CopyRgn( rgn ,M_REGION ) ; - break ; - } - - DisposeRgn( rgn ) ; - - return TRUE; -} - -//! Union /e region with this. -bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) -{ - if (region.Empty()) - return FALSE; - - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) - { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - - switch (op) - { - case wxRGN_AND: - SectRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_OR: - UnionRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_XOR: - XorRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_DIFF: - DiffRgn( M_REGION , OTHER_M_REGION(region) , M_REGION ) ; - break ; - case wxRGN_COPY: - default: - CopyRgn( OTHER_M_REGION(region) ,M_REGION ) ; - break ; - } - - return TRUE; -} - -bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) -{ - return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op); -} - -//----------------------------------------------------------------------------- -//# Information on region -//----------------------------------------------------------------------------- - -// Outer bounds of region -void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const -{ - if (m_refData) - { - Rect box ; - GetRegionBounds( M_REGION , &box ) ; - x = box.left ; - y = box.top ; - w = box.right - box.left ; - h = box.bottom - box.top ; - } - else - { - x = y = w = h = 0; - } -} - -wxRect wxRegion::GetBox() const -{ - wxCoord x, y, w, h; - GetBox(x, y, w, h); - return wxRect(x, y, w, h); -} - -// Is region empty? -bool wxRegion::Empty() const -{ - return EmptyRgn( M_REGION ) ; -} - -const WXHRGN wxRegion::GetWXHRGN() const -{ - return M_REGION ; -} - -//----------------------------------------------------------------------------- -//# Tests -//----------------------------------------------------------------------------- - -// Does the region contain the point (x,y)? -wxRegionContain wxRegion::Contains(long x, long y) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - return wxOutRegion; -} - -// Does the region contain the point pt? -wxRegionContain wxRegion::Contains(const wxPoint& pt) const -{ - if (!m_refData) - return wxOutRegion; - - Point p = { pt.y , pt.x } ; - if (PtInRgn( p , M_REGION ) ) - return wxInRegion; - - return wxOutRegion; -} - -// Does the region contain the rectangle (x, y, w, h)? -wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const -{ - if (!m_refData) - return wxOutRegion; - - Rect rect = { y , x , y + h , x + w } ; - if (RectInRgn( &rect , M_REGION ) ) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle rect -wxRegionContain wxRegion::Contains(const wxRect& rect) const -{ - if (!m_refData) - return wxOutRegion; - - long x, y, w, h; - x = rect.x; - y = rect.y; - w = rect.GetWidth(); - h = rect.GetHeight(); - return Contains(x, y, w, h); -} - -/////////////////////////////////////////////////////////////////////////////// -// // -// wxRegionIterator // -// // -/////////////////////////////////////////////////////////////////////////////// - -/*! - * Initialize empty iterator - */ -wxRegionIterator::wxRegionIterator() - : m_current(0), m_numRects(0), m_rects(NULL) -{ -} - -wxRegionIterator::~wxRegionIterator() -{ - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } -} - -wxRegionIterator::wxRegionIterator(const wxRegionIterator& iterator) - : wxObject() - , m_current(iterator.m_current) - , m_numRects(0) - , m_rects(NULL) -{ - SetRects(iterator.m_numRects, iterator.m_rects); -} - -wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& iterator) -{ - m_current = iterator.m_current; - SetRects(iterator.m_numRects, iterator.m_rects); - return *this; -} - -/*! - * Set iterator rects for region - */ -void wxRegionIterator::SetRects(long numRects, wxRect *rects) -{ - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } - if (rects) - { - int i; - m_rects = new wxRect[numRects]; - for (i = 0; i < numRects; i++) - m_rects[i] = rects[i]; - } - m_numRects = numRects; -} - -/*! - * Initialize iterator for region - */ -wxRegionIterator::wxRegionIterator(const wxRegion& region) -{ - m_rects = NULL; - - Reset(region); -} - -/*! - * Reset iterator for a new /e region. - */ -void wxRegionIterator::Reset(const wxRegion& region) -{ - m_current = 0; - m_region = region; - - if (m_rects) { - delete[] m_rects; - m_rects = NULL; - } - - if (m_region.Empty()) - m_numRects = 0; - else - { - // we cannot dissolve it into rects on mac - m_rects = new wxRect[1]; - Rect rect ; - GetRegionBounds( OTHER_M_REGION( region ) , &rect ) ; - m_rects[0].x = rect.left; - m_rects[0].y = rect.top; - m_rects[0].width = rect.right - rect.left; - m_rects[0].height = rect.bottom - rect.top; - m_numRects = 1; - } -} - -/*! - * Increment iterator. The rectangle returned is the one after the - * incrementation. - */ -wxRegionIterator& wxRegionIterator::operator ++ () -{ - if (m_current < m_numRects) - ++m_current; - return *this; -} - -/*! - * Increment iterator. The rectangle returned is the one before the - * incrementation. - */ -wxRegionIterator wxRegionIterator::operator ++ (int) -{ - wxRegionIterator previous(*this); - - if (m_current < m_numRects) - ++m_current; - - return previous; -} - -long wxRegionIterator::GetX() const -{ - if (m_current < m_numRects) - return m_rects[m_current].x; - return 0; -} - -long wxRegionIterator::GetY() const -{ - if (m_current < m_numRects) - return m_rects[m_current].y; - return 0; -} - -long wxRegionIterator::GetW() const -{ - if (m_current < m_numRects) - return m_rects[m_current].width ; - return 0; -} - -long wxRegionIterator::GetH() const -{ - if (m_current < m_numRects) - return m_rects[m_current].height; - return 0; -} - diff --git a/src/mac/classic/renderer.cpp b/src/mac/classic/renderer.cpp deleted file mode 100644 index 8555ef47e3..0000000000 --- a/src/mac/classic/renderer.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/renderer.cpp -// Purpose: implementation of wxRendererNative for Mac -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.07.2003 -// RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/dc.h" - #include "wx/bitmap.h" - #include "wx/settings.h" -#endif //WX_PRECOMP - -#include "wx/renderer.h" - -// ---------------------------------------------------------------------------- -// wxRendererMac: our wxRendererNative implementation -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRendererMac : public wxDelegateRendererNative -{ -public: - // draw the header control button (used by wxListCtrl) - virtual void DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - // draw the expanded/collapsed icon for a tree control item - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - // draw a (vertical) sash - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0); - -private: - // the tree buttons - wxBitmap m_bmpTreeExpanded, - m_bmpTreeCollapsed; -}; - -// ---------------------------------------------------------------------------- -// Aqua arrows -// ---------------------------------------------------------------------------- - -/* XPM */ -static const char *aqua_arrow_right_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 11 4 1", -" c None", -"b c #C0C0C0", -"c c #707070", -"d c #A0A0A0", -/* pixels */ -" b ", -" ddb ", -" cccdb ", -" cccccd ", -" ccccccdb ", -" ccccccccd", -" ccccccdb ", -" cccccb ", -" cccdb ", -" ddb ", -" b " -}; - -/* XPM */ -static const char *aqua_arrow_down_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 11 4 1", -" c None", -"b c #C0C0C0", -"c c #707070", -"d c #A0A0A0", -/* pixels */ -" ", -" ", -" bdcccccccdb ", -" dcccccccd ", -" bcccccccb ", -" dcccccd ", -" bcccccb ", -" bcccd ", -" dcd ", -" bcb ", -" d " -}; - -// ============================================================================ -// implementation -// ============================================================================ - -/* static */ -wxRendererNative& wxRendererNative::GetDefault() -{ - static wxRendererMac s_rendererMac; - - return s_rendererMac; -} - -void -wxRendererMac::DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int WXUNUSED(flags)) -{ - const int CORNER = 1; - - const wxCoord x = rect.x-1, - y = rect.y-1, - w = rect.width, - h = rect.height; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - - if (major >= 10) - { - dc.SetPen( wxPen( wxColour( 0xC5 , 0xC5 , 0xC5 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x, y+CORNER, 1, h-CORNER ); // left - // The right border is overdrawn by the left border of the right neighbouring - // header (to maintain a proper single pixel border). Except for the - // rightmost header of the listctrl. - dc.DrawRectangle( x+w+(CORNER*2), y+CORNER, 1, h-CORNER ); // right - dc.SetPen( wxPen( wxColour( 0xB1 , 0xB1 , 0xB1 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x, y+h, w+(CORNER*3), 1 ); // bottom - dc.DrawRectangle( x, y, w+(CORNER*3), 1 ); // top - - // Do a fill of the interior for background: - dc.SetPen( wxPen( wxColour( 0xF6 , 0xF6 , 0xF6 ) , 1 , wxSOLID ) ); - dc.DrawRectangle( x+CORNER, y+CORNER, w+CORNER, h-CORNER ); - - // Do the gradient fill: - static int grayValues[] = - { - 0xF6, 0xF2, 0xEF, 0xED, 0xED, 0xEB, 0xEA, 0xEA, 0xE8, - 0xE8, 0xE2, 0xE5, 0xE8, 0xEB, 0xEF, 0xF2, 0xFD - }; - int i; - for (i=0; i < h && i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( x+CORNER, y+CORNER+i, w+CORNER, 1 ); - } - } - else - { - dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNSHADOW ) , 1 , wxSOLID ) ); - dc.DrawLine( x+w-CORNER+1, y, x+w, y+h ); // right (outer) - dc.DrawRectangle( x, y+h, w+1, 1 ); // bottom (outer) - - wxPen pen( wxColour( 0x88 , 0x88 , 0x88 ), 1, wxSOLID ); - - dc.SetPen( pen ); - dc.DrawLine( x+w-CORNER, y, x+w-1, y+h ); // right (inner) - dc.DrawRectangle( x+1, y+h-1, w-2, 1 ); // bottom (inner) - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawRectangle( x, y, w-CORNER+1, 1 ); // top (outer) - dc.DrawRectangle( x, y, 1, h ); // left (outer) - dc.DrawLine( x, y+h-1, x+1, y+h-1 ); - dc.DrawLine( x+w-1, y, x+w-1, y+1 ); - } -} - -void -wxRendererMac::DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags) -{ - // init the buttons on demand - if ( !m_bmpTreeExpanded.Ok() ) - { - m_bmpTreeExpanded = wxBitmap(aqua_arrow_down_xpm); - m_bmpTreeCollapsed = wxBitmap(aqua_arrow_right_xpm); - } - - // draw them - - // VZ: this is the old code from treectlg.cpp which apparently doesn't work - // but I kept it here just in case it is needed -- if not, please - // remove it -#if 0 // def __WXMAC__ - wxMacPortSetter helper(&dc) ; - wxMacWindowClipper clipper(this) ; - wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; - - int loc_x = x - 5 ; - int loc_y = y_mid - 6 ; - MacWindowToRootWindow( & loc_x , & loc_y ) ; - Rect bounds = { loc_y , loc_x , loc_y + 18 , loc_x + 12 } ; - ThemeButtonDrawInfo info = { kThemeStateActive , item->IsExpanded() ? kThemeDisclosureDown : kThemeDisclosureRight , - kThemeAdornmentNone }; - DrawThemeButton( &bounds, kThemeDisclosureButton , - &info , NULL , NULL , NULL , NULL ) ; -#else // 1 - dc.DrawBitmap(flags & wxCONTROL_EXPANDED ? m_bmpTreeExpanded - : m_bmpTreeCollapsed, - rect.x, rect.y, true /* use mask */); -#endif // 0/1 -} - -void -wxRendererMac::DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int WXUNUSED(flags)) -{ - // VZ: we have to somehow determine if we're drawing a normal sash or - // a brushed metal one as they look quite differently... this is - // completely bogus anyhow, of course (TODO) - -#if 0 - dc.SetPen(*wxLIGHT_GREY_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - if ( orient == wxVERTICAL ) - dc.DrawRectangle(position, 0, 7, size.y); - else - dc.DrawRectangle(0, position, size.x, 7); -#else - // Do the gradient fill: - static int grayValues[] = - { - 0xA0, 0xF6, 0xED, 0xE4, 0xE2, 0xD0, 0xA0 - }; - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - if ( orient == wxVERTICAL ) - { - int i; - for (i=0; i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( position+i, 0, 1, size.y ); - } - } - else - { - int i; - for (i=0; i < (int)WXSIZEOF(grayValues); i++) - { - dc.SetPen( wxPen( wxColour( grayValues[i] , grayValues[i] , grayValues[i] ), - 1 , wxSOLID ) ); - dc.DrawRectangle( 0, position+i, size.x, 1 ); - } - } -#endif -} - diff --git a/src/mac/classic/scrolbar.cpp b/src/mac/classic/scrolbar.cpp deleted file mode 100644 index 3b08c25ecc..0000000000 --- a/src/mac/classic/scrolbar.cpp +++ /dev/null @@ -1,184 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp -// Purpose: wxScrollBar -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "scrolbar.h" -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif // WX_PRECOMP - -#include "wx/scrolbar.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - -BEGIN_EVENT_TABLE(wxScrollBar, wxControl) -END_EVENT_TABLE() - -#endif - -extern ControlActionUPP wxMacLiveScrollbarActionUPP ; - -// Scrollbar -bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return FALSE; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) , - &bounds , title , false , 0 , 0 , 100, - kControlScrollBarLiveProc , (long) this) ; - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxScrollBar::~wxScrollBar() -{ -} - -void wxScrollBar::SetThumbPosition(int viewStart) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ; -} - -int wxScrollBar::GetThumbPosition() const -{ - return ::GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh) -{ - m_pageSize = pageSize; - m_viewSize = thumbSize; - m_objectSize = range; - - int range1 = wxMax((m_objectSize - m_viewSize), 0) ; - - SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ; - SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ; - SetControl32BitValue( (ControlHandle) m_macControl , position ) ; - - if ( UMAGetAppearanceVersion() >= 0x0110 ) - { - if ( SetControlViewSize != (void*) kUnresolvedCFragSymbolAddress ) - { - SetControlViewSize( (ControlHandle) m_macControl , m_viewSize ) ; - } - } - if ( refresh ) - MacRedrawControl() ; -} - - -void wxScrollBar::Command(wxCommandEvent& event) -{ - SetThumbPosition(event.m_commandInt); - ProcessCommand(event); -} - -void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - - int position = GetControl32BitValue( (ControlHandle) m_macControl) ; - int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ; - int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ; - - wxEventType scrollEvent = wxEVT_NULL; - int nScrollInc = 0; - - // all events have already been reported during mouse down, except for THUMBRELEASE - if ( !mouseStillDown && controlpart !=kControlIndicatorPart ) - return ; - - switch( controlpart ) - { - case kControlUpButtonPart : - nScrollInc = -1; - scrollEvent = wxEVT_SCROLL_LINEUP; - break ; - case kControlDownButtonPart : - nScrollInc = 1; - scrollEvent = wxEVT_SCROLL_LINEDOWN; - break ; - case kControlPageUpPart : - nScrollInc = -m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEUP; - break ; - case kControlPageDownPart : - nScrollInc = m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEDOWN; - break ; - case kControlIndicatorPart : - nScrollInc = 0 ; - if ( mouseStillDown ) - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - else - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - break ; - default : - wxFAIL_MSG(wxT("illegal scrollbar selector")); - break ; - } - - int new_pos = position + nScrollInc; - - if (new_pos < minPos) - new_pos = minPos; - if (new_pos > maxPos) - new_pos = maxPos; - if ( nScrollInc ) - SetThumbPosition(new_pos); - - wxScrollEvent event(scrollEvent, m_windowId); - if ( m_windowStyle & wxHORIZONTAL ) - { - event.SetOrientation( wxHORIZONTAL ) ; - } - else - { - event.SetOrientation( wxVERTICAL ) ; - } - event.SetPosition(new_pos); - event.SetEventObject( this ); - wxWindow* window = GetParent() ; - if (window && window->MacIsWindowScrollbar(this) ) - { - // this is hardcoded - window->MacOnScroll(event); - } - else - GetEventHandler()->ProcessEvent(event); -} - diff --git a/src/mac/classic/settings.cpp b/src/mac/classic/settings.cpp deleted file mode 100644 index 4ddb2a4582..0000000000 --- a/src/mac/classic/settings.cpp +++ /dev/null @@ -1,279 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp -// Purpose: wxSettings -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "settings.h" -#endif - -#include "wx/settings.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" - -#include "wx/mac/uma.h" - -// ---------------------------------------------------------------------------- -// wxSystemSettingsNative -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// colours -// ---------------------------------------------------------------------------- - -wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) -{ - int major,minor; - wxGetOsVersion( &major, &minor ); - - switch( index ) - { - case wxSYS_COLOUR_SCROLLBAR : - case wxSYS_COLOUR_BACKGROUND: - case wxSYS_COLOUR_ACTIVECAPTION: - case wxSYS_COLOUR_INACTIVECAPTION: - case wxSYS_COLOUR_MENU: - case wxSYS_COLOUR_WINDOW: - case wxSYS_COLOUR_WINDOWFRAME: - case wxSYS_COLOUR_ACTIVEBORDER: - case wxSYS_COLOUR_INACTIVEBORDER: - case wxSYS_COLOUR_BTNFACE: - case wxSYS_COLOUR_MENUBAR: - return wxColor( 0xDD , 0xDD , 0xDD ) ; - break ; - - case wxSYS_COLOUR_LISTBOX : - { - if (major >= 10) - return *wxWHITE ; - else - return wxColor( 0xEE , 0xEE , 0xEE ) ; - break ; - } - case wxSYS_COLOUR_BTNSHADOW: - if (major >= 10) - return wxColor( 0xBE , 0xBE , 0xBE ) ; - else - return wxColor( 0x44 , 0x44 , 0x44 ) ; - break ; - - case wxSYS_COLOUR_BTNTEXT: - case wxSYS_COLOUR_MENUTEXT: - case wxSYS_COLOUR_WINDOWTEXT: - case wxSYS_COLOUR_CAPTIONTEXT: - case wxSYS_COLOUR_INFOTEXT: - case wxSYS_COLOUR_INACTIVECAPTIONTEXT: - return *wxBLACK; - break ; - case wxSYS_COLOUR_HIGHLIGHT: - { - RGBColor hilite ; - LMGetHiliteRGB(&hilite) ; - return wxColor( hilite.red >> 8 , hilite.green >> 8 , hilite.blue >> 8 ) ; - } - break ; - case wxSYS_COLOUR_BTNHIGHLIGHT: - case wxSYS_COLOUR_GRAYTEXT: - return wxColor( 0xCC , 0xCC , 0xCC ) ; - break ; - - case wxSYS_COLOUR_3DDKSHADOW: - return wxColor( 0x44 , 0x44 , 0x44 ) ; - break ; - case wxSYS_COLOUR_3DLIGHT: - return wxColor( 0xCC , 0xCC , 0xCC ) ; - break ; - case wxSYS_COLOUR_HIGHLIGHTTEXT : - { - RGBColor hilite ; - LMGetHiliteRGB(&hilite) ; - if ( ( hilite.red + hilite.green + hilite.blue ) == 0 ) - return *wxWHITE ; - else - return *wxBLACK ; - } - break ; - case wxSYS_COLOUR_INFOBK : - case wxSYS_COLOUR_APPWORKSPACE: - return *wxWHITE ; - break ; - - case wxSYS_COLOUR_HOTLIGHT: - case wxSYS_COLOUR_GRADIENTACTIVECAPTION: - case wxSYS_COLOUR_GRADIENTINACTIVECAPTION: - case wxSYS_COLOUR_MENUHILIGHT: - // TODO - return *wxBLACK; - - case wxSYS_COLOUR_MAX: - wxFAIL_MSG( _T("unknown system colour index") ); - break ; - } - return *wxWHITE; -} - -// ---------------------------------------------------------------------------- -// fonts -// ---------------------------------------------------------------------------- - -wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) -{ - switch (index) - { - case wxSYS_ANSI_VAR_FONT : - case wxSYS_SYSTEM_FONT : - case wxSYS_DEVICE_DEFAULT_FONT : - case wxSYS_DEFAULT_GUI_FONT : - { - return *wxSMALL_FONT ; - } ; - break ; - case wxSYS_OEM_FIXED_FONT : - case wxSYS_ANSI_FIXED_FONT : - case wxSYS_SYSTEM_FIXED_FONT : - default : - { - return *wxNORMAL_FONT ; - } ; - break ; - - } - return *wxNORMAL_FONT; -} - -// ---------------------------------------------------------------------------- -// system metrics/features -// ---------------------------------------------------------------------------- - -// Get a system metric, e.g. scrollbar size -int wxSystemSettingsNative::GetMetric(wxSystemMetric index) -{ - int value; - - switch ( index) - { - case wxSYS_MOUSE_BUTTONS: - // we emulate a two button mouse (ctrl + click = right button ) - return 2; - case wxSYS_BORDER_X: - // TODO - return 0; - case wxSYS_BORDER_Y: - // TODO - return 0; - case wxSYS_CURSOR_X: - // TODO - return 0; - case wxSYS_CURSOR_Y: - // TODO - return 0; - case wxSYS_DCLICK_X: - // TODO - return 0; - case wxSYS_DCLICK_Y: - // TODO - return 0; - case wxSYS_DRAG_X: - // TODO - return 0; - case wxSYS_DRAG_Y: - // TODO - return 0; - case wxSYS_EDGE_X: - // TODO - return 0; - case wxSYS_EDGE_Y: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_X: - return 16; - case wxSYS_HSCROLL_ARROW_Y: - return 16; - case wxSYS_HTHUMB_X: - return 16; - case wxSYS_ICON_X: - // TODO - return 0; - case wxSYS_ICON_Y: - // TODO - return 0; - case wxSYS_ICONSPACING_X: - // TODO - return 0; - case wxSYS_ICONSPACING_Y: - // TODO - return 0; - case wxSYS_WINDOWMIN_X: - // TODO - return 0; - case wxSYS_WINDOWMIN_Y: - // TODO - return 0; - case wxSYS_SCREEN_X: - wxDisplaySize(&value, NULL); - return value; - case wxSYS_SCREEN_Y: - wxDisplaySize(NULL, &value); - return value; - case wxSYS_FRAMESIZE_X: - // TODO - return 0; - case wxSYS_FRAMESIZE_Y: - // TODO - return 0; - case wxSYS_SMALLICON_X: - // TODO - return 0; - case wxSYS_SMALLICON_Y: - // TODO - return 0; - case wxSYS_HSCROLL_Y: - return 16; - case wxSYS_VSCROLL_X: - return 16; - case wxSYS_VSCROLL_ARROW_X: - return 16; - case wxSYS_VSCROLL_ARROW_Y: - return 16; - case wxSYS_VTHUMB_Y: - return 16; - case wxSYS_CAPTION_Y: - // TODO - return 0; - case wxSYS_MENU_Y: - // TODO - return 0; - case wxSYS_NETWORK_PRESENT: - // TODO - return 0; - case wxSYS_PENWINDOWS_PRESENT: - return 0; - case wxSYS_SHOW_SOUNDS: - // TODO - return 0; - case wxSYS_SWAP_BUTTONS: - return 0; - default: - return 0; - } - return 0; -} - -bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) -{ - switch (index) - { - case wxSYS_CAN_ICONIZE_FRAME: - case wxSYS_CAN_DRAW_FRAME_DECORATIONS: - return TRUE; - - default: - return FALSE; - } -} diff --git a/src/mac/classic/slider.cpp b/src/mac/classic/slider.cpp deleted file mode 100644 index 4bd4bab532..0000000000 --- a/src/mac/classic/slider.cpp +++ /dev/null @@ -1,433 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp -// Purpose: wxSlider -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "slider.h" -#endif - -#include "wx/slider.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - -BEGIN_EVENT_TABLE(wxSlider, wxControl) -END_EVENT_TABLE() -#endif - - // The dimensions of the different styles of sliders (From Aqua document) -#define wxSLIDER_DIMENSIONACROSS 15 -#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 -#define wxSLIDER_DIMENSIONACROSS_ARROW 18 - -// Distance between slider and text -#define wxSLIDER_BORDERTEXT 5 - -/* NB! The default orientation for a slider is horizontal however if the user specifies - * some slider styles but dosen't specify the orientation we have to assume he wants a - * horizontal one. Therefore in this file when testing for the sliders orientation - * vertical is tested for if this is not set then we use the horizontal one - * eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }> - */ - - // Slider - wxSlider::wxSlider() -{ - m_pageSize = 1; - m_lineSize = 1; - m_rangeMax = 0; - m_rangeMin = 0; - m_tickFreq = 0; -} - -extern ControlActionUPP wxMacLiveScrollbarActionUPP ; - -bool wxSlider::Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - SInt16 procID; - - m_macMinimumStatic = NULL ; - m_macMaximumStatic = NULL ; - m_macValueStatic = NULL ; - - - m_lineSize = 1; - m_tickFreq = 0; - - m_rangeMax = maxValue; - m_rangeMin = minValue; - - m_pageSize = (int)((maxValue-minValue)/10); - - MacPreControlCreate( parent, id, wxEmptyString, pos, size, style, - validator, name, &bounds, title ); - - procID = kControlSliderProc + kControlSliderLiveFeedback; - if(style & wxSL_AUTOTICKS) { - procID += kControlSliderHasTickMarks; - } - - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false, - value, minValue, maxValue, procID, (long) this); - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; - - if(style & wxSL_LABELS) - { - m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString ); - m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString ); - m_macValueStatic = new wxStaticText( this, -1, wxEmptyString ); - SetRange(minValue, maxValue); - SetValue(value); - } - - else { - m_macMinimumStatic = NULL ; - m_macMaximumStatic = NULL ; - m_macValueStatic = NULL ; - } - - if(style & wxSL_VERTICAL) { - SetSizeHints(10, -1, 10, -1); // Forces SetSize to use the proper width - } - else { - SetSizeHints(-1, 10, -1, 10); // Forces SetSize to use the proper height - } - // NB! SetSizeHints is overloaded by wxSlider and will substitute 10 with the - // proper dimensions, it also means other people cannot bugger the slider with - // other values - - MacPostControlCreate() ; - - return true; -} - -wxSlider::~wxSlider() -{ -} - -int wxSlider::GetValue() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl) ; -} - -void wxSlider::SetValue(int value) -{ - wxString valuestring ; - valuestring.Printf( wxT("%d") , value ) ; - if ( m_macValueStatic ) - m_macValueStatic->SetLabel( valuestring ) ; - SetControl32BitValue( (ControlHandle) m_macControl , value ) ; -} - -void wxSlider::SetRange(int minValue, int maxValue) -{ - wxString value; - - m_rangeMin = minValue; - m_rangeMax = maxValue; - - SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin); - SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax); - - if(m_macMinimumStatic) { - value.Printf(wxT("%d"), m_rangeMin); - m_macMinimumStatic->SetLabel(value); - } - if(m_macMaximumStatic) { - value.Printf(wxT("%d"), m_rangeMax); - m_macMaximumStatic->SetLabel(value); - } - SetValue(m_rangeMin); -} - -// For trackbars only -void wxSlider::SetTickFreq(int n, int pos) -{ - // TODO - m_tickFreq = n; -} - -void wxSlider::SetPageSize(int pageSize) -{ - // TODO - m_pageSize = pageSize; -} - -int wxSlider::GetPageSize() const -{ - return m_pageSize; -} - -void wxSlider::ClearSel() -{ - // TODO -} - -void wxSlider::ClearTicks() -{ - // TODO -} - -void wxSlider::SetLineSize(int lineSize) -{ - m_lineSize = lineSize; - // TODO -} - -int wxSlider::GetLineSize() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelEnd() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelStart() const -{ - // TODO - return 0; -} - -void wxSlider::SetSelection(int minPos, int maxPos) -{ - // TODO -} - -void wxSlider::SetThumbLength(int len) -{ - // TODO -} - -int wxSlider::GetThumbLength() const -{ - // TODO - return 0; -} - -void wxSlider::SetTick(int tickPos) -{ - // TODO -} - -void wxSlider::Command (wxCommandEvent & event) -{ - SetValue (event.GetInt()); - ProcessCommand (event); -} - -void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bool mouseStillDown ) -{ - SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ; - - SetValue( value ) ; - - wxEventType scrollEvent = wxEVT_NULL ; - - if ( mouseStillDown ) - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - else - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - - wxScrollEvent event(scrollEvent, m_windowId); - event.SetPosition(value); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - - wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); - cevent.SetInt( value ); - cevent.SetEventObject( this ); - - GetEventHandler()->ProcessEvent( cevent ); -} - -/* This is overloaded in wxSlider so that the proper width/height will always be used -* for the slider different values would cause redrawing and mouse detection problems */ -void wxSlider::SetSizeHints( int minW, int minH, - int maxW , int maxH , - int incW , int incH ) -{ - wxSize size = GetBestSize(); - - if(GetWindowStyle() & wxSL_VERTICAL) { - wxWindow::SetSizeHints(size.x, minH, size.x, maxH, incW, incH); - } - else { - wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH); - } -} - -wxSize wxSlider::DoGetBestSize() const -{ - wxSize size; - int textwidth, textheight; - - if(GetWindowStyle() & wxSL_LABELS) - { - wxString text; - int ht, wd; - - // Get maximum text label width and height - text.Printf(wxT("%d"), m_rangeMin); - GetTextExtent(text, &textwidth, &textheight); - text.Printf(wxT("%d"), m_rangeMax); - GetTextExtent(text, &wd, &ht); - if(ht > textheight) { - textheight = ht; - } - if (wd > textwidth) { - textwidth = wd; - } - } - - if(GetWindowStyle() & wxSL_VERTICAL) - { - if(GetWindowStyle() & wxSL_AUTOTICKS) { - size.x = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - size.x = wxSLIDER_DIMENSIONACROSS_ARROW; - } - if(GetWindowStyle() & wxSL_LABELS) { - size.x += textwidth + wxSLIDER_BORDERTEXT; - } - size.y = 150; - } - else - { - if(GetWindowStyle() & wxSL_AUTOTICKS) { - size.y = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - size.y = wxSLIDER_DIMENSIONACROSS_ARROW; - } - if(GetWindowStyle() & wxSL_LABELS) { - size.y += textheight + wxSLIDER_BORDERTEXT; - } - size.x = 150; - } - return size; -} - -void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ; -} - -void wxSlider::MacUpdateDimensions() -{ - // actually in the current systems this should never be possible, but later reparenting - // may become a reality - - if ( (ControlHandle) m_macControl == NULL ) - return ; - - if ( GetParent() == NULL ) - return ; - - WindowRef rootwindow = (WindowRef) MacGetRootWindow() ; - if ( rootwindow == NULL ) - return ; - - int xborder, yborder; - int minValWidth, maxValWidth, textwidth, textheight; - int sliderBreadth; - - xborder = yborder = 0; - - if (GetWindowStyle() & wxSL_LABELS) - { - wxString text; - int ht; - - // Get maximum text label width and height - text.Printf(wxT("%d"), m_rangeMin); - GetTextExtent(text, &minValWidth, &textheight); - text.Printf(wxT("%d"), m_rangeMax); - GetTextExtent(text, &maxValWidth, &ht); - if(ht > textheight) { - textheight = ht; - } - textwidth = (minValWidth > maxValWidth ? minValWidth : maxValWidth); - - xborder = textwidth + wxSLIDER_BORDERTEXT; - yborder = textheight + wxSLIDER_BORDERTEXT; - - // Get slider breadth - if(GetWindowStyle() & wxSL_AUTOTICKS) { - sliderBreadth = wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS; - } - else { - sliderBreadth = wxSLIDER_DIMENSIONACROSS_ARROW; - } - - if(GetWindowStyle() & wxSL_VERTICAL) - { - m_macMinimumStatic->Move(sliderBreadth + wxSLIDER_BORDERTEXT, - m_height - yborder - textheight); - m_macMaximumStatic->Move(sliderBreadth + wxSLIDER_BORDERTEXT, 0); - m_macValueStatic->Move(0, m_height - textheight); - } - else - { - m_macMinimumStatic->Move(0, sliderBreadth + wxSLIDER_BORDERTEXT); - m_macMaximumStatic->Move(m_width - xborder - maxValWidth / 2, - sliderBreadth + wxSLIDER_BORDERTEXT); - m_macValueStatic->Move(m_width - textwidth, 0); - } - } - - Rect oldBounds ; - GetControlBounds( (ControlHandle) m_macControl , &oldBounds ) ; - - int new_x = m_x + MacGetLeftBorderSize() + m_macHorizontalBorder ; - int new_y = m_y + MacGetTopBorderSize() + m_macVerticalBorder ; - int new_width = m_width - MacGetLeftBorderSize() - MacGetRightBorderSize() - 2 * m_macHorizontalBorder - xborder ; - int new_height = m_height - MacGetTopBorderSize() - MacGetBottomBorderSize() - 2 * m_macVerticalBorder - yborder ; - - GetParent()->MacWindowToRootWindow( & new_x , & new_y ) ; - bool doMove = new_x != oldBounds.left || new_y != oldBounds.top ; - bool doResize = ( oldBounds.right - oldBounds.left ) != new_width || (oldBounds.bottom - oldBounds.top ) != new_height ; - if ( doMove || doResize ) - { - InvalWindowRect( rootwindow, &oldBounds ) ; - if ( doMove ) - { - UMAMoveControl( (ControlHandle) m_macControl , new_x , new_y ) ; - } - if ( doResize ) - { - UMASizeControl( (ControlHandle) m_macControl , new_width , new_height ) ; - } - } -} - -void wxSlider::DoMoveWindow(int x, int y, int width, int height) -{ - wxControl::DoMoveWindow(x,y,width,height) ; -} diff --git a/src/mac/classic/sound.cpp b/src/mac/classic/sound.cpp deleted file mode 100644 index d6d13bb595..0000000000 --- a/src/mac/classic/sound.cpp +++ /dev/null @@ -1,243 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sound.cpp -// Purpose: wxSound class implementation: optional -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "sound.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/sound.h" - -#if wxUSE_SOUND - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#ifndef __DARWIN__ -#include -#endif -#endif - -wxSound::wxSound() - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) -{ -} - -wxSound::wxSound(const wxString& sFileName, bool isResource) - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) -{ - Create(sFileName, isResource); -} - - -wxSound::~wxSound() -{ - FreeData(); -} - -wxSound::wxSound(int size, const wxByte* data) - : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false) -{ - //TODO convert data -} - -bool wxSound::Create(const wxString& fileName, bool isResource) -{ - bool ret = false; - m_sndname = fileName; - m_isResource = isResource; - - if (m_isResource) - ret = true; - else - { /* - if (sndChan) - { // we're playing - FSClose(SndRefNum); - SndRefNum = 0; - SndDisposeChannel(sndChan, TRUE); - free(sndChan); - sndChan = 0; - KillTimer(0,timerID); - } - - if (!lpSnd) - return true; - - if (_access(lpSnd,0)) // no file, no service - return false; - - // Allocate SndChannel - sndChan = (SndChannelPtr) malloc (sizeof(SndChannel)); - - if (!sndChan) - return false; - - sndChan->qLength = 128; - - if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0)) - { - free(sndChan); - sndChan = 0; - return false; - } - - if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd))) - { - SndDisposeChannel(sndChan, TRUE); - free(sndChan); - sndChan = 0; - - return false; - } - - bool async = false; - - if (fdwSound & SND_ASYNC) - async = true; - - if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr) - { - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - return false; - } - - if (async) - { // haven't finish yet - timerID = SetTimer(0, 0, 250, TimerCallBack); - } - else - { - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - }*/ - } - - return ret; -} - - -//don't know what to do with looped, wth -bool wxSound::DoPlay(unsigned flags) const -{ - bool ret = false; - - if (m_isResource) - { - Str255 snd ; - wxMacStringToPascal( m_sndname , snd ) ; - SndListHandle hSnd; - - hSnd = (SndListHandle) GetNamedResource('snd ', snd); - - if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, (flags & wxSOUND_ASYNC)) == noErr)) - ret = true; - } - - return ret; -} - - -bool wxSound::FreeData() -{ - bool ret = false; - - if (m_isResource) - { - m_sndname.Empty(); - ret = true; - } - else - { - //TODO, - } - - return ret; -} - - -//code below is from an old implementation used for telinfo with MSVC crossplatform support -//technology proceeds, so it would be the wisest to drop this code, but it's left here just -//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3 - -/*static short MacOpenSndFile (char * path) -{ - VolumeParam vp; - FSSpec fspec; - Str255 name; - char *c; - - // first, get the volume reference number for the file. Start by - // making a Pstring with just the volume name - strcpy ((char *) name, path); - if (c = strchr ((char *) name, ':')) - { - c++; - *c = '\0'; - } - - c2pstr ((char *) name); - vp.ioCompletion = 0; - vp.ioVolIndex = -1; - vp.ioNamePtr = name; - vp.ioVRefNum = 0; - - if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr) - return 0; - - // next, buld an FSSpec for the file - strcpy ((char *) name, path); - c2pstr ((char *) name); - if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr) - return 0; - - short frefnum; - // now open the file, and return it's reference number - if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr) - return 0; - - return frefnum; -} - - -void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime) -{ - if(!sndChan) - { - KillTimer(0,timerID); - return; - } - - SCStatus scstat; - - if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) { - if (scstat.scChannelPaused || scstat.scChannelBusy) - return; // not done yet - } - - // either error or done. - FSClose (SndRefNum); - SndRefNum = 0; - SndDisposeChannel (sndChan, TRUE); - free (sndChan); - sndChan = 0; - KillTimer(0,timerID); -}*/ - - -#endif diff --git a/src/mac/classic/spinbutt.cpp b/src/mac/classic/spinbutt.cpp deleted file mode 100644 index f8dcca8bd9..0000000000 --- a/src/mac/classic/spinbutt.cpp +++ /dev/null @@ -1,182 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp -// Purpose: wxSpinButton -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "spinbutt.h" -#pragma implementation "spinbuttbase.h" -#endif - -#include "wx/spinbutt.h" -#include "wx/mac/uma.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) -#endif - -wxSpinButton::wxSpinButton() - : wxSpinButtonBase() -{ -} - -bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if ( !wxSpinButtonBase::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - m_min = 0; - m_max = 100; - - if (!parent) - return FALSE; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100, - kControlLittleArrowsProc , (long) this ) ; - - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxSpinButton::~wxSpinButton() -{ -} - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -int wxSpinButton::GetMin() const -{ - return m_min; -} - -int wxSpinButton::GetMax() const -{ - return m_max; -} - -int wxSpinButton::GetValue() const -{ - return m_value; -} - -void wxSpinButton::SetValue(int val) -{ - m_value = val ; -} - -void wxSpinButton::SetRange(int minVal, int maxVal) -{ - m_min = minVal; - m_max = maxVal; - SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ; - SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ; -} - -void wxSpinButton::MacHandleValueChanged( int inc ) -{ - - wxEventType scrollEvent = wxEVT_NULL; - int oldValue = m_value ; - - m_value = oldValue + inc; - - if (m_value < m_min) - { - if ( m_windowStyle & wxSP_WRAP ) - m_value = m_max; - else - m_value = m_min; - } - - if (m_value > m_max) - { - if ( m_windowStyle & wxSP_WRAP ) - m_value = m_min; - else - m_value = m_max; - } - - if ( m_value - oldValue == -1 ) - scrollEvent = wxEVT_SCROLL_LINEDOWN ; - else if ( m_value - oldValue == 1 ) - scrollEvent = wxEVT_SCROLL_LINEUP ; - else - scrollEvent = wxEVT_SCROLL_THUMBTRACK ; - - wxSpinEvent event(scrollEvent, m_windowId); - - event.SetPosition(m_value); - event.SetEventObject( this ); - if ((GetEventHandler()->ProcessEvent( event )) && - !event.IsAllowed() ) - { - m_value = oldValue ; - } - SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ; - - /* always send a thumbtrack event */ - if (scrollEvent != wxEVT_SCROLL_THUMBTRACK) - { - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - wxSpinEvent event2( scrollEvent, GetId()); - event2.SetPosition( m_value ); - event2.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event2 ); - } -} - -void wxSpinButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) -{ - if ( (ControlHandle) m_macControl == NULL ) - return ; - - int nScrollInc = 0; - - switch( controlpart ) - { - case kControlUpButtonPart : - nScrollInc = 1; - break ; - case kControlDownButtonPart : - nScrollInc = -1; - break ; - } - MacHandleValueChanged( nScrollInc ) ; - -} - -// ---------------------------------------------------------------------------- -// size calculation -// ---------------------------------------------------------------------------- - -wxSize wxSpinButton::DoGetBestSize() const -{ - return wxSize(16,24); -} - diff --git a/src/mac/classic/spinctrl.cpp b/src/mac/classic/spinctrl.cpp deleted file mode 100644 index 22553d47f1..0000000000 --- a/src/mac/classic/spinctrl.cpp +++ /dev/null @@ -1,333 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp -// Purpose: wxSpinCtrl -// Author: Robert -// Modified by: Mark Newsam (Based on GTK file) -// RCS-ID: $Id$ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "spinctlg.h" -#endif - -#include "wx/defs.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif //WX_PRECOMP - -#if wxUSE_SPINCTRL - -#include "wx/spinbutt.h" -#include "wx/spinctrl.h" - - -#include "wx/spinctrl.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the text control and the spin -static const wxCoord MARGIN = 2; - -// ---------------------------------------------------------------------------- -// wxSpinCtrlText: text control used by spin control -// ---------------------------------------------------------------------------- - -class wxSpinCtrlText : public wxTextCtrl -{ -public: - wxSpinCtrlText(wxSpinCtrl *spin, const wxString& value) - : wxTextCtrl(spin , -1, value) - { - m_spin = spin; - } - -protected: - void OnTextChange(wxCommandEvent& event) - { - int val; - if ( m_spin->GetTextValue(&val) ) - { - m_spin->GetSpinButton()->SetValue(val); - } - - event.Skip(); - } - - bool ProcessEvent(wxEvent &event) - { - // Hand button down events to wxSpinCtrl. Doesn't work. - if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event )) - return TRUE; - - return wxTextCtrl::ProcessEvent( event ); - } - -private: - wxSpinCtrl *m_spin; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSpinCtrlText, wxTextCtrl) - EVT_TEXT(-1, wxSpinCtrlText::OnTextChange) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxSpinCtrlButton: spin button used by spin control -// ---------------------------------------------------------------------------- - -class wxSpinCtrlButton : public wxSpinButton -{ -public: - wxSpinCtrlButton(wxSpinCtrl *spin, int style) - : wxSpinButton(spin ) - { - m_spin = spin; - - SetWindowStyle(style | wxSP_VERTICAL); - } - -protected: - void OnSpinButton(wxSpinEvent& eventSpin) - { -#if defined(__WXMAC__) || defined(__WXMOTIF__) - m_spin->SetTextValue(eventSpin.GetPosition()); - - wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); - event.SetEventObject(m_spin); - event.SetInt(eventSpin.GetPosition()); - - m_spin->GetEventHandler()->ProcessEvent(event); -#else - m_spin->SetTextValue(eventSpin.GetPosition()); - eventSpin.Skip(); -#endif - } - -private: - wxSpinCtrl *m_spin; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) - EVT_SPIN(-1, wxSpinCtrlButton::OnSpinButton) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxSpinCtrl creation -// ---------------------------------------------------------------------------- - -void wxSpinCtrl::Init() -{ - m_text = NULL; - m_btn = NULL; -} - -bool wxSpinCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - int min, - int max, - int initial, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style, - wxDefaultValidator, name) ) - { - return FALSE; - } - - // the string value overrides the numeric one (for backwards compatibility - // reasons and also because it is simpler to satisfy the string value which - // comes much sooner in the list of arguments and leave the initial - // parameter unspecified) - if ( !value.empty() ) - { - long l; - if ( value.ToLong(&l) ) - initial = l; - } - - wxSize csize = size ; - m_text = new wxSpinCtrlText(this, value); - m_btn = new wxSpinCtrlButton(this, style); - - m_btn->SetRange(min, max); - m_btn->SetValue(initial); - - if ( size.y == -1 ) { - csize.y = m_text->GetSize().y ; - } - DoSetSize(pos.x , pos.y , csize.x, csize.y); - - return TRUE; -} - -wxSpinCtrl::~wxSpinCtrl() -{ - // delete the controls now, don't leave them alive even though they would - // still be eventually deleted by our parent - but it will be too late, the - // user code expects them to be gone now - delete m_text; - m_text = NULL ; - delete m_btn; - m_btn = NULL ; -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxSpinCtrl::DoGetBestSize() const -{ - wxSize sizeBtn = m_btn->GetBestSize(), - sizeText = m_text->GetBestSize(); - - return wxSize(sizeBtn.x + sizeText.x + MARGIN, sizeText.y); -} - -void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) -{ - wxControl::DoMoveWindow(x, y, width, height); - - // position the subcontrols inside the client area - wxSize sizeBtn = m_btn->GetSize(); - - wxCoord wText = width - sizeBtn.x; - m_text->SetSize(0, 0, wText, height); - m_btn->SetSize(0 + wText + MARGIN, 0, -1, -1); -} - -// ---------------------------------------------------------------------------- -// operations forwarded to the subcontrols -// ---------------------------------------------------------------------------- - -bool wxSpinCtrl::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return FALSE; - return TRUE; -} - -bool wxSpinCtrl::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return FALSE; - return TRUE; -} - -// ---------------------------------------------------------------------------- -// value and range access -// ---------------------------------------------------------------------------- - -bool wxSpinCtrl::GetTextValue(int *val) const -{ - long l; - if ( !m_text->GetValue().ToLong(&l) ) - { - // not a number at all - return FALSE; - } - - if ( l < GetMin() || l > GetMax() ) - { - // out of range - return FALSE; - } - - *val = l; - - return TRUE; -} - -int wxSpinCtrl::GetValue() const -{ - return m_btn ? m_btn->GetValue() : 0; -} - -int wxSpinCtrl::GetMin() const -{ - return m_btn ? m_btn->GetMin() : 0; -} - -int wxSpinCtrl::GetMax() const -{ - return m_btn ? m_btn->GetMax() : 0; -} - -// ---------------------------------------------------------------------------- -// changing value and range -// ---------------------------------------------------------------------------- - -void wxSpinCtrl::SetTextValue(int val) -{ - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetTextValue") ); - - m_text->SetValue(wxString::Format(_T("%d"), val)); - - // select all text - m_text->SetSelection(0, -1); - - // and give focus to the control! - // m_text->SetFocus(); Why???? TODO. -} - -void wxSpinCtrl::SetValue(int val) -{ - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetValue") ); - - SetTextValue(val); - - m_btn->SetValue(val); -} - -void wxSpinCtrl::SetValue(const wxString& text) -{ - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetValue") ); - - long val; - if ( text.ToLong(&val) && ((val > INT_MIN) && (val < INT_MAX)) ) - { - SetValue((int)val); - } - else // not a number at all or out of range - { - m_text->SetValue(text); - m_text->SetSelection(0, -1); - } -} - -void wxSpinCtrl::SetRange(int min, int max) -{ - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetRange") ); - - m_btn->SetRange(min, max); -} - -void wxSpinCtrl::SetSelection(long from, long to) -{ - // if from and to are both -1, it means (in wxWindows) that all text should - // be selected - if ( (from == -1) && (to == -1) ) - { - from = 0; - } - m_text->SetSelection(from, to); -} - -#endif // wxUSE_SPINCTRL diff --git a/src/mac/classic/statbmp.cpp b/src/mac/classic/statbmp.cpp deleted file mode 100644 index 68bc4efa6a..0000000000 --- a/src/mac/classic/statbmp.cpp +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.cpp -// Purpose: wxStaticBitmap -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "statbmp.h" -#endif - -#include "wx/defs.h" - -#include "wx/statbmp.h" -#include "wx/dcclient.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) -#endif - -/* - * wxStaticBitmap - */ - -BEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase) - EVT_PAINT(wxStaticBitmap::OnPaint) -END_EVENT_TABLE() - -bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, - const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& s, - long style, - const wxString& name) -{ - SetName(name); - wxSize size = s ; - if ( bitmap.Ok() ) - { - if ( size.x == -1 ) - size.x = bitmap.GetWidth() ; - if ( size.y == -1 ) - size.y = bitmap.GetHeight() ; - } - - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - - m_bitmap = bitmap; - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetBestSize( size ) ; - - return ret; -} - -void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); - Refresh() ; -} - -void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - PrepareDC(dc); - - dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ; -} - -wxSize wxStaticBitmap::DoGetBestSize() const -{ - return wxWindow::DoGetBestSize() ; -} - diff --git a/src/mac/classic/statbox.cpp b/src/mac/classic/statbox.cpp deleted file mode 100644 index 13c7daf669..0000000000 --- a/src/mac/classic/statbox.cpp +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp -// Purpose: wxStaticBox -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbox.h" -#endif - -#include "wx/defs.h" - -#include "wx/statbox.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) - -BEGIN_EVENT_TABLE(wxStaticBox, wxControl) - EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) -END_EVENT_TABLE() - -#endif - -/* - * Static box - */ - -bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlGroupBoxTextTitleProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} diff --git a/src/mac/classic/statbrma.cpp b/src/mac/classic/statbrma.cpp deleted file mode 100644 index b2dba2135d..0000000000 --- a/src/mac/classic/statbrma.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: statbar.cpp -// Purpose: native implementation of wxStatusBar (optional) -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Stefan Csomor -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbrma.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/statusbr.h" -#include "wx/dc.h" -#include "wx/dcclient.h" - -BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric) - EVT_PAINT(wxStatusBarMac::OnPaint) -END_EVENT_TABLE() - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStatusBarMac class -// ---------------------------------------------------------------------------- - -wxStatusBarMac::wxStatusBarMac() -{ - SetParent(NULL); -} - -wxStatusBarMac::~wxStatusBarMac() -{ -} - -bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, - long style , - const wxString& name) -{ - return wxStatusBarGeneric::Create( parent , id , style , name ) ; -} - -void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) -{ - int leftMargin = 2; - - wxRect rect; - GetFieldRect(i, rect); - - if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) ) - { - dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; - } - - wxString text(GetStatusText(i)); - - long x, y; - - dc.GetTextExtent(text, &x, &y); - - int xpos = rect.x + leftMargin + 1 ; - int ypos = 1 ; - - dc.SetClippingRegion(rect.x, 0, rect.width, m_height); - - dc.DrawText(text, xpos, ypos); - - dc.DestroyClippingRegion(); -} - -void wxStatusBarMac::DrawField(wxDC& dc, int i) -{ - DrawFieldText(dc, i); -} - -void wxStatusBarMac::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( (number >= 0) && (number < m_nFields), - _T("invalid status bar field index") ); - - m_statusStrings[number] = text; - wxRect rect; - GetFieldRect(number, rect); - rect.y=0; - rect.height = m_height ; - Refresh( TRUE , &rect ) ; - Update(); -} - -void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - dc.Clear() ; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - if ( IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) ) - { - wxPen white( wxWHITE , 1 , wxSOLID ) ; - if (major >= 10) - { - //Finder statusbar border color: (Project builder similar is 9B9B9B) - dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); - } - else - { - wxPen black( wxBLACK , 1 , wxSOLID ) ; - dc.SetPen(black); - } - dc.DrawLine(0, 0 , - m_width , 0); - dc.SetPen(white); - dc.DrawLine(0, 1 , - m_width , 1); - } - else - { - if (major >= 10) - //Finder statusbar border color: (Project builder similar is 9B9B9B) - dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); - else - dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID)); - - dc.DrawLine(0, 0 , - m_width , 0); - } - - int i; - if ( GetFont().Ok() ) - dc.SetFont(GetFont()); - dc.SetBackgroundMode(wxTRANSPARENT); - - for ( i = 0; i < m_nFields; i ++ ) - DrawField(dc, i); -} - -void wxStatusBarMac::MacSuperEnabled( bool enabled ) -{ - Refresh(FALSE) ; - wxWindow::MacSuperEnabled( enabled ) ; -} diff --git a/src/mac/classic/statline.cpp b/src/mac/classic/statline.cpp deleted file mode 100644 index 52f3d40733..0000000000 --- a/src/mac/classic/statline.cpp +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.cpp -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "statline.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/statline.h" -#include "wx/statbox.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -bool wxStaticLine::Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; - - // ok, this is ugly but it's better than nothing: use a thin static box to - // emulate static line - - wxSize sizeReal = AdjustSize(size); - -// m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name); - - return TRUE; -} diff --git a/src/mac/classic/statlmac.cpp b/src/mac/classic/statlmac.cpp deleted file mode 100644 index a7a116ba57..0000000000 --- a/src/mac/classic/statlmac.cpp +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.cpp -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "statline.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/statline.h" -#include "wx/statbox.h" - -#include "wx/mac/uma.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -bool wxStaticLine::Create( wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - if ( !wxStaticLineBase::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlSeparatorLineProc , (long) this ) ; - - MacPostControlCreate() ; - - return TRUE; -} diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp deleted file mode 100644 index 1c0facdbf7..0000000000 --- a/src/mac/classic/stattext.cpp +++ /dev/null @@ -1,262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp -// Purpose: wxStaticText -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "stattext.h" -#endif - -#include "wx/app.h" -#include "wx/stattext.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/settings.h" - -#include - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) -#endif - -#include "wx/mac/uma.h" - -BEGIN_EVENT_TABLE(wxStaticText, wxStaticTextBase) - EVT_PAINT(wxStaticText::OnPaint) -END_EVENT_TABLE() - -bool wxStaticText::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_label = wxStripMenuCodes(label) ; - - if ( !wxControl::Create( parent, id, pos, size, style, - wxDefaultValidator , name ) ) - { - return false; - } - - SetBestSize( size ) ; - - return true; -} - -const wxString punct = wxT(" ,.-;:!?"); - -void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y) -{ - long width, height ; - - if (paragraph.Length() == 0) - { - // empty line - dc.GetTextExtent( wxT("H"), &width, &height ); - y += height; - - return; - } - - int x = 0 ; - - bool linedrawn = true; - while( paragraph.Length() > 0 ) - { - dc.GetTextExtent( paragraph , &width , &height ) ; - - if ( width > m_width ) - { - for ( size_t p = paragraph.Length() - 1 ; p > 0 ; --p ) - { - if ((punct.Find(paragraph[p]) != wxNOT_FOUND) || !linedrawn) - { - int blank = (paragraph[p] == ' ') ? 0 : 1; - - dc.GetTextExtent( paragraph.Left(p + blank) , &width , &height ) ; - - if ( width <= m_width ) - { - int pos = x ; - if ( HasFlag( wxALIGN_CENTER ) ) - { - pos += ( m_width - width ) / 2 ; - } - else if ( HasFlag( wxALIGN_RIGHT ) ) - { - pos += ( m_width - width ) ; - } - - dc.DrawText( paragraph.Left(p + blank), pos , y) ; - y += height ; - paragraph = paragraph.Mid(p+1) ; - linedrawn = true; - break ; - } - } - } - - linedrawn = false; - } - else - { - int pos = x ; - if ( HasFlag( wxALIGN_CENTER ) ) - { - pos += ( m_width - width ) / 2 ; - } - else if ( HasFlag( wxALIGN_RIGHT ) ) - { - pos += ( m_width - width ) ; - } - - dc.DrawText( paragraph, pos , y) ; - paragraph=wxEmptyString; - y += height ; - } - } -} - -void wxStaticText::OnDraw( wxDC &dc ) -{ - if (m_width <= 0 || m_height <= 0) - return; - /* - dc.Clear() ; - wxRect rect(0,0,m_width,m_height) ; - dc.SetFont(*wxSMALL_FONT) ; - - dc.DrawRectangle(rect) ; - */ - if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) && - ( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) - || GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) ) - { - dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; - } - else - { - dc.SetTextForeground( GetForegroundColour() ) ; - } - - wxString paragraph; - size_t i = 0 ; - wxString text = m_label; - int y = 0 ; - while (i < text.Length()) - { - - if (text[i] == 13 || text[i] == 10) - { - DrawParagraph(dc, paragraph,y); - paragraph = wxEmptyString ; - } - else - { - paragraph += text[i]; - } - ++i; - } - if (paragraph.Length() > 0) - DrawParagraph(dc, paragraph,y); -} - -void wxStaticText::OnPaint( wxPaintEvent & WXUNUSED(event) ) -{ - wxPaintDC dc(this); - OnDraw( dc ) ; -} - -wxSize wxStaticText::DoGetBestSize() const -{ - int widthTextMax = 0, widthLine, - heightTextTotal = 0, heightLineDefault = 0, heightLine = 0; - - wxString curLine; - for ( const wxChar *pc = m_label; ; pc++ ) - { - if ( *pc == wxT('\n') || *pc == wxT('\r') || *pc == wxT('\0') ) - { - if ( !curLine ) - { - // we can't use GetTextExtent - it will return 0 for both width - // and height and an empty line should count in height - // calculation - if ( !heightLineDefault ) - heightLineDefault = heightLine; - if ( !heightLineDefault ) - GetTextExtent(_T("W"), NULL, &heightLineDefault); - - heightTextTotal += heightLineDefault; - - heightTextTotal++; // FIXME: why is this necessary? - } - else - { - GetTextExtent(curLine, &widthLine, &heightLine); - if ( widthLine > widthTextMax ) - widthTextMax = widthLine; - heightTextTotal += heightLine; - - heightTextTotal++; // FIXME: why is this necessary? - } - - if ( *pc == wxT('\n') || *pc == wxT('\r')) { - curLine.Empty(); - } - else { - // the end of string - break; - } - } - else { - curLine += *pc; - } - } - - return wxSize(widthTextMax, heightTextTotal); -} - -void wxStaticText::SetLabel(const wxString& st ) -{ - SetTitle( st ) ; - m_label = st ; - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - { - // temporary fix until layout measurement and drawing are in synch again - Refresh() ; - SetSize( GetBestSize() ) ; - } - Refresh() ; - Update() ; -} - -bool wxStaticText::SetFont(const wxFont& font) -{ - bool ret = wxControl::SetFont(font); - - if ( ret ) - { - // adjust the size of the window to fit to the label unless autoresizing is - // disabled - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - { - // temporary fix until layout measurement and drawing are in synch again - Refresh() ; - SetSize( GetBestSize() ); - } - } - - return ret; -} diff --git a/src/mac/classic/tabctrl.cpp b/src/mac/classic/tabctrl.cpp deleted file mode 100644 index f879b78447..0000000000 --- a/src/mac/classic/tabctrl.cpp +++ /dev/null @@ -1,206 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.cpp -// Purpose: wxTabCtrl -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "tabctrl.h" -#endif - -#include "wx/defs.h" - -#include "wx/control.h" -#include "wx/tabctrl.h" -#include "wx/mac/uma.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) -END_EVENT_TABLE() -#endif - -wxTabCtrl::wxTabCtrl() -{ - m_imageList = NULL; -} - -bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - m_imageList = NULL; - - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlTabSmallProc , (long) this ) ; - - MacPostControlCreate() ; - return TRUE ; -} - -wxTabCtrl::~wxTabCtrl() -{ -} - -void wxTabCtrl::Command(wxCommandEvent& event) -{ -} - -// Delete all items -bool wxTabCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -// Delete an item -bool wxTabCtrl::DeleteItem(int item) -{ - // TODO - return FALSE; -} - -// Get the selection -int wxTabCtrl::GetSelection() const -{ - // TODO - return 0; -} - -// Get the tab with the current keyboard focus -int wxTabCtrl::GetCurFocus() const -{ - // TODO - return 0; -} - -// Get the associated image list -wxImageList* wxTabCtrl::GetImageList() const -{ - return m_imageList; -} - -// Get the number of items -int wxTabCtrl::GetItemCount() const -{ - // TODO - return 0; -} - -// Get the rect corresponding to the tab -bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const -{ - // TODO - return FALSE; -} - -// Get the number of rows -int wxTabCtrl::GetRowCount() const -{ - // TODO - return 0; -} - -// Get the item text -wxString wxTabCtrl::GetItemText(int item) const -{ - // TODO - return wxEmptyString; -} - -// Get the item image -int wxTabCtrl::GetItemImage(int item) const -{ - // TODO - return 0; -} - -// Get the item data -void* wxTabCtrl::GetItemData(int item) const -{ - // TODO - return NULL; -} - -// Hit test -int wxTabCtrl::HitTest(const wxPoint& pt, long& flags) -{ - // TODO - return 0; -} - -// Insert an item -bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data) -{ - // TODO - return FALSE; -} - -// Set the selection -int wxTabCtrl::SetSelection(int item) -{ - // TODO - return 0; -} - -// Set the image list -void wxTabCtrl::SetImageList(wxImageList* imageList) -{ - // TODO -} - -// Set the text for an item -bool wxTabCtrl::SetItemText(int item, const wxString& text) -{ - // TODO - return FALSE; -} - -// Set the image for an item -bool wxTabCtrl::SetItemImage(int item, int image) -{ - // TODO - return FALSE; -} - -// Set the data for an item -bool wxTabCtrl::SetItemData(int item, void* data) -{ - // TODO - return FALSE; -} - -// Set the size for a fixed-width tab control -void wxTabCtrl::SetItemSize(const wxSize& size) -{ - // TODO -} - -// Set the padding between tabs -void wxTabCtrl::SetPadding(const wxSize& padding) -{ - // TODO -} - -// Tab event -IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) - -wxTabEvent::wxTabEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ -} - diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp deleted file mode 100644 index 2b03417c0f..0000000000 --- a/src/mac/classic/textctrl.cpp +++ /dev/null @@ -1,1810 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp -// Purpose: wxTextCtrl -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "textctrl.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_TEXTCTRL - -#ifdef __DARWIN__ - #include - #include -#else - #include -#endif - -#include "wx/msgdlg.h" - -#if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif -#endif - -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/button.h" -#include "wx/toplevel.h" -#include "wx/textctrl.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/settings.h" -#include "wx/filefn.h" -#include "wx/utils.h" - -#if defined(__BORLANDC__) && !defined(__WIN32__) - #include -#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__DARWIN__) - #include -#endif - -#ifndef __DARWIN__ -#include -#endif -#include -#include -#include -#include -#include "wx/mac/uma.h" - -#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL - -extern wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ; - -// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon -// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the -// moment is to avoid setting the true focus on the control, the proper solution at the end would be to have -// an alternate path for carbon key events that routes automatically into the same wx flow of events - -/* part codes */ - -/* kmUPTextPart is the part code we return to indicate the user has clicked - in the text area of our control */ -#define kmUPTextPart 1 - -/* kmUPScrollPart is the part code we return to indicate the user has clicked - in the scroll bar part of the control. */ -#define kmUPScrollPart 2 - - -/* routines for using existing user pane controls. - These routines are useful for cases where you would like to use an - existing user pane control in, say, a dialog window as a scrolling - text edit field.*/ - -/* mUPOpenControl initializes a user pane control so it will be drawn - and will behave as a scrolling text edit field inside of a window. - This routine performs all of the initialization steps necessary, - except it does not create the user pane control itself. theControl - should refer to a user pane control that you have either created - yourself or extracted from a dialog's control heirarchy using - the GetDialogItemAsControl routine. */ -OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle); - -/* Utility Routines */ - -enum { - kShiftKeyCode = 56 -}; - -/* kUserClickedToFocusPart is a part code we pass to the SetKeyboardFocus - routine. In our focus switching routine this part code is understood - as meaning 'the user has clicked in the control and we need to switch - the current focus to ourselves before we can continue'. */ -#define kUserClickedToFocusPart 100 - - -/* kmUPClickScrollDelayTicks is a time measurement in ticks used to - slow the speed of 'auto scrolling' inside of our clickloop routine. - This value prevents the text from wizzzzzing by while the mouse - is being held down inside of the text area. */ -#define kmUPClickScrollDelayTicks 3 - - -/* STPTextPaneVars is a structure used for storing the the mUP Control's - internal variables and state information. A handle to this record is - stored in the pane control's reference value field using the - SetControlReference routine. */ - -typedef struct { - /* OS records referenced */ - TXNObject fTXNRec; /* the txn record */ - TXNFrameID fTXNFrame; /* the txn frame ID */ - ControlHandle fUserPaneRec; /* handle to the user pane control */ - WindowPtr fOwner; /* window containing control */ - GrafPtr fDrawingEnvironment; /* grafport where control is drawn */ - /* flags */ - Boolean fInFocus; /* true while the focus rect is drawn around the control */ - Boolean fIsActive; /* true while the control is drawn in the active state */ - Boolean fTEActive; /* reflects the activation state of the text edit record */ - Boolean fInDialogWindow; /* true if displayed in a dialog window */ - /* calculated locations */ - Rect fRTextArea; /* area where the text is drawn */ - Rect fRFocusOutline; /* rectangle used to draw the focus box */ - Rect fRTextOutline; /* rectangle used to draw the border */ - RgnHandle fTextBackgroundRgn; /* background region for the text, erased before calling TEUpdate */ - /* our focus advance override routine */ - EventHandlerUPP handlerUPP; - EventHandlerRef handlerRef; - bool fMultiline ; -} STPTextPaneVars; - - - - -/* Univerals Procedure Pointer variables used by the - mUP Control. These variables are set up - the first time that mUPOpenControl is called. */ -ControlUserPaneDrawUPP gTPDrawProc = NULL; -ControlUserPaneHitTestUPP gTPHitProc = NULL; -ControlUserPaneTrackingUPP gTPTrackProc = NULL; -ControlUserPaneIdleUPP gTPIdleProc = NULL; -ControlUserPaneKeyDownUPP gTPKeyProc = NULL; -ControlUserPaneActivateUPP gTPActivateProc = NULL; -ControlUserPaneFocusUPP gTPFocusProc = NULL; - -/* TPActivatePaneText activates or deactivates the text edit record - according to the value of setActive. The primary purpose of this - routine is to ensure each call is only made once. */ -static void TPActivatePaneText(STPTextPaneVars **tpvars, Boolean setActive) { - STPTextPaneVars *varsp; - varsp = *tpvars; - if (varsp->fTEActive != setActive) { - - varsp->fTEActive = setActive; - - TXNActivate(varsp->fTXNRec, varsp->fTXNFrame, varsp->fTEActive); - - if (varsp->fInFocus) - TXNFocus( varsp->fTXNRec, varsp->fTEActive); - } -} - - -/* TPFocusPaneText set the focus state for the text record. */ -static void TPFocusPaneText(STPTextPaneVars **tpvars, Boolean setFocus) { - STPTextPaneVars *varsp; - varsp = *tpvars; - if (varsp->fInFocus != setFocus) { - varsp->fInFocus = setFocus; - TXNFocus( varsp->fTXNRec, varsp->fInFocus); - } -} - - -/* TPPaneDrawProc is called to redraw the control and for update events - referring to the control. This routine erases the text area's background, - and redraws the text. This routine assumes the scroll bar has been - redrawn by a call to DrawControls. */ -static pascal void TPPaneDrawProc(ControlRef theControl, ControlPartCode thePart) { - STPTextPaneVars **tpvars, *varsp; - char state; - Rect bounds; - /* set up our globals */ - - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - - /* save the drawing state */ - SetPort((**tpvars).fDrawingEnvironment); - /* verify our boundary */ - GetControlBounds(theControl, &bounds); - - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - if ( ! EqualRect(&bounds, &varsp->fRFocusOutline) ) { - // scrollbar is on the border, we add one - Rect oldbounds = varsp->fRFocusOutline ; - InsetRect( &oldbounds , -1 , -1 ) ; - - if ( IsControlVisible( theControl ) ) - InvalWindowRect( GetControlOwner( theControl ) , &oldbounds ) ; - SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , - bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); - RectRgn(varsp->fTextBackgroundRgn, &varsp->fRTextOutline); - if ( IsControlVisible( theControl ) ) - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top, varsp->fRTextArea.left, - varsp->fRTextArea.bottom, varsp->fRTextArea.right, varsp->fTXNFrame); - else - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 30000 , varsp->fRTextArea.left + 30000 , - varsp->fRTextArea.bottom + 30000 , varsp->fRTextArea.right + 30000 , varsp->fTXNFrame); - - } - - if ( IsControlVisible( theControl ) ) - { - /* update the text region */ - RGBColor white = { 65535 , 65535 , 65535 } ; - RGBBackColor( &white ) ; - EraseRgn(varsp->fTextBackgroundRgn); - TXNDraw(varsp->fTXNRec, NULL); - /* restore the drawing environment */ - /* draw the text frame and focus frame (if necessary) */ - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - if ((**tpvars).fIsActive && varsp->fInFocus) - DrawThemeFocusRect(&varsp->fRFocusOutline, true); - /* release our globals */ - HSetState((Handle) tpvars, state); - } - } -} - - -/* TPPaneHitTestProc is called when the control manager would - like to determine what part of the control the mouse resides over. - We also call this routine from our tracking proc to determine how - to handle mouse clicks. */ -static pascal ControlPartCode TPPaneHitTestProc(ControlHandle theControl, Point where) { - STPTextPaneVars **tpvars; - ControlPartCode result; - char state; - /* set up our locals and lock down our globals*/ - result = 0; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl) ) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - /* find the region where we clicked */ - if (PtInRect(where, &(**tpvars).fRTextArea)) { - result = kmUPTextPart; - } else result = 0; - /* release oure globals */ - HSetState((Handle) tpvars, state); - } - return result; -} - - - - - -/* TPPaneTrackingProc is called when the mouse is being held down - over our control. This routine handles clicks in the text area - and in the scroll bar. */ -static pascal ControlPartCode TPPaneTrackingProc(ControlHandle theControl, Point startPt, ControlActionUPP actionProc) { - STPTextPaneVars **tpvars, *varsp; - char state; - ControlPartCode partCodeResult; - /* make sure we have some variables... */ - partCodeResult = 0; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl ) ) { - /* lock 'em down */ - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* we don't do any of these functions unless we're in focus */ - if ( ! varsp->fInFocus) { - WindowPtr owner; - owner = GetControlOwner(theControl); - ClearKeyboardFocus(owner); - SetKeyboardFocus(owner, theControl, kUserClickedToFocusPart); - } - /* find the location for the click */ - switch (TPPaneHitTestProc(theControl, startPt)) { - - /* handle clicks in the text part */ - case kmUPTextPart: - { SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; -#if !TARGET_CARBON - TXNClick( varsp->fTXNRec, (const EventRecord*) wxTheApp->MacGetCurrentEvent()); -#else - EventRecord rec ; - ConvertEventRefToEventRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ; - TXNClick( varsp->fTXNRec, &rec ); -#endif - } - break; - - } - - HSetState((Handle) tpvars, state); - } - return partCodeResult; -} - - -/* TPPaneIdleProc is our user pane idle routine. When our text field - is active and in focus, we use this routine to set the cursor. */ -static pascal void TPPaneIdleProc(ControlHandle theControl) { - STPTextPaneVars **tpvars, *varsp; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL && IsControlVisible( theControl ) ) { - /* if we're not active, then we have nothing to say about the cursor */ - if ((**tpvars).fIsActive) { - char state; - Rect bounds; - Point mousep; - /* lock down the globals */ - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* get the current mouse coordinates (in our window) */ - SetPortWindowPort(GetControlOwner(theControl)); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - GetMouse(&mousep); - /* there's a 'focus thing' and an 'unfocused thing' */ - if (varsp->fInFocus) { - /* flash the cursor */ - SetPort((**tpvars).fDrawingEnvironment); - TXNIdle(varsp->fTXNRec); - /* set the cursor */ - if (PtInRect(mousep, &varsp->fRTextArea)) { - RgnHandle theRgn; - RectRgn((theRgn = NewRgn()), &varsp->fRTextArea); - TXNAdjustCursor(varsp->fTXNRec, theRgn); - DisposeRgn(theRgn); - } - else - { - // SetThemeCursor(kThemeArrowCursor); - } - } else { - /* if it's in our bounds, set the cursor */ - GetControlBounds(theControl, &bounds); - if (PtInRect(mousep, &bounds)) - { - // SetThemeCursor(kThemeArrowCursor); - } - } - - HSetState((Handle) tpvars, state); - } - } -} - - -/* TPPaneKeyDownProc is called whenever a keydown event is directed - at our control. Here, we direct the keydown event to the text - edit record and redraw the scroll bar and text field as appropriate. */ -static pascal ControlPartCode TPPaneKeyDownProc(ControlHandle theControl, - SInt16 keyCode, SInt16 charCode, SInt16 modifiers) { - STPTextPaneVars **tpvars; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - if ((**tpvars).fInFocus) { - /* turn autoscrolling on and send the key event to text edit */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - EventRecord ev ; - memset( &ev , 0 , sizeof( ev ) ) ; - ev.what = keyDown ; - ev.modifiers = modifiers ; - ev.message = (( keyCode << 8 ) & keyCodeMask ) + ( charCode & charCodeMask ) ; - TXNKeyDown( (**tpvars).fTXNRec, &ev); - } - } - return kControlEntireControl; -} - - -/* TPPaneActivateProc is called when the window containing - the user pane control receives activate events. Here, we redraw - the control and it's text as necessary for the activation state. */ -static pascal void TPPaneActivateProc(ControlHandle theControl, Boolean activating) { - Rect bounds; - STPTextPaneVars **tpvars, *varsp; - char state; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* de/activate the text edit record */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - GetControlBounds(theControl, &bounds); - varsp->fIsActive = activating; - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* redraw the frame */ - if ( IsControlVisible( theControl ) ) - { - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - if (varsp->fInFocus) - DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fIsActive); - } - HSetState((Handle) tpvars, state); - } -} - - -/* TPPaneFocusProc is called when every the focus changes to or - from our control. Herein, switch the focus appropriately - according to the parameters and redraw the control as - necessary. */ -static pascal ControlPartCode TPPaneFocusProc(ControlHandle theControl, ControlFocusPart action) { - ControlPartCode focusResult; - STPTextPaneVars **tpvars, *varsp; - char state; - /* set up locals */ - focusResult = kControlFocusNoPart; - tpvars = (STPTextPaneVars **) GetControlReference(theControl); - if (tpvars != NULL ) { - state = HGetState((Handle) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* if kControlFocusPrevPart and kControlFocusNextPart are received when the user is - tabbing forwards (or shift tabbing backwards) through the items in the dialog, - and kControlFocusNextPart will be received. When the user clicks in our field - and it is not the current focus, then the constant kUserClickedToFocusPart will - be received. The constant kControlFocusNoPart will be received when our control - is the current focus and the user clicks in another control. In your focus routine, - you should respond to these codes as follows: - - kControlFocusNoPart - turn off focus and return kControlFocusNoPart. redraw - the control and the focus rectangle as necessary. - - kControlFocusPrevPart or kControlFocusNextPart - toggle focus on or off - depending on its current state. redraw the control and the focus rectangle - as appropriate for the new focus state. If the focus state is 'off', return the constant - kControlFocusNoPart, otherwise return a non-zero part code. - kUserClickedToFocusPart - is a constant defined for this example. You should - define your own value for handling click-to-focus type events. */ - /* calculate the next highlight state */ - switch (action) { - default: - case kControlFocusNoPart: - TPFocusPaneText(tpvars, false); - focusResult = kControlFocusNoPart; - break; - case kUserClickedToFocusPart: - TPFocusPaneText(tpvars, true); - focusResult = 1; - break; - case kControlFocusPrevPart: - case kControlFocusNextPart: - TPFocusPaneText(tpvars, ( ! varsp->fInFocus)); - focusResult = varsp->fInFocus ? 1 : kControlFocusNoPart; - break; - } - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* redraw the text fram and focus rectangle to indicate the - new focus state */ - if ( IsControlVisible( theControl ) ) - { - /* save the drawing state */ - SetPort((**tpvars).fDrawingEnvironment); - wxMacWindowClipper clipper( wxFindControlFromMacControl(theControl ) ) ; - DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive); - DrawThemeFocusRect(&varsp->fRFocusOutline, varsp->fIsActive && varsp->fInFocus); - } - /* done */ - HSetState((Handle) tpvars, state); - } - return focusResult; -} - - -/* mUPOpenControl initializes a user pane control so it will be drawn - and will behave as a scrolling text edit field inside of a window. - This routine performs all of the initialization steps necessary, - except it does not create the user pane control itself. theControl - should refer to a user pane control that you have either created - yourself or extracted from a dialog's control heirarchy using - the GetDialogItemAsControl routine. */ -OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) -{ - Rect bounds; - WindowRef theWindow; - STPTextPaneVars **tpvars, *varsp; - OSStatus err = noErr ; - RGBColor rgbWhite = {0xFFFF, 0xFFFF, 0xFFFF}; - TXNBackground tback; - - /* set up our globals */ - if (gTPDrawProc == NULL) gTPDrawProc = NewControlUserPaneDrawUPP(TPPaneDrawProc); - if (gTPHitProc == NULL) gTPHitProc = NewControlUserPaneHitTestUPP(TPPaneHitTestProc); - if (gTPTrackProc == NULL) gTPTrackProc = NewControlUserPaneTrackingUPP(TPPaneTrackingProc); - if (gTPIdleProc == NULL) gTPIdleProc = NewControlUserPaneIdleUPP(TPPaneIdleProc); - if (gTPKeyProc == NULL) gTPKeyProc = NewControlUserPaneKeyDownUPP(TPPaneKeyDownProc); - if (gTPActivateProc == NULL) gTPActivateProc = NewControlUserPaneActivateUPP(TPPaneActivateProc); - if (gTPFocusProc == NULL) gTPFocusProc = NewControlUserPaneFocusUPP(TPPaneFocusProc); - - /* allocate our private storage */ - tpvars = (STPTextPaneVars **) NewHandleClear(sizeof(STPTextPaneVars)); - SetControlReference(theControl, (long) tpvars); - HLock((Handle) tpvars); - varsp = *tpvars; - /* set the initial settings for our private data */ - varsp->fMultiline = wxStyle & wxTE_MULTILINE ; - varsp->fInFocus = false; - varsp->fIsActive = true; - varsp->fTEActive = true; // in order to get a deactivate - varsp->fUserPaneRec = theControl; - theWindow = varsp->fOwner = GetControlOwner(theControl); - - varsp->fDrawingEnvironment = (GrafPtr) GetWindowPort(theWindow); - - varsp->fInDialogWindow = ( GetWindowKind(varsp->fOwner) == kDialogWindowKind ); - /* set up the user pane procedures */ - SetControlData(theControl, kControlEntireControl, kControlUserPaneDrawProcTag, sizeof(gTPDrawProc), &gTPDrawProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneHitTestProcTag, sizeof(gTPHitProc), &gTPHitProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneTrackingProcTag, sizeof(gTPTrackProc), &gTPTrackProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneIdleProcTag, sizeof(gTPIdleProc), &gTPIdleProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneKeyDownProcTag, sizeof(gTPKeyProc), &gTPKeyProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneActivateProcTag, sizeof(gTPActivateProc), &gTPActivateProc); - SetControlData(theControl, kControlEntireControl, kControlUserPaneFocusProcTag, sizeof(gTPFocusProc), &gTPFocusProc); - /* calculate the rectangles used by the control */ - GetControlBounds(theControl, &bounds); - SetRect(&varsp->fRFocusOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextOutline, bounds.left, bounds.top, bounds.right, bounds.bottom); - SetRect(&varsp->fRTextArea, bounds.left + 2 , bounds.top + (varsp->fMultiline ? 0 : 2) , - bounds.right - (varsp->fMultiline ? 0 : 2), bounds.bottom - (varsp->fMultiline ? 0 : 2)); - /* calculate the background region for the text. In this case, it's kindof - and irregular region because we're setting the scroll bar a little ways inside - of the text area. */ - RectRgn((varsp->fTextBackgroundRgn = NewRgn()), &varsp->fRTextOutline); - - /* set up the drawing environment */ - SetPort(varsp->fDrawingEnvironment); - - /* create the new edit field */ - - TXNFrameOptions frameOptions = - kTXNDontDrawCaretWhenInactiveMask ; - if ( ! ( wxStyle & wxTE_NOHIDESEL ) ) - frameOptions |= kTXNDontDrawSelectionWhenInactiveMask ; - - if ( wxStyle & wxTE_MULTILINE ) - { - if ( ! ( wxStyle & wxTE_DONTWRAP ) ) - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; - else - { - frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ; - frameOptions |= kTXNWantHScrollBarMask ; - } - - if ( !(wxStyle & wxTE_NO_VSCROLL ) ) - frameOptions |= kTXNWantVScrollBarMask ; - } - else - frameOptions |= kTXNSingleLineOnlyMask ; - - if ( wxStyle & wxTE_READONLY ) - frameOptions |= kTXNReadOnlyMask ; - - TXNNewObject(NULL, varsp->fOwner, &varsp->fRTextArea, - frameOptions , - kTXNTextEditStyleFrameType, - kTXNTextensionFile, - kTXNSystemDefaultEncoding, - &varsp->fTXNRec, &varsp->fTXNFrame, (TXNObjectRefcon) tpvars); - - if ( !IsControlVisible( theControl ) ) - TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 30000 , varsp->fRTextArea.left + 30000 , - varsp->fRTextArea.bottom + 30000 , varsp->fRTextArea.right + 30000 , varsp->fTXNFrame); - - - if ( (wxStyle & wxTE_MULTILINE) && (wxStyle & wxTE_DONTWRAP) ) - { - TXNControlTag tag = kTXNWordWrapStateTag ; - TXNControlData dat ; - dat.uValue = kTXNNoAutoWrap ; - TXNSetTXNObjectControls( varsp->fTXNRec , false , 1 , &tag , &dat ) ; - } - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - - TXNTypeAttributes typeAttr[] = - { - { kTXNQDFontNameAttribute , kTXNQDFontNameAttributeSize , { (void*) fontName } } , - { kTXNQDFontSizeAttribute , kTXNFontSizeAttributeSize , { (void*) (fontSize << 16) } } , - { kTXNQDFontStyleAttribute , kTXNQDFontStyleAttributeSize , { (void*) normal } } , - } ; - - err = TXNSetTypeAttributes (varsp->fTXNRec, sizeof( typeAttr ) / sizeof(TXNTypeAttributes) , typeAttr, - kTXNStartOffset, - kTXNEndOffset); - /* set the field's background */ - - tback.bgType = kTXNBackgroundTypeRGB; - tback.bg.color = rgbWhite; - TXNSetBackground( varsp->fTXNRec, &tback); - - /* unlock our storage */ - HUnlock((Handle) tpvars); - /* perform final activations and setup for our text field. Here, - we assume that the window is going to be the 'active' window. */ - TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus); - /* all done */ - return err; -} - - - - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) - EVT_DROP_FILES(wxTextCtrl::OnDropFiles) - EVT_CHAR(wxTextCtrl::OnChar) - EVT_MENU(wxID_CUT, wxTextCtrl::OnCut) - EVT_MENU(wxID_COPY, wxTextCtrl::OnCopy) - EVT_MENU(wxID_PASTE, wxTextCtrl::OnPaste) - EVT_MENU(wxID_UNDO, wxTextCtrl::OnUndo) - EVT_MENU(wxID_REDO, wxTextCtrl::OnRedo) - - EVT_UPDATE_UI(wxID_CUT, wxTextCtrl::OnUpdateCut) - EVT_UPDATE_UI(wxID_COPY, wxTextCtrl::OnUpdateCopy) - EVT_UPDATE_UI(wxID_PASTE, wxTextCtrl::OnUpdatePaste) - EVT_UPDATE_UI(wxID_UNDO, wxTextCtrl::OnUpdateUndo) - EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo) -END_EVENT_TABLE() -#endif - -static void SetTXNData( TXNObject txn , const wxString& st , TXNOffset start , TXNOffset end ) -{ -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - size_t len = st.Len() ; - TXNSetData( txn , kTXNUnicodeTextData, (void*)st.wc_str(), len * 2, - start, end); -#else - wxMBConvUTF16BE converter ; - ByteCount byteBufferLen = converter.WC2MB( NULL , st.wc_str() , 0 ) ; - UniChar *unibuf = (UniChar*) malloc(byteBufferLen) ; - converter.WC2MB( (char*) unibuf , st.wc_str() , byteBufferLen ) ; - TXNSetData( txn , kTXNUnicodeTextData, (void*)unibuf, byteBufferLen , - start, end); - free( unibuf ) ; -#endif -#else - wxCharBuffer text = st.mb_str(wxConvLocal) ; - TXNSetData( txn , kTXNTextData, (void*)text.data(), strlen( text ) , - start, end); -#endif -} - -// Text item -void wxTextCtrl::Init() -{ - m_macTE = NULL ; - m_macTXN = NULL ; - m_macTXNvars = NULL ; - m_macUsesTXN = false ; - - m_editable = true ; - m_dirty = false; - - m_maxLength = TE_UNLIMITED_LENGTH ; -} - -wxTextCtrl::~wxTextCtrl() -{ - if ( m_macUsesTXN ) - { - SetControlReference((ControlHandle)m_macControl, 0) ; - TXNDeleteObject((TXNObject)m_macTXN); - /* delete our private storage */ - DisposeHandle((Handle) m_macTXNvars); - /* zero the control reference */ - } -} - -const short kVerticalMargin = 2 ; -const short kHorizontalMargin = 2 ; - -bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& str, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_macTE = NULL ; - m_macTXN = NULL ; - m_macTXNvars = NULL ; - m_macUsesTXN = false ; - m_editable = true ; - - m_macUsesTXN = ! (style & wxTE_PASSWORD ) ; - - m_macUsesTXN &= (TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress) ; - - // base initialization - if ( !wxTextCtrlBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) - return FALSE; - - wxSize mySize = size ; - if ( m_macUsesTXN ) - { - m_macHorizontalBorder = 5 ; // additional pixels around the real control - m_macVerticalBorder = 3 ; - } - else - { - m_macHorizontalBorder = 5 ; // additional pixels around the real control - m_macVerticalBorder = 5 ; - } - - - Rect bounds ; - Str255 title ; - /* - if ( mySize.y == -1 ) - { - mySize.y = 13 ; - if ( m_windowStyle & wxTE_MULTILINE ) - mySize.y *= 5 ; - - mySize.y += 2 * m_macVerticalBorder ; - } - */ - MacPreControlCreate( parent , id , wxEmptyString , pos , mySize ,style, validator , name , &bounds , title ) ; - - if ( m_windowStyle & wxTE_MULTILINE ) - { - wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER), - wxT("wxTE_PROCESS_ENTER style is ignored for multiline text controls (they always process it)") ); - - m_windowStyle |= wxTE_PROCESS_ENTER; - } - - if ( m_windowStyle & wxTE_READONLY) - { - m_editable = FALSE ; - } - - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , false , 0 , 0 , 1, - (style & wxTE_PASSWORD) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ; - long size ; - ::GetControlData((ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*)((TEHandle *)&m_macTE) , &size ) ; - - } - else - { - short featurSet; - - featurSet = kControlSupportsEmbedding | kControlSupportsFocus | kControlWantsIdle - | kControlWantsActivate | kControlHandlesTracking | kControlHasSpecialBackground - | kControlGetsFocusOnClick | kControlSupportsLiveFeedback; - /* create the control */ - m_macControl = NewControl(MAC_WXHWND(parent->MacGetRootWindow()), &bounds, "\p", false , featurSet, 0, featurSet, kControlUserPaneProc, 0); - /* set up the mUP specific features and data */ - mUPOpenControl((ControlHandle) m_macControl, m_windowStyle ); - } - MacPostControlCreate() ; - - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ; - } - else - { - STPTextPaneVars **tpvars; - /* set up locals */ - tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl); - /* set the text in the record */ - m_macTXN = (**tpvars).fTXNRec ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNStartOffset, kTXNEndOffset ) ; - m_macTXNvars = tpvars ; - m_macUsesTXN = true ; - TXNSetSelection( (TXNObject) m_macTXN, 0, 0); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - } - - return TRUE; -} - -wxString wxTextCtrl::GetValue() const -{ - Size actualSize = 0; - wxString result ; - OSStatus err ; - if ( !m_macUsesTXN ) - { - err = ::GetControlDataSize((ControlHandle) m_macControl, 0, - ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, &actualSize ) ; - - if ( err ) - return wxEmptyString ; - - if ( actualSize > 0 ) - { - wxCharBuffer buf(actualSize) ; - ::GetControlData( (ControlHandle) m_macControl, 0, - ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, - actualSize , buf.data() , &actualSize ) ; - result = wxString( buf , wxConvLocal) ; - } - } - else - { -#if wxUSE_UNICODE - Handle theText ; - err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNUnicodeTextData ); - // all done - if ( err ) - { - actualSize = 0 ; - } - else - { - actualSize = GetHandleSize( theText ) / sizeof( UniChar) ; - if ( actualSize > 0 ) - { - wxChar *ptr = result.GetWriteBuf(actualSize*sizeof(wxChar)) ; -#if SIZEOF_WCHAR_T == 2 - wxStrncpy( ptr , (wxChar*) *theText , actualSize ) ; -#else - wxMBConvUTF16BE converter ; - HLock( theText ) ; - converter.MB2WC( ptr , (const char*)*theText , actualSize ) ; - HUnlock( theText ) ; -#endif - ptr[actualSize] = 0 ; - result.UngetWriteBuf( actualSize *sizeof(wxChar) ) ; - } - DisposeHandle( theText ) ; - } -#else - Handle theText ; - err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData ); - // all done - if ( err ) - { - actualSize = 0 ; - } - else - { - actualSize = GetHandleSize( theText ) ; - if ( actualSize > 0 ) - { - HLock( theText ) ; - result = wxString( *theText , wxConvLocal , actualSize ) ; - HUnlock( theText ) ; - } - DisposeHandle( theText ) ; - } -#endif - } - wxMacConvertNewlines10To13( &result ) ; - return result ; -} - -void wxTextCtrl::GetSelection(long* from, long* to) const -{ - if ( !m_macUsesTXN ) - { - *from = (**((TEHandle) m_macTE)).selStart; - *to = (**((TEHandle) m_macTE)).selEnd; - } - else - { - TXNGetSelection( (TXNObject) m_macTXN , (TXNOffset*) from , (TXNOffset*) to ) ; - } -} - -void wxTextCtrl::SetValue(const wxString& str) -{ - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNStartOffset, kTXNEndOffset ) ; - TXNSetSelection( (TXNObject) m_macTXN, 0, 0); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - if ( !formerEditable ) - SetEditable(formerEditable) ; - } - MacRedrawControl() ; -} - -void wxTextCtrl::SetMaxLength(unsigned long len) -{ - m_maxLength = len ; -} - -bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) -{ - if ( m_macUsesTXN ) - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNTypeAttributes typeAttr[4] ; - Str255 fontName = "\pMonaco" ; - SInt16 fontSize = 12 ; - Style fontStyle = normal ; - RGBColor color ; - int attrCounter = 0 ; - if ( style.HasFont() ) - { - const wxFont &font = style.GetFont() ; - wxMacStringToPascal( font.GetFaceName() , fontName ) ; - fontSize = font.GetPointSize() ; - if ( font.GetUnderlined() ) - fontStyle |= underline ; - if ( font.GetWeight() == wxBOLD ) - fontStyle |= bold ; - if ( font.GetStyle() == wxITALIC ) - fontStyle |= italic ; - - typeAttr[attrCounter].tag = kTXNQDFontNameAttribute ; - typeAttr[attrCounter].size = kTXNQDFontNameAttributeSize ; - typeAttr[attrCounter].data.dataPtr = (void*) fontName ; - typeAttr[attrCounter+1].tag = kTXNQDFontSizeAttribute ; - typeAttr[attrCounter+1].size = kTXNFontSizeAttributeSize ; - typeAttr[attrCounter+1].data.dataValue = (fontSize << 16) ; - typeAttr[attrCounter+2].tag = kTXNQDFontStyleAttribute ; - typeAttr[attrCounter+2].size = kTXNQDFontStyleAttributeSize ; - typeAttr[attrCounter+2].data.dataValue = fontStyle ; - attrCounter += 3 ; - - } - if ( style.HasTextColour() ) - { - typeAttr[attrCounter].tag = kTXNQDFontColorAttribute ; - typeAttr[attrCounter].size = kTXNQDFontColorAttributeSize ; - typeAttr[attrCounter].data.dataPtr = (void*) &color ; - color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ; - attrCounter += 1 ; - } - - if ( attrCounter > 0 ) - { -#ifdef __WXDEBUG__ - OSStatus status = -#endif // __WXDEBUG__ - TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr, start,end); - wxASSERT_MSG( status == noErr , wxT("Couldn't set text attributes") ) ; - } - if ( !formerEditable ) - SetEditable(formerEditable) ; - } - return TRUE ; -} - -bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) -{ - wxTextCtrlBase::SetDefaultStyle( style ) ; - SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ; - return TRUE ; -} - -// Clipboard operations -void wxTextCtrl::Copy() -{ - if (CanCopy()) - { - if ( !m_macUsesTXN ) - { - TECopy( ((TEHandle) m_macTE) ) ; - ClearCurrentScrap(); - TEToScrap() ; - MacRedrawControl() ; - } - else - { - ClearCurrentScrap(); - TXNCopy((TXNObject)m_macTXN); - TXNConvertToPublicScrap(); - } - } -} - -void wxTextCtrl::Cut() -{ - if (CanCut()) - { - if ( !m_macUsesTXN ) - { - TECut( ((TEHandle) m_macTE) ) ; - ClearCurrentScrap(); - TEToScrap() ; - MacRedrawControl() ; - } - else - { - ClearCurrentScrap(); - TXNCut((TXNObject)m_macTXN); - TXNConvertToPublicScrap(); - } - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString( GetValue() ) ; - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxTextCtrl::Paste() -{ - if (CanPaste()) - { - if ( !m_macUsesTXN ) - { - TEFromScrap() ; - TEPaste( (TEHandle) m_macTE ) ; - MacRedrawControl() ; - } - else - { - TXNConvertFromPublicScrap(); - TXNPaste((TXNObject)m_macTXN); - SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ; - } - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString( GetValue() ) ; - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } -} - -bool wxTextCtrl::CanCopy() const -{ - // Can copy if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to); -} - -bool wxTextCtrl::CanCut() const -{ - if ( !IsEditable() ) - { - return false ; - } - // Can cut if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to); -} - -bool wxTextCtrl::CanPaste() const -{ - if (!IsEditable()) - return FALSE; - -#if TARGET_CARBON - OSStatus err = noErr; - ScrapRef scrapRef; - - err = GetCurrentScrap( &scrapRef ); - if ( err != noTypeErr && err != memFullErr ) - { - ScrapFlavorFlags flavorFlags; - Size byteCount; - - if (( err = GetScrapFlavorFlags( scrapRef, 'TEXT', &flavorFlags )) == noErr) - { - if (( err = GetScrapFlavorSize( scrapRef, 'TEXT', &byteCount )) == noErr) - { - return TRUE ; - } - } - } - return FALSE; - -#else - long offset ; - if ( GetScrap( NULL , 'TEXT' , &offset ) > 0 ) - { - return TRUE ; - } -#endif - return FALSE ; -} - -void wxTextCtrl::SetEditable(bool editable) -{ - if ( editable != m_editable ) - { - m_editable = editable ; - if ( !m_macUsesTXN ) - { - if ( editable ) - UMAActivateControl( (ControlHandle) m_macControl ) ; - else - UMADeactivateControl((ControlHandle) m_macControl ) ; - } - else - { - TXNControlTag tag[] = { kTXNIOPrivilegesTag } ; - TXNControlData data[] = { { editable ? kTXNReadWrite : kTXNReadOnly } } ; - TXNSetTXNObjectControls( (TXNObject) m_macTXN , false , sizeof(tag) / sizeof (TXNControlTag) , tag , data ) ; - } - } -} - -void wxTextCtrl::SetInsertionPoint(long pos) -{ - SetSelection( pos , pos ) ; -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - long pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxTextCtrl::GetInsertionPoint() const -{ - long begin,end ; - GetSelection( &begin , &end ) ; - return begin ; -} - -long wxTextCtrl::GetLastPosition() const -{ - if ( !m_macUsesTXN ) - { - return (**((TEHandle) m_macTE)).teLength ; - } - else - { - Handle theText ; - long actualsize ; - OSErr err = TXNGetDataEncoded( (TXNObject) m_macTXN, kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData ); - /* all done */ - if ( err ) - { - actualsize = 0 ; - } - else - { - actualsize = GetHandleSize( theText ) ; - DisposeHandle( theText ) ; - } - return actualsize ; - } -} - -void wxTextCtrl::Replace(long from, long to, const wxString& str) -{ - wxString value = str ; - wxMacConvertNewlines13To10( &value ) ; - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - - selection.selStart = from ; - selection.selEnd = to ; - ::SetControlData((ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - TESetSelect( from , to , ((TEHandle) m_macTE) ) ; - TEDelete( ((TEHandle) m_macTE) ) ; - TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ; - TXNClear( ((TXNObject) m_macTXN) ) ; - SetTXNData( (TXNObject) m_macTXN , str , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - Refresh() ; -} - -void wxTextCtrl::Remove(long from, long to) -{ - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - - selection.selStart = from ; - selection.selEnd = to ; - ::SetControlData( (ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - TEDelete( ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ; - TXNClear( ((TXNObject) m_macTXN) ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - Refresh() ; -} - -void wxTextCtrl::SetSelection(long from, long to) -{ - if ( !m_macUsesTXN ) - { - ControlEditTextSelectionRec selection ; - if ((from == -1) && (to == -1)) - { - selection.selStart = 0 ; - selection.selEnd = 32767 ; - } - else - { - selection.selStart = from ; - selection.selEnd = to ; - } - - TESetSelect( selection.selStart , selection.selEnd , ((TEHandle) m_macTE) ) ; - ::SetControlData((ControlHandle) m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; - } - else - { - STPTextPaneVars **tpvars; - /* set up our locals */ - tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl); - /* and our drawing environment as the operation - may force a redraw in the text area. */ - SetPort((**tpvars).fDrawingEnvironment); - /* change the selection */ - if ((from == -1) && (to == -1)) - TXNSelectAll((TXNObject) m_macTXN); - else - TXNSetSelection( (**tpvars).fTXNRec, from, to); - TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart); - } -} - -bool wxTextCtrl::LoadFile(const wxString& file) -{ - if ( wxTextCtrlBase::LoadFile(file) ) - { - return TRUE; - } - - return FALSE; -} - -void wxTextCtrl::WriteText(const wxString& str) -{ - wxString st = str ; - wxMacConvertNewlines13To10( &st ) ; - if ( !m_macUsesTXN ) - { - wxCharBuffer text = st.mb_str(wxConvLocal) ; - TEInsert( text , strlen(text) , ((TEHandle) m_macTE) ) ; - } - else - { - bool formerEditable = m_editable ; - if ( !formerEditable ) - SetEditable(true) ; - long start , end , dummy ; - GetSelection( &start , &dummy ) ; - SetTXNData( (TXNObject) m_macTXN , st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ; - GetSelection( &dummy , &end ) ; - SetStyle( start , end , GetDefaultStyle() ) ; - if ( !formerEditable ) - SetEditable( formerEditable ) ; - } - MacRedrawControl() ; -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - SetInsertionPointEnd(); - WriteText(text); -} - -void wxTextCtrl::Clear() -{ - if ( !m_macUsesTXN ) - { - ::SetControlData((ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , 0 , (char*) ((const char*)NULL) ) ; - } - else - { - TXNSetSelection( (TXNObject)m_macTXN , kTXNStartOffset , kTXNEndOffset ) ; - TXNClear((TXNObject)m_macTXN); - } - Refresh() ; -} - -bool wxTextCtrl::IsModified() const -{ - return m_dirty; -} - -bool wxTextCtrl::IsEditable() const -{ - return IsEnabled() && m_editable ; -} - -bool wxTextCtrl::AcceptsFocus() const -{ - // we don't want focus if we can't be edited - return /*IsEditable() && */ wxControl::AcceptsFocus(); -} - -wxSize wxTextCtrl::DoGetBestSize() const -{ - int wText = 100 ; - - int hText; - if ( m_macUsesTXN ) - { - hText = 17 ; - } - else - { - hText = 13 ; - } -/* - int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); - - int wText = DEFAULT_ITEM_WIDTH; - - int hText = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); - - return wxSize(wText, hText); -*/ - if ( m_windowStyle & wxTE_MULTILINE ) - { - hText *= 5 ; - } - hText += 2 * m_macVerticalBorder ; - wText += 2 * m_macHorizontalBorder ; - //else: for single line control everything is ok - return wxSize(wText, hText); -} - -// ---------------------------------------------------------------------------- -// Undo/redo -// ---------------------------------------------------------------------------- - -void wxTextCtrl::Undo() -{ - if (CanUndo()) - { - if ( m_macUsesTXN ) - { - TXNUndo((TXNObject)m_macTXN); - } - } -} - -void wxTextCtrl::Redo() -{ - if (CanRedo()) - { - if ( m_macUsesTXN ) - { - TXNRedo((TXNObject)m_macTXN); - } - } -} - -bool wxTextCtrl::CanUndo() const -{ - if ( !IsEditable() ) - { - return false ; - } - if ( m_macUsesTXN ) - { - return TXNCanUndo((TXNObject)m_macTXN,NULL); - } - return FALSE ; -} - -bool wxTextCtrl::CanRedo() const -{ - if ( !IsEditable() ) - { - return false ; - } - if ( m_macUsesTXN ) - { - return TXNCanRedo((TXNObject)m_macTXN,NULL); - } - return FALSE ; -} - -// Makes modifie or unmodified -void wxTextCtrl::MarkDirty() -{ - m_dirty = true; -} - -void wxTextCtrl::DiscardEdits() -{ - m_dirty = false; -} - -int wxTextCtrl::GetNumberOfLines() const -{ - if ( m_macUsesTXN ) - { - ItemCount lines ; - TXNGetLineCount((TXNObject)m_macTXN, &lines ) ; - return lines ; - } - else - { - wxString content = GetValue() ; - - int count = 1; - for (size_t i = 0; i < content.Length() ; i++) - { - if (content[i] == '\r') count++; - } - return count; - } -} - -long wxTextCtrl::XYToPosition(long x, long y) const -{ - // TODO - return 0; -} - -bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const -{ - return FALSE ; -} - -void wxTextCtrl::ShowPosition(long pos) -{ -#if TARGET_RT_MAC_MACHO && defined(AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER) - if ( m_macUsesTXN ) - { - Point current ; - Point desired ; - TXNOffset selstart , selend ; - TXNGetSelection( (TXNObject) m_macTXN , &selstart , &selend) ; - TXNOffsetToPoint( (TXNObject) m_macTXN, selstart , ¤t); - TXNOffsetToPoint( (TXNObject) m_macTXN, pos , &desired); - //TODO use HIPoints for 10.3 and above - if ( (UInt32) TXNScroll != (UInt32) kUnresolvedCFragSymbolAddress ) - { - OSErr theErr = noErr; - SInt32 dv = desired.v - current.v ; - SInt32 dh = desired.h - current.h ; - TXNShowSelection( (TXNObject) m_macTXN , true ) ; - theErr = TXNScroll( (TXNObject) m_macTXN, kTXNScrollUnitsInPixels , kTXNScrollUnitsInPixels , &dv , &dh ); - wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") ); - } - } -#endif -} - -int wxTextCtrl::GetLineLength(long lineNo) const -{ - // TODO change this if possible to reflect real lines - wxString content = GetValue() ; - - // Find line first - int count = 0; - for (size_t i = 0; i < content.Length() ; i++) - { - if (count == lineNo) - { - // Count chars in line then - count = 0; - for (size_t j = i; j < content.Length(); j++) - { - count++; - if (content[j] == '\n') return count; - } - - return count; - } - if (content[i] == '\n') count++; - } - return 0; -} - -wxString wxTextCtrl::GetLineText(long lineNo) const -{ - // TODO change this if possible to reflect real lines - wxString content = GetValue() ; - - // Find line first - int count = 0; - for (size_t i = 0; i < content.Length() ; i++) - { - if (count == lineNo) - { - // Add chars in line then - wxString tmp; - - for (size_t j = i; j < content.Length(); j++) - { - if (content[j] == '\n') - return tmp; - - tmp += content[j]; - } - - return tmp; - } - if (content[i] == '\n') count++; - } - return wxEmptyString ; -} - -/* - * Text item - */ - -void wxTextCtrl::Command(wxCommandEvent & event) -{ - SetValue (event.GetString()); - ProcessCommand (event); -} - -void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) -{ - // By default, load the first file into the text window. - if (event.GetNumberOfFiles() > 0) - { - LoadFile(event.GetFiles()[0]); - } -} - -void wxTextCtrl::OnChar(wxKeyEvent& event) -{ - int key = event.GetKeyCode() ; - bool eat_key = false ; - - if ( key == 'c' && event.MetaDown() ) - { - if ( CanCopy() ) - Copy() ; - return ; - } - - if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB && - !( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) -/* && key != WXK_PRIOR && key != WXK_NEXT && key != WXK_HOME && key != WXK_END */ - ) - { - // eat it - return ; - } - - // assume that any key not processed yet is going to modify the control - m_dirty = true; - - if ( key == 'v' && event.MetaDown() ) - { - if ( CanPaste() ) - Paste() ; - return ; - } - if ( key == 'x' && event.MetaDown() ) - { - if ( CanCut() ) - Cut() ; - return ; - } - switch ( key ) - { - case WXK_RETURN: - if (m_windowStyle & wxPROCESS_ENTER) - { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); - event.SetEventObject( this ); - event.SetString( GetValue() ); - if ( GetEventHandler()->ProcessEvent(event) ) - return; - } - if ( !(m_windowStyle & wxTE_MULTILINE) ) - { - wxWindow *parent = GetParent(); - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) { - parent = parent->GetParent() ; - } - if ( parent && parent->GetDefaultItem() ) - { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); - if ( def && def->IsEnabled() ) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); - event.SetEventObject(def); - def->Command(event); - return ; - } - } - - // this will make wxWindows eat the ENTER key so that - // we actually prevent line wrapping in a single line - // text control - eat_key = TRUE; - } - - break; - - case WXK_TAB: - // always produce navigation event - even if we process TAB - // ourselves the fact that we got here means that the user code - // decided to skip processing of this TAB - probably to let it - // do its default job. - { - wxNavigationKeyEvent eventNav; - eventNav.SetDirection(!event.ShiftDown()); - eventNav.SetWindowChange(event.ControlDown()); - eventNav.SetEventObject(this); - - if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) ) - return; - - event.Skip() ; - return; - } - break; - } - - if (!eat_key) - { - // perform keystroke handling -#if TARGET_CARBON - if ( m_macUsesTXN && wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL ) - CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ; - else - { - EventRecord rec ; - if ( wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ) - { - EventRecord *ev = &rec ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; - } - } -#else - EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ; - short keycode ; - short keychar ; - keychar = short(ev->message & charCodeMask); - keycode = short(ev->message & keyCodeMask) >> 8 ; - - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; -#endif - } - if ( ( key >= 0x20 && key < WXK_START ) || - key == WXK_RETURN || - key == WXK_DELETE || - key == WXK_BACK) - { - wxCommandEvent event1(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event1.SetString( GetValue() ) ; - event1.SetEventObject( this ); - wxPostEvent(GetEventHandler(),event1); - } -} - -void wxTextCtrl::MacSuperShown( bool show ) -{ - bool former = m_macControlIsShown ; - wxControl::MacSuperShown( show ) ; - if ( (former != m_macControlIsShown) && m_macUsesTXN ) - { - if ( m_macControlIsShown ) - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - else - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - } -} - -bool wxTextCtrl::Show(bool show) -{ - bool former = m_macControlIsShown ; - - bool retval = wxControl::Show( show ) ; - - if ( former != m_macControlIsShown && m_macUsesTXN ) - { - if ( m_macControlIsShown ) - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - else - TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left, - (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame); - } - - return retval ; -} - -// ---------------------------------------------------------------------------- -// standard handlers for standard edit menu events -// ---------------------------------------------------------------------------- - -void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event)) -{ - Cut(); -} - -void wxTextCtrl::OnCopy(wxCommandEvent& WXUNUSED(event)) -{ - Copy(); -} - -void wxTextCtrl::OnPaste(wxCommandEvent& WXUNUSED(event)) -{ - Paste(); -} - -void wxTextCtrl::OnUndo(wxCommandEvent& WXUNUSED(event)) -{ - Undo(); -} - -void wxTextCtrl::OnRedo(wxCommandEvent& WXUNUSED(event)) -{ - Redo(); -} - -void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent& event) -{ - event.Enable( CanCut() ); -} - -void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent& event) -{ - event.Enable( CanCopy() ); -} - -void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent& event) -{ - event.Enable( CanPaste() ); -} - -void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent& event) -{ - event.Enable( CanUndo() ); -} - -void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) -{ - event.Enable( CanRedo() ); -} - -bool wxTextCtrl::MacSetupCursor( const wxPoint& pt ) -{ - if ( m_macUsesTXN ) - return true ; - else - return wxWindow::MacSetupCursor( pt ) ; -} - -#endif - // wxUSE_TEXTCTRL diff --git a/src/mac/classic/tglbtn.cpp b/src/mac/classic/tglbtn.cpp deleted file mode 100644 index aa7ee2bb3e..0000000000 --- a/src/mac/classic/tglbtn.cpp +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/tglbtn.cpp -// Purpose: Definition of the wxToggleButton class, which implements a -// toggle button under wxMac. -// Author: Stefan Csomor -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id$ -// Copyright: (c) 2000 Johnny C. Norris II -// License: Rocketeer license -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declatations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ -#pragma implementation "button.h" -#endif - -#include "wx/defs.h" -#include "wx/tglbtn.h" - -#if wxUSE_TOGGLEBTN - -#include "wx/mac/uma.h" -// Button - -static const int kMacOSXHorizontalBorder = 2 ; -static const int kMacOSXVerticalBorder = 4 ; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToggleButton -// ---------------------------------------------------------------------------- - -// Single check box item -bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - Rect bounds ; - Str255 title ; - - if ( UMAHasAquaLayout() ) - { - m_macHorizontalBorder = kMacOSXHorizontalBorder; - m_macVerticalBorder = kMacOSXVerticalBorder; - } - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , kControlBehaviorToggles , 1, - kControlBevelButtonNormalBevelProc , (long) this ) ; - wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; - - MacPostControlCreate() ; - - return TRUE; -} - -wxSize wxToggleButton::DoGetBestSize() const -{ - int wBtn = 70 ; - int hBtn = 20 ; - - int lBtn = m_label.Length() * 8 + 12 ; - if (lBtn > wBtn) - wBtn = lBtn; - - if ( UMAHasAquaLayout() ) - { - wBtn += 2 * kMacOSXHorizontalBorder ; - hBtn += 2 * kMacOSXVerticalBorder ; - } - return wxSize ( wBtn , hBtn ) ; -} - -void wxToggleButton::SetValue(bool val) -{ - ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ; -} - -bool wxToggleButton::GetValue() const -{ - return GetControl32BitValue( (ControlHandle) m_macControl ) ; -} - -void wxToggleButton::Command(wxCommandEvent & event) -{ - SetValue((event.GetInt() != 0)); - ProcessCommand(event); -} - -void wxToggleButton::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 controlpart , bool WXUNUSED(mouseStillDown) ) -{ - if ( controlpart != kControlNoPart ) - { - wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId); - event.SetInt(GetValue()); - event.SetEventObject(this); - ProcessCommand(event); - } -} - -#endif // wxUSE_TOGGLEBTN - diff --git a/src/mac/classic/thread.cpp b/src/mac/classic/thread.cpp deleted file mode 100644 index 5e322a719d..0000000000 --- a/src/mac/classic/thread.cpp +++ /dev/null @@ -1,921 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: thread.cpp -// Purpose: wxThread Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin -// Modified by: Stefan Csomor -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), -// Vadim Zeitlin (1999) , Stefan Csomor (2000) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "thread.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#if wxUSE_THREADS - -#include "wx/module.h" -#include "wx/thread.h" - -#ifdef __WXMAC__ -#include -#include "wx/mac/uma.h" -#include "wx/mac/macnotfy.h" -#include -#endif - -#define INFINITE 0xFFFFFFFF - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the possible states of the thread ("=>" shows all possible transitions from -// this state) -enum wxThreadState -{ - STATE_NEW, // didn't start execution yet (=> RUNNING) - STATE_RUNNING, // thread is running (=> PAUSED, CANCELED) - STATE_PAUSED, // thread is temporarily suspended (=> RUNNING) - STATE_CANCELED, // thread should terminate a.s.a.p. (=> EXITED) - STATE_EXITED // thread is terminating -}; - -// ---------------------------------------------------------------------------- -// this module globals -// ---------------------------------------------------------------------------- - -static ThreadID gs_idMainThread = kNoThreadID ; -static bool gs_waitingForThread = FALSE ; -size_t g_numberOfThreads = 0; - -// ============================================================================ -// MacOS implementation of thread classes -// ============================================================================ - -class wxMacStCritical -{ -public : - wxMacStCritical() - { - if ( UMASystemIsInitialized() ) - ThreadBeginCritical() ; - } - ~wxMacStCritical() - { - if ( UMASystemIsInitialized() ) - ThreadEndCritical() ; - } -}; - -// ---------------------------------------------------------------------------- -// wxMutex implementation -// ---------------------------------------------------------------------------- - -class wxMutexInternal -{ -public: - wxMutexInternal(wxMutexType WXUNUSED(mutexType)) - { - m_owner = kNoThreadID ; - m_locked = 0; - } - - ~wxMutexInternal() - { - if ( m_locked > 0 ) - { - wxLogDebug(_T("Warning: freeing a locked mutex (%ld locks)."), m_locked); - } - } - - bool IsOk() const { return true; } - - wxMutexError Lock() ; - wxMutexError TryLock() ; - wxMutexError Unlock(); -public: - ThreadID m_owner ; - wxArrayLong m_waiters ; - long m_locked ; -}; - -wxMutexError wxMutexInternal::Lock() -{ - wxMacStCritical critical ; - if ( UMASystemIsInitialized() ) - { - OSErr err ; - ThreadID current = kNoThreadID; - err = ::MacGetCurrentThread(¤t); - // if we are not the owner, add this thread to the list of waiting threads, stop this thread - // and invoke the scheduler to continue executing the owner's thread - while ( m_owner != kNoThreadID && m_owner != current) - { - m_waiters.Add(current); - err = ::SetThreadStateEndCritical(kCurrentThreadID, kStoppedThreadState, m_owner); - err = ::ThreadBeginCritical(); - } - m_owner = current; - } - m_locked++; - - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutexInternal::TryLock() -{ - wxMacStCritical critical ; - if ( UMASystemIsInitialized() ) - { - ThreadID current = kNoThreadID; - ::MacGetCurrentThread(¤t); - // if we are not the owner, give an error back - if ( m_owner != kNoThreadID && m_owner != current ) - return wxMUTEX_BUSY; - - m_owner = current; - } - m_locked++; - - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutexInternal::Unlock() -{ - if ( UMASystemIsInitialized() ) - { - OSErr err; - err = ::ThreadBeginCritical(); - - if (m_locked > 0) - m_locked--; - - // this mutex is not owned by anybody anmore - m_owner = kNoThreadID; - - // now pass on to the first waiting thread - ThreadID firstWaiting = kNoThreadID; - bool found = false; - while (!m_waiters.IsEmpty() && !found) - { - firstWaiting = m_waiters[0]; - err = ::SetThreadState(firstWaiting, kReadyThreadState, kNoThreadID); - // in case this was not successful (dead thread), we just loop on and reset the id - found = (err != threadNotFoundErr); - if ( !found ) - firstWaiting = kNoThreadID ; - m_waiters.RemoveAt(0) ; - } - // now we have a valid firstWaiting thread, which has been scheduled to run next, just end the - // critical section and invoke the scheduler - err = ::SetThreadStateEndCritical(kCurrentThreadID, kReadyThreadState, firstWaiting); - } - else - { - if (m_locked > 0) - m_locked--; - } - return wxMUTEX_NO_ERROR; -} - -// -------------------------------------------------------------------------- -// wxSemaphore -// -------------------------------------------------------------------------- - -// TODO not yet implemented - -class wxSemaphoreInternal -{ -public: - wxSemaphoreInternal(int initialcount, int maxcount); - ~wxSemaphoreInternal(); - - bool IsOk() const { return true ; } - - wxSemaError Wait() { return WaitTimeout(INFINITE); } - wxSemaError TryWait() { return WaitTimeout(0); } - wxSemaError WaitTimeout(unsigned long milliseconds); - - wxSemaError Post(); - -private: -}; - -wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) -{ - if ( maxcount == 0 ) - { - // make it practically infinite - maxcount = INT_MAX; - } -} - -wxSemaphoreInternal::~wxSemaphoreInternal() -{ -} - -wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) -{ - return wxSEMA_MISC_ERROR; -} - -wxSemaError wxSemaphoreInternal::Post() -{ - return wxSEMA_MISC_ERROR; -} - -// ---------------------------------------------------------------------------- -// wxCondition implementation -// ---------------------------------------------------------------------------- - -// TODO this is not yet completed - -class wxConditionInternal -{ -public: - wxConditionInternal(wxMutex& mutex) : m_mutex(mutex) - { - m_excessSignals = 0 ; - } - ~wxConditionInternal() - { - } - - bool IsOk() const { return m_mutex.IsOk() ; } - - wxCondError Wait() - { - return WaitTimeout(0xFFFFFFFF ); - } - - wxCondError WaitTimeout(unsigned long msectimeout) - { - wxMacStCritical critical ; - if ( m_excessSignals > 0 ) - { - --m_excessSignals ; - return wxCOND_NO_ERROR ; - } - else if ( msectimeout == 0 ) - { - return wxCOND_MISC_ERROR ; - } - else - { - } - /* - waiters++; - - // FIXME this should be MsgWaitForMultipleObjects() as well probably - DWORD rc = ::WaitForSingleObject(event, timeout); - - waiters--; - - return rc != WAIT_TIMEOUT; - */ - return wxCOND_NO_ERROR ; - } - wxCondError Signal() - { - wxMacStCritical critical ; - return wxCOND_NO_ERROR; - } - - wxCondError Broadcast() - { - wxMacStCritical critical ; - return wxCOND_NO_ERROR; - } - - wxArrayLong m_waiters ; - wxInt32 m_excessSignals ; - wxMutex& m_mutex; -}; - -// ---------------------------------------------------------------------------- -// wxCriticalSection implementation -// ---------------------------------------------------------------------------- - -// it's implemented as a mutex on mac os, so it is defined in the headers - -// ---------------------------------------------------------------------------- -// wxThread implementation -// ---------------------------------------------------------------------------- - -// wxThreadInternal class -// ---------------------- - -class wxThreadInternal -{ -public: - wxThreadInternal() - { - m_tid = kNoThreadID ; - m_state = STATE_NEW; - m_priority = WXTHREAD_DEFAULT_PRIORITY; - } - - ~wxThreadInternal() - { - } - - void Free() - { - } - - // create a new (suspended) thread (for the given thread object) - bool Create(wxThread *thread, unsigned int stackSize); - - // suspend/resume/terminate - bool Suspend(); - bool Resume(); - void Cancel() { m_state = STATE_CANCELED; } - - // thread state - void SetState(wxThreadState state) { m_state = state; } - wxThreadState GetState() const { return m_state; } - - // thread priority - void SetPriority(unsigned int priority); - unsigned int GetPriority() const { return m_priority; } - - void SetResult( void *res ) { m_result = res ; } - void *GetResult() { return m_result ; } - - // thread handle and id - ThreadID GetId() const { return m_tid; } - - // thread function - static pascal void* MacThreadStart(wxThread* arg); - -private: - wxThreadState m_state; // state, see wxThreadState enum - unsigned int m_priority; // thread priority in "wx" units - ThreadID m_tid; // thread id - void* m_result; - static ThreadEntryUPP s_threadEntry ; -}; - -static wxArrayPtrVoid s_threads ; - -ThreadEntryUPP wxThreadInternal::s_threadEntry = NULL ; -pascal void* wxThreadInternal::MacThreadStart(wxThread *thread) -{ - // first of all, check whether we hadn't been cancelled already - if ( thread->m_internal->GetState() == STATE_EXITED ) - { - return (void*)-1; - } - - void* rc = thread->Entry(); - - // enter m_critsect before changing the thread state - thread->m_critsect.Enter(); - bool wasCancelled = thread->m_internal->GetState() == STATE_CANCELED; - thread->m_internal->SetState(STATE_EXITED); - thread->m_critsect.Leave(); - - thread->OnExit(); - - // if the thread was cancelled (from Delete()), then it the handle is still - // needed there - if ( thread->IsDetached() && !wasCancelled ) - { - // auto delete - delete thread; - } - //else: the joinable threads handle will be closed when Wait() is done - - return rc; -} -void wxThreadInternal::SetPriority(unsigned int priority) -{ - // Priorities don't exist on Mac -} - -bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) -{ - if ( s_threadEntry == NULL ) - { - s_threadEntry = NewThreadEntryUPP( (ThreadEntryProcPtr) MacThreadStart ) ; - } - OSErr err = NewThread( kCooperativeThread, - s_threadEntry, - (void*) thread, - stackSize, - kNewSuspend, - &m_result, - &m_tid ); - - if ( err != noErr ) - { - wxLogSysError(_("Can't create thread")); - return FALSE; - } - - if ( m_priority != WXTHREAD_DEFAULT_PRIORITY ) - { - SetPriority(m_priority); - } - - m_state = STATE_NEW; - - return TRUE; -} - -bool wxThreadInternal::Suspend() -{ - OSErr err ; - - ::ThreadBeginCritical(); - - if ( m_state != STATE_RUNNING ) - { - ::ThreadEndCritical() ; - wxLogSysError(_("Can not suspend thread %x"), m_tid); - return FALSE; - } - - m_state = STATE_PAUSED; - - err = ::SetThreadStateEndCritical(m_tid, kStoppedThreadState, kNoThreadID); - - return TRUE; -} - -bool wxThreadInternal::Resume() -{ - ThreadID current ; - OSErr err ; - err = MacGetCurrentThread( ¤t ) ; - - wxASSERT( err == noErr ) ; - wxASSERT( current != m_tid ) ; - - ::ThreadBeginCritical(); - if ( m_state != STATE_PAUSED && m_state != STATE_NEW ) - { - ::ThreadEndCritical() ; - wxLogSysError(_("Can not resume thread %x"), m_tid); - return FALSE; - - } - err = ::SetThreadStateEndCritical(m_tid, kReadyThreadState, kNoThreadID); - wxASSERT( err == noErr ) ; - - m_state = STATE_RUNNING; - ::ThreadEndCritical() ; - ::YieldToAnyThread() ; - return TRUE; -} - -// static functions -// ---------------- -wxThread *wxThread::This() -{ - wxMacStCritical critical ; - - ThreadID current ; - OSErr err ; - - err = MacGetCurrentThread( ¤t ) ; - - for ( size_t i = 0 ; i < s_threads.Count() ; ++i ) - { - if ( ( (wxThread*) s_threads[i] )->GetId() == current ) - return (wxThread*) s_threads[i] ; - } - - wxLogSysError(_("Couldn't get the current thread pointer")); - return NULL; -} - -bool wxThread::IsMain() -{ - ThreadID current ; - OSErr err ; - - err = MacGetCurrentThread( ¤t ) ; - return current == gs_idMainThread; -} - -#ifdef Yield -#undef Yield -#endif - -void wxThread::Yield() -{ - ::YieldToAnyThread() ; -} - -void wxThread::Sleep(unsigned long milliseconds) -{ - UnsignedWide start, now; - - Microseconds(&start); - - double mssleep = milliseconds * 1000 ; - double msstart, msnow ; - msstart = (start.hi * 4294967296.0 + start.lo) ; - - do - { - YieldToAnyThread(); - Microseconds(&now); - msnow = (now.hi * 4294967296.0 + now.lo) ; - } while( msnow - msstart < mssleep ); -} - -int wxThread::GetCPUCount() -{ - // we will use whatever MP API will be used for the new MP Macs - return 1; -} - -unsigned long wxThread::GetCurrentId() -{ - ThreadID current ; - MacGetCurrentThread( ¤t ) ; - return (unsigned long)current; -} - -bool wxThread::SetConcurrency(size_t level) -{ - wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); - - // ok only for the default one - if ( level == 0 ) - return 0; - - // how many CPUs have we got? - if ( GetCPUCount() == 1 ) - { - // don't bother with all this complicated stuff - on a single - // processor system it doesn't make much sense anyhow - return level == 1; - } - - return TRUE ; -} - -// ctor and dtor -// ------------- - -wxThread::wxThread(wxThreadKind kind) -{ - g_numberOfThreads++; - m_internal = new wxThreadInternal(); - - m_isDetached = kind == wxTHREAD_DETACHED; - s_threads.Add( (void*) this ) ; -} - -wxThread::~wxThread() -{ - if (g_numberOfThreads>0) - { - g_numberOfThreads--; - } -#ifdef __WXDEBUG__ - else - { - wxFAIL_MSG(wxT("More threads deleted than created.")); - } -#endif - - s_threads.Remove( (void*) this ) ; - if (m_internal != NULL) { - delete m_internal; - m_internal = NULL; - } -} - -// create/start thread -// ------------------- - -wxThreadError wxThread::Create(unsigned int stackSize) -{ - wxCriticalSectionLocker lock(m_critsect); - - if ( !m_internal->Create(this, stackSize) ) - return wxTHREAD_NO_RESOURCE; - - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Run() -{ - wxCriticalSectionLocker lock(m_critsect); - - if ( m_internal->GetState() != STATE_NEW ) - { - // actually, it may be almost any state at all, not only STATE_RUNNING - return wxTHREAD_RUNNING; - } - - // the thread has just been created and is still suspended - let it run - return Resume(); -} - -// suspend/resume thread -// --------------------- - -wxThreadError wxThread::Pause() -{ - wxCriticalSectionLocker lock(m_critsect); - - return m_internal->Suspend() ? wxTHREAD_NO_ERROR : wxTHREAD_MISC_ERROR; -} - -wxThreadError wxThread::Resume() -{ - wxCriticalSectionLocker lock(m_critsect); - - return m_internal->Resume() ? wxTHREAD_NO_ERROR : wxTHREAD_MISC_ERROR; -} - -// stopping thread -// --------------- - -wxThread::ExitCode wxThread::Wait() -{ - // although under MacOS we can wait for any thread, it's an error to - // wait for a detached one in wxWin API - wxCHECK_MSG( !IsDetached(), (ExitCode)-1, - _T("can't wait for detached thread") ); - - ExitCode rc = (ExitCode)-1; - - (void)Delete(&rc); - - m_internal->Free(); - - return rc; -} - -wxThreadError wxThread::Delete(ExitCode *pRc) -{ - ExitCode rc = 0; - - // Delete() is always safe to call, so consider all possible states - - // has the thread started to run? - bool shouldResume = FALSE; - - { - wxCriticalSectionLocker lock(m_critsect); - - if ( m_internal->GetState() == STATE_NEW ) - { - // WinThreadStart() will see it and terminate immediately - m_internal->SetState(STATE_EXITED); - - shouldResume = TRUE; - } - } - - // is the thread paused? - if ( shouldResume || IsPaused() ) - Resume(); - - // does is still run? - if ( IsRunning() ) - { - if ( IsMain() ) - { - // set flag for wxIsWaitingForThread() - gs_waitingForThread = TRUE; - -#if wxUSE_GUI - wxBeginBusyCursor(); -#endif // wxUSE_GUI - } - - // ask the thread to terminate - { - wxCriticalSectionLocker lock(m_critsect); - - m_internal->Cancel(); - } - -#if wxUSE_GUI - // simply wait for the thread to terminate - while( TestDestroy() ) - { - ::YieldToAnyThread() ; - } -#else // !wxUSE_GUI - // simply wait for the thread to terminate - while( TestDestroy() ) - { - ::YieldToAnyThread() ; - } -#endif // wxUSE_GUI/!wxUSE_GUI - - if ( IsMain() ) - { - gs_waitingForThread = FALSE; - -#if wxUSE_GUI - wxEndBusyCursor(); -#endif // wxUSE_GUI - } - } - - if ( IsDetached() ) - { - // if the thread exits normally, this is done in WinThreadStart, but in - // this case it would have been too early because - // MsgWaitForMultipleObject() would fail if the therad handle was - // closed while we were waiting on it, so we must do it here - delete this; - } - - if ( pRc ) - *pRc = rc; - - return rc == (ExitCode)-1 ? wxTHREAD_MISC_ERROR : wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Kill() -{ - if ( !IsRunning() ) - return wxTHREAD_NOT_RUNNING; - -// if ( !::TerminateThread(m_internal->GetHandle(), (DWORD)-1) ) - { - wxLogSysError(_("Couldn't terminate thread")); - - return wxTHREAD_MISC_ERROR; - } - - m_internal->Free(); - - if ( IsDetached() ) - { - delete this; - } - - return wxTHREAD_NO_ERROR; -} - -void wxThread::Exit(ExitCode status) -{ - m_internal->Free(); - - if ( IsDetached() ) - { - delete this; - } - - m_internal->SetResult( status ) ; - -/* -#if defined(__VISUALC__) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) - _endthreadex((unsigned)status); -#else // !VC++ - ::ExitThread((DWORD)status); -#endif // VC++/!VC++ -*/ - wxFAIL_MSG(wxT("Couldn't return from ExitThread()!")); -} - -// priority setting -// ---------------- - -// since all these calls are execute cooperatively we don't have to use the critical section - -void wxThread::SetPriority(unsigned int prio) -{ - m_internal->SetPriority(prio); -} - -unsigned int wxThread::GetPriority() const -{ - return m_internal->GetPriority(); -} - -unsigned long wxThread::GetId() const -{ - return (unsigned long)m_internal->GetId(); -} - -bool wxThread::IsRunning() const -{ - return m_internal->GetState() == STATE_RUNNING; -} - -bool wxThread::IsAlive() const -{ - return (m_internal->GetState() == STATE_RUNNING) || - (m_internal->GetState() == STATE_PAUSED); -} - -bool wxThread::IsPaused() const -{ - return m_internal->GetState() == STATE_PAUSED; -} - -bool wxThread::TestDestroy() -{ - return m_internal->GetState() == STATE_CANCELED; -} - -// ---------------------------------------------------------------------------- -// Automatic initialization for thread module -// ---------------------------------------------------------------------------- - -class wxThreadModule : public wxModule -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxThreadModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) - -bool wxThreadModule::OnInit() -{ - long response; - bool hasThreadManager ; - hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1; -#if !TARGET_CARBON -#if GENERATINGCFM - // verify presence of shared library - hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress); -#endif -#endif - if ( !hasThreadManager ) - { - wxLogSysError( wxT("Thread Support is not available on this System") ); - return FALSE ; - } - - // no error return for GetCurrentThreadId() - MacGetCurrentThread( &gs_idMainThread ) ; - - return TRUE; -} - -void wxThreadModule::OnExit() -{ -} - -// ---------------------------------------------------------------------------- -// under MacOS we don't have currently preemptive threads, so any thread may access -// the GUI at any time -// ---------------------------------------------------------------------------- - -void WXDLLEXPORT wxMutexGuiEnter() -{ -} - -void WXDLLEXPORT wxMutexGuiLeave() -{ -} - -void WXDLLEXPORT wxMutexGuiLeaveOrEnter() -{ -} - -bool WXDLLEXPORT wxGuiOwnedByMainThread() -{ - return false ; -} - -// wake up the main thread -void WXDLLEXPORT wxWakeUpMainThread() -{ - wxMacWakeUp() ; -} - -bool WXDLLEXPORT wxIsWaitingForThread() -{ - return false ; -} - -#include "wx/thrimpl.cpp" - -#endif // wxUSE_THREADS diff --git a/src/mac/classic/timer.cpp b/src/mac/classic/timer.cpp deleted file mode 100644 index a639e2c464..0000000000 --- a/src/mac/classic/timer.cpp +++ /dev/null @@ -1,143 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp -// Purpose: wxTimer implementation -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "timer.h" -#endif - -#include "wx/timer.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) -#endif - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#endif -#ifndef __DARWIN__ -#include -#endif - -#include "wx/dynarray.h" - -typedef struct MacTimerInfo -{ - TMTask m_task; - wxMacNotifierTableRef m_table ; - wxTimer* m_timer ; -} ; - -static void wxProcessTimer( unsigned long event , void *data ) ; - -static pascal void MacTimerProc( TMTask * t ) -{ - MacTimerInfo * tm = (MacTimerInfo*) t ; - wxMacAddEvent( tm->m_table , wxProcessTimer, 0 , (void*) tm->m_timer , TRUE ) ; -} - -// we need this array to track timers that are being deleted within the Notify procedure -// adding the timer before the Notify call and checking after whether it still is in there -// as the destructor would have removed it from the array - -wxArrayPtrVoid gTimersInProcess ; - -static void wxProcessTimer( unsigned long event , void *data ) -{ - if ( !data ) - return ; - - wxTimer* timer = (wxTimer*) data ; - - if ( timer->IsOneShot() ) - timer->Stop() ; - - gTimersInProcess.Add( timer ) ; - - timer->Notify(); - - int index = gTimersInProcess.Index( timer ) ; - - if ( index != wxNOT_FOUND ) - { - gTimersInProcess.RemoveAt( index ) ; - - if ( !timer->IsOneShot() && timer->m_info->m_task.tmAddr ) - { - PrimeTime( (QElemPtr) &timer->m_info->m_task , timer->GetInterval() ) ; - } - - } -} - -void wxTimer::Init() -{ - m_info = new MacTimerInfo() ; - m_info->m_task.tmAddr = NULL ; - m_info->m_task.tmWakeUp = 0 ; - m_info->m_task.tmReserved = 0 ; - m_info->m_task.qType = 0 ; - m_info->m_table = wxMacGetNotifierTable() ; - m_info->m_timer = this ; -} - -bool wxTimer::IsRunning() const -{ - // as the qType may already indicate it is elapsed, but it - // was not handled internally yet - return ( m_info->m_task.tmAddr != NULL ) ; -} - -wxTimer::~wxTimer() -{ - Stop(); - if (m_info != NULL) { - delete m_info ; - m_info = NULL ; - } - int index = gTimersInProcess.Index( this ) ; - if ( index != wxNOT_FOUND ) - gTimersInProcess.RemoveAt( index ) ; -} - -bool wxTimer::Start(int milliseconds,bool mode) -{ - (void)wxTimerBase::Start(milliseconds, mode); - - wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeout") ); - wxCHECK_MSG( m_info->m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") ); - -#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) - m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ; -#else - m_info->m_task.tmAddr = NewTimerProc( MacTimerProc ) ; -#endif - m_info->m_task.tmWakeUp = 0 ; - m_info->m_task.tmReserved = 0 ; - m_info->m_task.qType = 0 ; - m_info->m_timer = this ; - InsXTime((QElemPtr) &m_info->m_task ) ; - PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ; - return TRUE; -} - -void wxTimer::Stop() -{ - if ( m_info->m_task.tmAddr ) - { - RmvTime( (QElemPtr) &m_info->m_task ) ; - DisposeTimerUPP(m_info->m_task.tmAddr) ; - m_info->m_task.tmAddr = NULL ; - } - wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable() , this ) ; -} - - - diff --git a/src/mac/classic/toolbar.cpp b/src/mac/classic/toolbar.cpp deleted file mode 100644 index d8bdac1326..0000000000 --- a/src/mac/classic/toolbar.cpp +++ /dev/null @@ -1,620 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.cpp -// Purpose: wxToolBar -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: The wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "toolbar.h" -#endif - -#include "wx/wx.h" - -#if wxUSE_TOOLBAR - -#include "wx/toolbar.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/bitmap.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) - -BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) - EVT_MOUSE_EVENTS( wxToolBar::OnMouse ) - EVT_PAINT( wxToolBar::OnPaint ) -END_EVENT_TABLE() -#endif - -#include "wx/mac/uma.h" -#include "wx/geometry.h" -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxToolBarTool : public wxToolBarToolBase -{ -public: - wxToolBarTool(wxToolBar *tbar, - int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) ; - - wxToolBarTool(wxToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) - { - Init() ; - } - - ~wxToolBarTool() - { - if ( m_controlHandle ) - DisposeControl( m_controlHandle ) ; - } - - ControlHandle GetControlHandle() { return m_controlHandle ; } - void SetControlHandle( ControlHandle handle ) { m_controlHandle = handle ; } - - void SetSize(const wxSize& size) ; - void SetPosition( const wxPoint& position ) ; - wxSize GetSize() const - { - if ( IsControl() ) - { - return GetControl()->GetSize() ; - } - else if ( IsButton() ) - { - return GetToolBar()->GetToolSize() ; - } - else - { - wxSize sz = GetToolBar()->GetToolSize() ; - sz.x /= 4 ; - sz.y /= 4 ; - return sz ; - } - } - wxPoint GetPosition() const - { - return wxPoint(m_x, m_y); - } -private : - void Init() - { - m_controlHandle = NULL ; - } - ControlHandle m_controlHandle ; - - wxCoord m_x; - wxCoord m_y; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToolBarTool -// ---------------------------------------------------------------------------- - -void wxToolBarTool::SetSize(const wxSize& size) -{ - if ( IsControl() ) - { - GetControl()->SetSize( size ) ; - } -} - -void wxToolBarTool::SetPosition(const wxPoint& position) -{ - m_x = position.x; - m_y = position.y; - - if ( IsButton() ) - { - int x , y ; - x = y = 0 ; - WindowRef rootwindow = (WindowRef) GetToolBar()->MacGetRootWindow() ; - GetToolBar()->MacWindowToRootWindow( &x , &y ) ; - int mac_x = x + position.x ; - int mac_y = y + position.y ; - - - Rect contrlRect ; - GetControlBounds( m_controlHandle , &contrlRect ) ; - int former_mac_x = contrlRect.left ; - int former_mac_y = contrlRect.top ; - wxSize sz = GetToolBar()->GetToolSize() ; - - if ( mac_x != former_mac_x || mac_y != former_mac_y ) - { - { - Rect inval = { former_mac_y , former_mac_x , former_mac_y + sz.y , former_mac_x + sz.x } ; - InvalWindowRect( rootwindow , &inval ) ; - } - UMAMoveControl( m_controlHandle , mac_x , mac_y ) ; - { - Rect inval = { mac_y , mac_x , mac_y + sz.y , mac_x + sz.x } ; - InvalWindowRect( rootwindow , &inval ) ; - } - } - } - else if ( IsControl() ) - { - GetControl()->Move( position ) ; - } -} - -const short kwxMacToolBarToolDefaultWidth = 24 ; -const short kwxMacToolBarToolDefaultHeight = 22 ; -const short kwxMacToolBarTopMargin = 2 ; -const short kwxMacToolBarLeftMargin = 2 ; - -wxToolBarTool::wxToolBarTool(wxToolBar *tbar, - int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) - : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp) -{ - Init(); - - if (id == wxID_SEPARATOR) return; - - WindowRef window = (WindowRef) tbar->MacGetRootWindow() ; - wxSize toolSize = tbar->GetToolSize() ; - Rect toolrect = { 0, 0 , toolSize.y , toolSize.x } ; - - ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , GetNormalBitmap() ) ; - - SInt16 behaviour = kControlBehaviorOffsetContents ; - if ( CanBeToggled() ) - behaviour += kControlBehaviorToggles ; - - if ( info.contentType != kControlNoContent ) - { - m_controlHandle = ::NewControl( window , &toolrect , "\p" , false , 0 , - behaviour + info.contentType , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ; - - ::SetControlData( m_controlHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ; - } - else - { - m_controlHandle = ::NewControl( window , &toolrect , "\p" , false , 0 , - behaviour , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ; - } - UMAShowControl( m_controlHandle ) ; - if ( !IsEnabled() ) - { - UMADeactivateControl( m_controlHandle ) ; - } - if ( CanBeToggled() && IsToggled() ) - { - ::SetControl32BitValue( m_controlHandle , 1 ) ; - } - else - { - ::SetControl32BitValue( m_controlHandle , 0 ) ; - } - - ControlHandle container = (ControlHandle) tbar->MacGetContainerForEmbedding() ; - wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; - ::EmbedControl( m_controlHandle , container ) ; -} - - -wxToolBarToolBase *wxToolBar::CreateTool(int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) -{ - return new wxToolBarTool(this, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp); -} - -wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control) -{ - return new wxToolBarTool(this, control); -} - -void wxToolBar::Init() -{ - m_maxWidth = -1; - m_maxHeight = -1; - m_defaultWidth = kwxMacToolBarToolDefaultWidth; - m_defaultHeight = kwxMacToolBarToolDefaultHeight; -} - -bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - - if (width <= 0) - width = 100; - if (height <= 0) - height = 30; - if (x < 0) - x = 0; - if (y < 0) - y = 0; - - SetName(name); - - m_windowStyle = style; - parent->AddChild(this); - - m_backgroundColour = parent->GetBackgroundColour() ; - m_foregroundColour = parent->GetForegroundColour() ; - - if (id == -1) - m_windowId = NewControlId(); - else - m_windowId = id; - - { - m_width = size.x ; - m_height = size.y ; - int x = pos.x ; - int y = pos.y ; - AdjustForParentClientOrigin(x, y, wxSIZE_USE_EXISTING); - m_x = x ; - m_y = y ; - } - - return TRUE; -} - -wxToolBar::~wxToolBar() -{ - // we must refresh the frame size when the toolbar is deleted but the frame - // is not - otherwise toolbar leaves a hole in the place it used to occupy -} - -bool wxToolBar::Realize() -{ - if (m_tools.GetCount() == 0) - return FALSE; - - int x = m_xMargin + kwxMacToolBarLeftMargin ; - int y = m_yMargin + kwxMacToolBarTopMargin ; - - int tw, th; - GetSize(& tw, & th); - - int maxWidth = 0 ; - int maxHeight = 0 ; - - int maxToolWidth = 0; - int maxToolHeight = 0; - - // Find the maximum tool width and height - wxToolBarToolsList::Node *node = m_tools.GetFirst(); - while ( node ) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData(); - wxSize sz = tool->GetSize() ; - - if ( sz.x > maxToolWidth ) - maxToolWidth = sz.x ; - if (sz.y> maxToolHeight) - maxToolHeight = sz.y; - - node = node->GetNext(); - } - - node = m_tools.GetFirst(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData(); - wxSize cursize = tool->GetSize() ; - - // for the moment we just do a single row/column alignement - if ( x + cursize.x > maxWidth ) - maxWidth = x + cursize.x ; - if ( y + cursize.y > maxHeight ) - maxHeight = y + cursize.y ; - - tool->SetPosition( wxPoint( x , y ) ) ; - - if ( GetWindowStyleFlag() & wxTB_VERTICAL ) - { - y += cursize.y ; - } - else - { - x += cursize.x ; - } - - node = node->GetNext(); - } - - if ( GetWindowStyleFlag() & wxTB_HORIZONTAL ) - { - if ( m_maxRows == 0 ) - { - // if not set yet, only one row - SetRows(1); - } - maxWidth = tw ; - maxHeight += m_yMargin + kwxMacToolBarTopMargin; - m_maxHeight = maxHeight ; - } - else - { - if ( GetToolsCount() > 0 && m_maxRows == 0 ) - { - // if not set yet, have one column - SetRows(GetToolsCount()); - } - maxHeight = th ; - maxWidth += m_xMargin + kwxMacToolBarLeftMargin; - m_maxWidth = maxWidth ; - } - - SetSize(maxWidth, maxHeight); - - return TRUE; -} - -void wxToolBar::SetToolBitmapSize(const wxSize& size) -{ - m_defaultWidth = size.x+4; m_defaultHeight = size.y+4; -} - -// The button size is bigger than the bitmap size -wxSize wxToolBar::GetToolSize() const -{ - return wxSize(m_defaultWidth + 4, m_defaultHeight + 4); -} - -void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) -{ - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarTool* tool = (wxToolBarTool*) node->GetData() ; - if ( tool->IsButton() ) - { - if( tool->GetControlHandle() == control ) - { - if ( tool->CanBeToggled() ) - { - tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ; - } - OnLeftClick( tool->GetId() , tool -> IsToggled() ) ; - break ; - } - } - } -} - -void wxToolBar::SetRows(int nRows) -{ - if ( nRows == m_maxRows ) - { - // avoid resizing the frame uselessly - return; - } - - m_maxRows = nRows; -} - -void wxToolBar::MacSuperChangedPosition() -{ - wxWindow::MacSuperChangedPosition() ; - Realize() ; -} - -wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const -{ - wxToolBarToolsList::Node *node = m_tools.GetFirst(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->GetData() ; - wxRect2DInt r( tool->GetPosition() , tool->GetSize() ) ; - if ( r.Contains( wxPoint( x , y ) ) ) - { - return tool; - } - - node = node->GetNext(); - } - - return (wxToolBarToolBase *)NULL; -} - -wxString wxToolBar::MacGetToolTipString( wxPoint &pt ) -{ - wxToolBarToolBase* tool = FindToolForPosition( pt.x , pt.y ) ; - if ( tool ) - { - return tool->GetShortHelp() ; - } - return wxEmptyString ; -} - -void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable) -{ - if (!IsShown()) - return ; - - wxToolBarTool *tool = (wxToolBarTool *)t; - if ( tool->IsControl() ) - { - tool->GetControl()->Enable( enable ) ; - } - else if ( tool->IsButton() ) - { - if ( enable ) - UMAActivateControl( tool->GetControlHandle() ) ; - else - UMADeactivateControl( tool->GetControlHandle() ) ; - } -} - -void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) -{ - if (!IsShown()) - return ; - - wxToolBarTool *tool = (wxToolBarTool *)t; - if ( tool->IsButton() ) - { - ::SetControl32BitValue( tool->GetControlHandle() , toggle ) ; - } -} - -bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), - wxToolBarToolBase *tool) -{ - // nothing special to do here - we relayout in Realize() later - tool->Attach(this); - - return TRUE; -} - -void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) -{ - wxFAIL_MSG( _T("not implemented") ); -} - -bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) -{ - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarToolBase *tool2 = node->GetData(); - if ( tool2 == tool ) - { - // let node point to the next node in the list - node = node->GetNext(); - - break; - } - } - - wxSize sz = ((wxToolBarTool*)tool)->GetSize() ; - - tool->Detach(); - - // and finally reposition all the controls after this one - - for ( /* node -> first after deleted */ ; node; node = node->GetNext() ) - { - wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData(); - wxPoint pt = tool2->GetPosition() ; - - if ( GetWindowStyleFlag() & wxTB_VERTICAL ) - { - pt.y -= sz.y ; - } - else - { - pt.x -= sz.x ; - } - tool2->SetPosition( pt ) ; - } - - return TRUE ; -} - -void wxToolBar::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - Rect toolbarrect = { dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) , - dc.YLOG2DEVMAC(m_height) , dc.XLOG2DEVMAC(m_width) } ; - UMADrawThemePlacard( &toolbarrect , IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; - { - wxToolBarToolsList::Node *node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - wxToolBarTool* tool = (wxToolBarTool*) node->GetData() ; - if ( tool->IsButton() ) - { - UMADrawControl( tool->GetControlHandle() ) ; - } - } - } -} - -void wxToolBar::OnMouse( wxMouseEvent &event ) -{ - if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK ) - { - - int x = event.m_x ; - int y = event.m_y ; - - MacClientToRootWindow( &x , &y ) ; - - ControlHandle control ; - Point localwhere ; - SInt16 controlpart ; - WindowRef window = (WindowRef) MacGetRootWindow() ; - - localwhere.h = x ; - localwhere.v = y ; - - short modifiers = 0; - - if ( !event.m_leftDown && !event.m_rightDown ) - modifiers |= btnState ; - - if ( event.m_shiftDown ) - modifiers |= shiftKey ; - - if ( event.m_controlDown ) - modifiers |= controlKey ; - - if ( event.m_altDown ) - modifiers |= optionKey ; - - if ( event.m_metaDown ) - modifiers |= cmdKey ; - - controlpart = ::FindControl( localwhere , window , &control ) ; - { - if ( control && ::IsControlActive( control ) ) - { - { - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; - wxTheApp->s_lastMouseDown = 0 ; - if ( control && controlpart != kControlNoPart ) // otherwise we will get the event twice - { - MacHandleControlClick( control , controlpart , false /* not down anymore */ ) ; - } - } - } - } - } -} - -#endif // wxUSE_TOOLBAR - diff --git a/src/mac/classic/tooltip.cpp b/src/mac/classic/tooltip.cpp deleted file mode 100644 index f269196711..0000000000 --- a/src/mac/classic/tooltip.cpp +++ /dev/null @@ -1,408 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tooltip.cpp -// Purpose: wxToolTip implementation -// Author: Robert Roebling -// Id: $Id$ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ - #pragma implementation "tooltip.h" -#endif - -#include "wx/defs.h" - -#if wxUSE_TOOLTIPS - -#include "wx/app.h" -#include "wx/dc.h" -#include "wx/window.h" -#include "wx/tooltip.h" -#include "wx/timer.h" -#include "wx/geometry.h" -#include "wx/mac/uma.h" - -//----------------------------------------------------------------------------- -// global data -//----------------------------------------------------------------------------- - -class wxMacToolTipTimer ; - -class wxMacToolTip -{ - public : - wxMacToolTip( ) ; - ~wxMacToolTip() ; - - void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ; - long GetMark() { return m_mark ; } - void Draw() ; - void Clear() ; - bool IsShown() { return m_shown ; } - private : - - wxString m_label ; - wxPoint m_position ; - Rect m_rect ; - WindowRef m_window ; - PicHandle m_backpict ; - bool m_shown ; - long m_mark ; - wxMacToolTipTimer* m_timer ; -#if TARGET_CARBON - wxMacCFStringHolder m_helpTextRef ; -#endif -} ; - -class wxMacToolTipTimer : public wxTimer -{ -public: - wxMacToolTipTimer() {} ; - wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; - virtual ~wxMacToolTipTimer() {} ; - void Notify() - { - if ( m_mark == m_tip->GetMark() ) - m_tip->Draw() ; - } -protected: - wxMacToolTip* m_tip; - long m_mark ; -}; - -//----------------------------------------------------------------------------- -// wxToolTip -//----------------------------------------------------------------------------- -static long s_ToolTipDelay = 500 ; -static bool s_ShowToolTips = true ; -static wxMacToolTip s_ToolTip ; -static wxWindow* s_LastWindowEntered = NULL ; -static wxRect2DInt s_ToolTipArea ; -static WindowRef s_ToolTipWindowRef = NULL ; - -IMPLEMENT_ABSTRACT_CLASS(wxToolTip, wxObject) - -wxToolTip::wxToolTip( const wxString &tip ) -{ - m_text = tip; - m_window = (wxWindow*) NULL; -} - -wxToolTip::~wxToolTip() -{ -} - -void wxToolTip::SetTip( const wxString &tip ) -{ - m_text = tip; - - if ( m_window ) - { - /* - // update it immediately - wxToolInfo ti(GetHwndOf(m_window)); - ti.lpszText = (wxChar *)m_text.c_str(); - - (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti); - */ - } -} - -void wxToolTip::SetWindow( wxWindow *win ) -{ - m_window = win ; -} - -void wxToolTip::Enable( bool flag ) -{ - if ( s_ShowToolTips != flag ) - { - s_ShowToolTips = flag ; - if ( s_ShowToolTips ) - { - } - else - { - s_ToolTip.Clear() ; - } - } -} - -void wxToolTip::SetDelay( long msecs ) -{ - s_ToolTipDelay = msecs ; -} - -void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) -{ - if ( s_ShowToolTips ) - { - if ( event.GetEventType() == wxEVT_LEAVE_WINDOW ) - { - s_ToolTip.Clear() ; - } - else if (event.GetEventType() == wxEVT_ENTER_WINDOW || event.GetEventType() == wxEVT_MOTION ) - { - wxPoint2DInt where( event.m_x , event.m_y ) ; - if ( s_LastWindowEntered == win && s_ToolTipArea.Contains( where ) ) - { - } - else - { - s_ToolTip.Clear() ; - s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ; - s_LastWindowEntered = win ; - - WindowRef window = MAC_WXHWND( win->MacGetRootWindow() ) ; - int x = event.m_x ; - int y = event.m_y ; - wxPoint local( x , y ) ; - win->MacClientToRootWindow( &x, &y ) ; - wxPoint windowlocal( x , y ) ; - s_ToolTip.Setup( window , win->MacGetToolTipString( local ) , windowlocal ) ; - } - } - } -} - -void wxToolTip::RemoveToolTips() -{ - s_ToolTip.Clear() ; -} -// --- mac specific - -wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec ) -{ - m_tip = tip; - m_mark = tip->GetMark() ; - Start(msec, true); -} - -wxMacToolTip::wxMacToolTip() -{ - m_window = NULL ; - m_backpict = NULL ; - m_mark = 0 ; - m_shown = false ; - m_timer = NULL ; -} - -void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition ) -{ - m_mark++ ; - Clear() ; - m_position = localPosition ; - m_label = text ; - m_window =win; - s_ToolTipWindowRef = m_window ; - m_backpict = NULL ; - if ( m_timer ) - delete m_timer ; - m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ; -} - -wxMacToolTip::~wxMacToolTip() -{ - if ( m_timer ) { - delete m_timer ; - m_timer = NULL; - } - if ( m_backpict ) - Clear() ; -} - -const short kTipBorder = 2 ; -const short kTipOffset = 5 ; - -void wxMacToolTip::Draw() -{ - if ( m_label.Length() == 0 ) - return ; - - if ( m_window == s_ToolTipWindowRef ) - { - m_shown = true ; -#if TARGET_CARBON - HMHelpContentRec tag ; - tag.version = kMacHelpVersion; - SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ; - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort(m_window) ; - LocalToGlobal( (Point *) &tag.absHotRect.top ); - LocalToGlobal( (Point *) &tag.absHotRect.bottom ); - SetPort( port ); - m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ; - tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; - tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; - tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ; - tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ; - tag.tagSide = kHMDefaultSide; - HMDisplayTag( &tag ); -#else - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) ); - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - - TextFont( fontId ) ; - TextSize( fontSize ) ; - TextFace( fontStyle ) ; - FontInfo fontInfo; - ::GetFontInfo(&fontInfo); - short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading; - short height = 0 ; - - int i = 0 ; - int length = m_label.Length() ; - int width = 0 ; - int thiswidth = 0 ; - int laststop = 0 ; - wxCharBuffer text = m_label.mb_str( wxConvLocal) ; - - while( i < length ) - { - if( text[i] == 13 || text[i] == 10) - { - thiswidth = ::TextWidth( text , laststop , i - laststop ) ; - if ( thiswidth > width ) - width = thiswidth ; - - height += lineh ; - laststop = i+1 ; - } - i++ ; - } - if ( i - laststop > 0 ) - { - thiswidth = ::TextWidth( text , laststop , i - laststop ) ; - if ( thiswidth > width ) - width = thiswidth ; - height += lineh ; - } - - m_rect.left = m_position.x + kTipOffset; - m_rect.top = m_position.y + kTipOffset; - m_rect.right = m_rect.left + width + 2 * kTipBorder; - - m_rect.bottom = m_rect.top + height + 2 * kTipBorder; - Rect r ; - GetPortBounds( GetWindowPort( m_window ) , &r ) ; - if ( m_rect.top < 0 ) - { - m_rect.bottom += -m_rect.top ; - m_rect.top = 0 ; - } - if ( m_rect.left < 0 ) - { - m_rect.right += -m_rect.left ; - m_rect.left = 0 ; - } - if ( m_rect.right > r.right ) - { - m_rect.left -= (m_rect.right - r.right ) ; - m_rect.right = r.right ; - } - if ( m_rect.bottom > r.bottom ) - { - m_rect.top -= (m_rect.bottom - r.bottom) ; - m_rect.bottom = r.bottom ; - } - ClipRect( &m_rect ) ; - BackColor( whiteColor ) ; - ForeColor(blackColor ) ; - GWorldPtr port ; - NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ; - CGrafPtr origPort ; - GDHandle origDevice ; - - GetGWorld( &origPort , &origDevice ) ; - SetGWorld( port , NULL ) ; - - m_backpict = OpenPicture(&m_rect); - - CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)), - GetPortBitMapForCopyBits(port), - &m_rect, - &m_rect, - srcCopy, - NULL); - ClosePicture(); - SetGWorld( origPort , origDevice ) ; - DisposeGWorld( port ) ; - PenNormal() ; - - RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ; - BackColor( whiteColor ) ; - RGBForeColor( &tooltipbackground ) ; - - PaintRect( &m_rect ) ; - ForeColor(blackColor ) ; - FrameRect( &m_rect ) ; - SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ; - ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder); - - i = 0 ; - laststop = 0 ; - height = 0 ; - - while( i < length ) - { - if( text[i] == 13 || text[i] == 10) - { - ::DrawText( text , laststop , i - laststop ) ; - height += lineh ; - ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height ); - laststop = i+1 ; - } - i++ ; - } - ::DrawText( text , laststop , i - laststop ) ; - ::TextMode( srcOr ) ; -#endif - } -} - -void wxToolTip::NotifyWindowDelete( WXHWND win ) -{ - if ( win == s_ToolTipWindowRef ) - { - s_ToolTipWindowRef = NULL ; - } -} - -void wxMacToolTip::Clear() -{ - m_mark++ ; - if ( m_timer ) - { - delete m_timer ; - m_timer = NULL ; - } - if ( !m_shown ) - return ; -#if TARGET_CARBON - HMHideTag() ; - m_helpTextRef.Release() ; -#else - if ( m_window == s_ToolTipWindowRef && m_backpict ) - { - wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ; - - m_shown = false ; - - BackColor( whiteColor ) ; - ForeColor(blackColor ) ; - DrawPicture(m_backpict, &m_rect); - KillPicture(m_backpict); - m_backpict = NULL ; - } -#endif -} - -#endif - diff --git a/src/mac/classic/toplevel.cpp b/src/mac/classic/toplevel.cpp deleted file mode 100644 index 878c27f2a9..0000000000 --- a/src/mac/classic/toplevel.cpp +++ /dev/null @@ -1,1463 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: mac/toplevel.cpp -// Purpose: implements wxTopLevelWindow for Mac -// Author: Stefan Csomor -// Modified by: -// Created: 24.09.01 -// RCS-ID: $Id$ -// Copyright: (c) 2001-2004 Stefan Csomor -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#ifdef __GNUG__ - #pragma implementation "toplevel.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" - #include "wx/toplevel.h" - #include "wx/frame.h" - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include "wx/mac/uma.h" -#include "wx/mac/aga.h" -#include "wx/app.h" -#include "wx/tooltip.h" -#include "wx/dnd.h" -#if wxUSE_SYSTEM_OPTIONS - #include "wx/sysopt.h" -#endif - -#include - - -#define wxMAC_DEBUG_REDRAW 0 -#ifndef wxMAC_DEBUG_REDRAW -#define wxMAC_DEBUG_REDRAW 0 -#endif - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -// list of all frames and modeless dialogs -wxWindowList wxModelessWindows; - -// double click testing -static Point gs_lastWhere; -static long gs_lastWhen = 0; - - -#if TARGET_CARBON -static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param); -#endif - -// ============================================================================ -// wxTopLevelWindowMac implementation -// ============================================================================ - -// --------------------------------------------------------------------------- -// Carbon Events -// --------------------------------------------------------------------------- - -#if TARGET_CARBON - -extern long wxMacTranslateKey(unsigned char key, unsigned char code) ; - -static const EventTypeSpec eventList[] = -{ - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } , - - { kEventClassKeyboard, kEventRawKeyDown } , - { kEventClassKeyboard, kEventRawKeyRepeat } , - { kEventClassKeyboard, kEventRawKeyUp } , - { kEventClassKeyboard, kEventRawKeyModifiersChanged } , - - { kEventClassWindow , kEventWindowShown } , - { kEventClassWindow , kEventWindowUpdate } , - { kEventClassWindow , kEventWindowActivated } , - { kEventClassWindow , kEventWindowDeactivated } , - { kEventClassWindow , kEventWindowBoundsChanging } , - { kEventClassWindow , kEventWindowBoundsChanged } , - { kEventClassWindow , kEventWindowClose } , - - { kEventClassMouse , kEventMouseDown } , - { kEventClassMouse , kEventMouseUp } , - { kEventClassMouse , kEventMouseWheelMoved } , - { kEventClassMouse , kEventMouseMoved } , - { kEventClassMouse , kEventMouseDragged } , - -} ; - -static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxWindow* focus = wxWindow::FindFocus() ; - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - Point point ; - - EventRef rawEvent ; - - GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ; - - GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( rawEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter( rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - GetEventParameter( rawEvent, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - - switch ( GetEventKind( event ) ) - { - case kEventTextInputUnicodeForKeyEvent : - // this is only called when no default handler has jumped in, eg a wxControl on a floater window does not - // get its own kEventTextInputUnicodeForKeyEvent, so we route back the - wxControl* control = wxDynamicCast( focus , wxControl ) ; - if ( control ) - { - ControlHandle macControl = (ControlHandle) control->GetMacControl() ; - if ( macControl ) - { - ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ; - result = noErr ; - } - } - /* - // this may lead to double events sent to a window in case all handlers have skipped the key down event - UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; - UInt32 message = (keyCode << 8) + charCode; - - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - */ - break ; - } - - return result ; -} - -static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxWindow* focus = wxWindow::FindFocus() ; - char charCode ; - UInt32 keyCode ; - UInt32 modifiers ; - Point point ; - UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; - - GetEventParameter( event, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode ); - GetEventParameter( event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); - GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - - UInt32 message = (keyCode << 8) + charCode; - switch( GetEventKind( event ) ) - { - case kEventRawKeyRepeat : - case kEventRawKeyDown : - { - WXEVENTREF formerEvent = wxTheApp->MacGetCurrentEvent() ; - WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; - wxTheApp->MacSetCurrentEvent( event , handler ) ; - if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; - } - break ; - case kEventRawKeyUp : - if ( (focus != NULL) && wxTheApp->MacSendKeyUpEvent( - focus , message , modifiers , when , point.h , point.v ) ) - { - result = noErr ; - } - break ; - case kEventRawKeyModifiersChanged : - { - wxKeyEvent event(wxEVT_KEY_DOWN); - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - event.m_x = point.h; - event.m_y = point.v; - event.m_timeStamp = when; - wxWindow* focus = wxWindow::FindFocus() ; - event.SetEventObject(focus); - - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey ) - { - event.m_keyCode = WXK_CONTROL ; - event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey ) - { - event.m_keyCode = WXK_SHIFT ; - event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey ) - { - event.m_keyCode = WXK_ALT ; - event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & cmdKey ) - { - event.m_keyCode = WXK_COMMAND ; - event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - wxTheApp->s_lastModifiers = modifiers ; - } - break ; - } - - return result ; -} - -pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ; - Point point ; - UInt32 modifiers = 0; - EventMouseButton button = 0 ; - UInt32 click = 0 ; - - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, - sizeof( Point ), NULL, &point ); - GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &modifiers ); - GetEventParameter( event, kEventParamMouseButton, typeMouseButton, NULL, - sizeof( EventMouseButton ), NULL, &button ); - GetEventParameter( event, kEventParamClickCount, typeUInt32, NULL, - sizeof( UInt32 ), NULL, &click ); - - if ( button == 0 || GetEventKind( event ) == kEventMouseUp ) - modifiers += btnState ; - - // temporary hack to support true two button mouse - if ( button == kEventMouseButtonSecondary ) - { - modifiers |= controlKey ; - } - WindowRef window ; - short windowPart = ::FindWindow(point, &window); - - // either we really are active or we are capturing mouse events - - if ( (IsWindowActive(window) && windowPart == inContent) || - (wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) ) - { - switch ( GetEventKind( event ) ) - { - case kEventMouseDown : - toplevelWindow->MacFireMouseEvent( mouseDown , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseUp : - toplevelWindow->MacFireMouseEvent( mouseUp , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseMoved : - wxTheApp->MacHandleMouseMovedEvent( point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseDragged : - toplevelWindow->MacFireMouseEvent( nullEvent , point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventMouseWheelMoved : - { - //bClearTooltip = false; - EventMouseWheelAxis axis = kEventMouseWheelAxisY; - SInt32 delta = 0; - Point mouseLoc = {0, 0}; - if (::GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, - NULL, sizeof(EventMouseWheelAxis), NULL, &axis) == noErr && - ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, - NULL, sizeof(SInt32), NULL, &delta) == noErr && - ::GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, - NULL, sizeof(Point), NULL, &mouseLoc) == noErr) - { - wxMouseEvent wheelEvent(wxEVT_MOUSEWHEEL); - - wheelEvent.m_x = mouseLoc.h; - wheelEvent.m_y = mouseLoc.v; - - wheelEvent.m_wheelRotation = delta; - wheelEvent.m_wheelDelta = 1; - wheelEvent.m_linesPerAction = 1; - - wxWindow* currentMouseWindow = NULL; - wxWindow::MacGetWindowFromPoint(wxPoint(mouseLoc.h, mouseLoc.v), ¤tMouseWindow); - - if (currentMouseWindow) - { - currentMouseWindow->GetEventHandler()->ProcessEvent(wheelEvent); - result = noErr; - } - } - } - break ; - default : - break ; - } - } - - return result ; - - -} -static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - OSStatus err = noErr ; - - UInt32 attributes; - WindowRef windowRef ; - wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ; - - GetEventParameter( event, kEventParamDirectObject, typeWindowRef, NULL, - sizeof( WindowRef ), NULL, &windowRef ); - - switch( GetEventKind( event ) ) - { - case kEventWindowUpdate : - if ( !wxPendingDelete.Member(toplevelWindow) ) - toplevelWindow->MacUpdate( EventTimeToTicks( GetEventTime( event ) ) ) ; - result = noErr ; - break ; - case kEventWindowActivated : - toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , true) ; - result = noErr ; - break ; - case kEventWindowDeactivated : - toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ; - result = noErr ; - break ; - case kEventWindowShown : - toplevelWindow->Refresh() ; - result = noErr ; - break ; - case kEventWindowClose : - toplevelWindow->Close() ; - result = noErr ; - break ; - case kEventWindowBoundsChanged : - err = GetEventParameter( event, kEventParamAttributes, typeUInt32, - NULL, sizeof( UInt32 ), NULL, &attributes ); - if ( err == noErr ) - { - Rect newContentRect ; - - GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, - sizeof( newContentRect ), NULL, &newContentRect ); - - toplevelWindow->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - - result = noErr; - } - break ; - case kEventWindowBoundsChanging : - err = GetEventParameter( event, kEventParamAttributes, typeUInt32, - NULL, sizeof( UInt32 ), NULL, &attributes ); - if ( err == noErr ) - { - Rect newContentRect ; - - GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL, - sizeof( newContentRect ), NULL, &newContentRect ); - - wxSize formerSize = toplevelWindow->GetSize() ; - - if ( (attributes & kWindowBoundsChangeSizeChanged ) || - ( attributes & kWindowBoundsChangeOriginChanged ) ) - toplevelWindow->SetSize( newContentRect.left , newContentRect.top , - newContentRect.right - newContentRect.left , - newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); - - int x , y , w , h ; - toplevelWindow->GetPosition( &x , &y ) ; - toplevelWindow->GetSize( &w , &h ) ; - Rect adjustedRect = { y , x , y + h , x + w } ; - - if ( !EqualRect( &newContentRect , &adjustedRect ) ) - { - SetEventParameter( event , kEventParamCurrentBounds , typeQDRectangle, sizeof( adjustedRect ) , &adjustedRect ) ; - } - - if ( toplevelWindow->GetSize() != formerSize ) - toplevelWindow->Update() ; - - result = noErr ; - } - break ; - default : - break ; - } - return result ; -} - -pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - switch ( GetEventClass( event ) ) - { - case kEventClassKeyboard : - result = KeyboardEventHandler( handler, event , data ) ; - break ; - case kEventClassTextInput : - result = TextInputEventHandler( handler, event , data ) ; - break ; - case kEventClassWindow : - result = WindowEventHandler( handler, event , data ) ; - break ; - case kEventClassMouse : - result = MouseEventHandler( handler, event , data ) ; - break ; - default : - break ; - } - return result ; -} - -DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacWindowEventHandler ) - -#endif - -// --------------------------------------------------------------------------- -// wxWindowMac utility functions -// --------------------------------------------------------------------------- - -// Find an item given the Macintosh Window Reference - -wxList *wxWinMacWindowList = NULL; -wxTopLevelWindowMac *wxFindWinFromMacWindow(WXWindow inWindowRef) -{ - if ( wxWinMacWindowList == NULL ) - return NULL ; - wxNode *node = wxWinMacWindowList->Find((long)inWindowRef); - if (!node) - return NULL; - return (wxTopLevelWindowMac *)node->GetData(); -} - -void wxAssociateWinWithMacWindow(WXWindow inWindowRef, wxTopLevelWindowMac *win) -{ - // adding NULL WindowRef is (first) surely a result of an error and - // (secondly) breaks menu command processing - wxCHECK_RET( inWindowRef != (WindowRef) NULL, wxT("attempt to add a NULL WindowRef to window list") ); - - if ( !wxWinMacWindowList->Find((long)inWindowRef) ) - wxWinMacWindowList->Append((long)inWindowRef, win); -} - -void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) -{ - wxWinMacWindowList->DeleteObject(win); -} - - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac creation -// ---------------------------------------------------------------------------- - -WXHWND wxTopLevelWindowMac::s_macWindowInUpdate = NULL; -wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL; -bool wxTopLevelWindowMac::s_macWindowCompositing = FALSE; - -void wxTopLevelWindowMac::Init() -{ - m_iconized = - m_maximizeOnShow = FALSE; - m_macNoEraseUpdateRgn = NewRgn() ; - m_macNeedsErasing = false ; - m_macWindow = NULL ; - m_macUsesCompositing = FALSE ; -#if TARGET_CARBON - m_macEventHandler = NULL ; - #endif -} - -class wxMacDeferredWindowDeleter : public wxObject -{ -public : - wxMacDeferredWindowDeleter( WindowRef windowRef ) - { - m_macWindow = windowRef ; - } - virtual ~wxMacDeferredWindowDeleter() - { - UMADisposeWindow( (WindowRef) m_macWindow ) ; - } - protected : - WindowRef m_macWindow ; -} ; - -bool wxTopLevelWindowMac::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // init our fields - Init(); - - m_windowStyle = style; - - SetName(name); - - m_windowId = id == -1 ? NewControlId() : id; - - wxTopLevelWindows.Append(this); - - if ( parent ) - parent->AddChild(this); - - return TRUE; -} - -wxTopLevelWindowMac::~wxTopLevelWindowMac() -{ - if ( m_macWindow ) - { - wxToolTip::NotifyWindowDelete(m_macWindow) ; - wxPendingDelete.Append( new wxMacDeferredWindowDeleter( (WindowRef) m_macWindow ) ) ; - } - -#if TARGET_CARBON - if ( m_macEventHandler ) - { - ::RemoveEventHandler((EventHandlerRef) m_macEventHandler); - m_macEventHandler = NULL ; - } -#endif - - wxRemoveMacWindowAssociation( this ) ; - - if ( wxModelessWindows.Find(this) ) - wxModelessWindows.DeleteObject(this); - - DisposeRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ; -} - - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac maximize/minimize -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowMac::Maximize(bool maximize) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - wxMacWindowClipper clip (this); - ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ; - - Rect tempRect ; - GrafPtr port ; - GetPort( &port ) ; - Point pt = { 0, 0 } ; - SetPortWindowPort((WindowRef)m_macWindow) ; - LocalToGlobal( &pt ) ; - SetPort( port ) ; - - GetWindowPortBounds((WindowRef)m_macWindow, &tempRect ) ; - SetSize( pt.h , pt.v , tempRect.right-tempRect.left , - tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); -} - -bool wxTopLevelWindowMac::IsMaximized() const -{ - return IsWindowInStandardState( (WindowRef)m_macWindow , NULL , NULL ) ; -} - -void wxTopLevelWindowMac::Iconize(bool iconize) -{ - if ( IsWindowCollapsable((WindowRef)m_macWindow) ) - CollapseWindow((WindowRef)m_macWindow , iconize ) ; -} - -bool wxTopLevelWindowMac::IsIconized() const -{ - return IsWindowCollapsed((WindowRef)m_macWindow ) ; -} - -void wxTopLevelWindowMac::Restore() -{ - // not available on mac -} - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMac misc -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowMac::SetIcon(const wxIcon& icon) -{ - // this sets m_icon - wxTopLevelWindowBase::SetIcon(icon); -} - -void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) -{ - OSStatus err = noErr ; - SetName(name); - m_windowStyle = style; - m_isShown = FALSE; - - // create frame. - - Rect theBoundsRect; - - m_x = (int)pos.x; - m_y = (int)pos.y; - if ( m_y < 50 ) - m_y = 50 ; - if ( m_x < 20 ) - m_x = 20 ; - - m_width = WidthDefault(size.x); - m_height = HeightDefault(size.y); - - ::SetRect(&theBoundsRect, m_x, m_y , m_x + m_width, m_y + m_height); - - // translate the window attributes in the appropriate window class and attributes - - WindowClass wclass = 0; - WindowAttributes attr = kWindowNoAttributes ; - - if ( HasFlag( wxFRAME_TOOL_WINDOW) ) - { - if ( - HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || - HasFlag( wxSYSTEM_MENU ) || HasFlag( wxCAPTION ) || - HasFlag(wxTINY_CAPTION_HORIZ) || HasFlag(wxTINY_CAPTION_VERT) - ) - { - wclass = kFloatingWindowClass ; - if ( HasFlag(wxTINY_CAPTION_VERT) ) - { - attr |= kWindowSideTitlebarAttribute ; - } - } - else - { -#if TARGET_CARBON - wclass = kPlainWindowClass ; -#else - wclass = kFloatingWindowClass ; -#endif - } - } - else if ( HasFlag( wxCAPTION ) ) - { - wclass = kDocumentWindowClass ; - } - else - { - if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || - HasFlag( wxCLOSE_BOX ) || HasFlag( wxSYSTEM_MENU ) ) - { - wclass = kDocumentWindowClass ; - } - else - { -#if TARGET_CARBON - wclass = kPlainWindowClass ; -#else - wclass = kModalWindowClass ; -#endif - } - } - - if ( HasFlag( wxMINIMIZE_BOX ) ) - { - attr |= kWindowCollapseBoxAttribute ; - } - if ( HasFlag( wxMAXIMIZE_BOX ) ) - { - attr |= kWindowFullZoomAttribute ; - } - if ( HasFlag( wxRESIZE_BORDER ) ) - { - attr |= kWindowResizableAttribute ; - } - if ( HasFlag( wxCLOSE_BOX) ) - { - attr |= kWindowCloseBoxAttribute ; - } - - if (UMAGetSystemVersion() >= 0x1000) - { - //turn on live resizing (OS X only) - attr |= kWindowLiveResizeAttribute; - } - -#if TARGET_CARBON -#if 0 // having problems right now with that - if (HasFlag(wxSTAY_ON_TOP)) - wclass = kUtilityWindowClass; -#endif -#endif - - //this setup lets us have compositing and non-compositing - //windows in the same application. - -#if UNIVERSAL_INTERFACES_VERSION >= 0x0400 - if ( wxTopLevelWindowMac::s_macWindowCompositing ) - { - attr |= kWindowCompositingAttribute; - m_macUsesCompositing = TRUE; - } - else -#endif - { - m_macUsesCompositing = FALSE; - } - -#if TARGET_CARBON - if ( HasFlag(wxFRAME_SHAPED) ) - { - WindowDefSpec customWindowDefSpec; - customWindowDefSpec.defType = kWindowDefProcPtr; - customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef); - - err = ::CreateCustomWindow( &customWindowDefSpec, wclass, - attr, &theBoundsRect, - (WindowRef*) &m_macWindow); - } - else -#endif - { - err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ; - } - - wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") ); - wxAssociateWinWithMacWindow( m_macWindow , this ) ; - UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ; - if ( wxTopLevelWindowMac::s_macWindowCompositing ) - { - ::GetRootControl( (WindowRef)m_macWindow, (ControlHandle*)&m_macRootControl ) ; - } - else - { - ::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ; - } -#if TARGET_CARBON - InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ; - InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacWindowEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler); -#endif - m_macFocus = NULL ; - - -#if TARGET_CARBON - if ( HasFlag(wxFRAME_SHAPED) ) - { - // default shape matches the window size - wxRegion rgn(0, 0, m_width, m_height); - SetShape(rgn); - } -#endif - - wxWindowCreateEvent event(this); - GetEventHandler()->ProcessEvent(event); -} - -bool wxTopLevelWindowMac::MacEnableCompositing( bool useCompositing ) -{ - bool oldval = s_macWindowCompositing; - s_macWindowCompositing = useCompositing; - return oldval; -} - -void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin) -{ - ((Point*)localOrigin)->h = 0; - ((Point*)localOrigin)->v = 0; - ((Rect*)clipRect)->left = 0; - ((Rect*)clipRect)->top = 0; - ((Rect*)clipRect)->right = m_width; - ((Rect*)clipRect)->bottom = m_height; - *window = m_macWindow ; - *rootwin = this ; -} - -void wxTopLevelWindowMac::ClearBackground() -{ - wxWindow::ClearBackground() ; -} - -WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding() -{ - return m_macRootControl ; -} - - -void wxTopLevelWindowMac::MacUpdate( long timestamp) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - - RgnHandle visRgn = NewRgn() ; - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), visRgn ); - BeginUpdate( (WindowRef)m_macWindow ) ; - - RgnHandle updateRgn = NewRgn(); - RgnHandle diffRgn = NewRgn() ; - - if ( updateRgn && diffRgn ) - { -#if 1 - // macos internal control redraws clean up areas we'd like to redraw ourselves - // therefore we pick the boundary rect and make sure we can redraw it - // this has to be intersected by the visRgn in order to avoid drawing over its own - // boundaries - RgnHandle trueUpdateRgn = NewRgn() ; - Rect trueUpdateRgnBoundary ; - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn ); - GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ; - RectRgn( updateRgn , &trueUpdateRgnBoundary ) ; - SectRgn( updateRgn , visRgn , updateRgn ) ; - if ( trueUpdateRgn ) - DisposeRgn( trueUpdateRgn ) ; - SetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ; -#else - GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn ); -#endif - DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ; - if ( !EmptyRgn( updateRgn ) ) - { - MacRedraw( updateRgn , timestamp , m_macNeedsErasing || !EmptyRgn( diffRgn ) ) ; - } - } - if ( updateRgn ) - DisposeRgn( updateRgn ); - if ( diffRgn ) - DisposeRgn( diffRgn ); - if ( visRgn ) - DisposeRgn( visRgn ) ; - - EndUpdate( (WindowRef)m_macWindow ) ; - SetEmptyRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ; - m_macNeedsErasing = false ; -} - - -// Raise the window to the top of the Z order -void wxTopLevelWindowMac::Raise() -{ - ::SelectWindow( (WindowRef)m_macWindow ) ; -} - -// Lower the window to the bottom of the Z order -void wxTopLevelWindowMac::Lower() -{ - ::SendBehind( (WindowRef)m_macWindow , NULL ) ; -} - -void wxTopLevelWindowMac::MacFireMouseEvent( - wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) -{ - wxMouseEvent event(wxEVT_LEFT_DOWN); - bool isDown = !(modifiers & btnState) ; // 1 is for up - bool controlDown = modifiers & controlKey ; // for simulating right mouse - - event.m_leftDown = isDown && !controlDown; - - event.m_middleDown = FALSE; - event.m_rightDown = isDown && controlDown; - - if ( kind == mouseDown ) - { - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_DOWN ) ; - else - event.SetEventType(wxEVT_LEFT_DOWN ) ; - } - else if ( kind == mouseUp ) - { - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_UP ) ; - else - event.SetEventType(wxEVT_LEFT_UP ) ; - } - else - { - event.SetEventType(wxEVT_MOTION ) ; - } - - event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; - event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; - - Point localwhere ; - localwhere.h = x ; - localwhere.v = y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( (WindowRef)m_macWindow ) ) ; - ::GlobalToLocal( &localwhere ) ; - ::SetPort( port ) ; - - if ( kind == mouseDown ) - { - if ( timestamp - gs_lastWhen <= (long) GetDblTime() ) - { - if ( abs( localwhere.h - gs_lastWhere.h ) < 3 && abs( localwhere.v - gs_lastWhere.v ) < 3 ) - { - // This is not right if the second mouse down - // event occured in a differen window. We - // correct this in MacDispatchMouseEvent. - if ( controlDown ) - event.SetEventType(wxEVT_RIGHT_DCLICK ) ; - else - event.SetEventType(wxEVT_LEFT_DCLICK ) ; - } - gs_lastWhen = 0 ; - } - else - { - gs_lastWhen = timestamp ; - } - gs_lastWhere = localwhere ; - } - - event.m_x = localwhere.h; - event.m_y = localwhere.v; - event.m_x += m_x; - event.m_y += m_y; - - event.m_timeStamp = timestamp; - event.SetEventObject(this); - if ( wxTheApp->s_captureWindow ) - { - int x = event.m_x ; - int y = event.m_y ; - wxTheApp->s_captureWindow->ScreenToClient( &x , &y ) ; - event.m_x = x ; - event.m_y = y ; - event.SetEventObject( wxTheApp->s_captureWindow ) ; - wxTheApp->s_captureWindow->GetEventHandler()->ProcessEvent( event ) ; - - if ( kind == mouseUp ) - { - wxTheApp->s_captureWindow = NULL ; - if ( !wxIsBusy() ) - { - m_cursor.MacInstall() ; - } - } - } - else - { - MacDispatchMouseEvent( event ) ; - } -} - -#if !TARGET_CARBON - -void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part) -{ - MacFireMouseEvent( mouseDown , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; -} - -void wxTopLevelWindowMac::MacMouseUp( WXEVENTREF ev , short part) -{ - switch (part) - { - case inContent: - { - MacFireMouseEvent( mouseUp , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; - } - break ; - } -} - -void wxTopLevelWindowMac::MacMouseMoved( WXEVENTREF ev , short part) -{ - switch (part) - { - case inContent: - { - MacFireMouseEvent( nullEvent /*moved*/ , ((EventRecord*)ev)->where.h , ((EventRecord*)ev)->where.v , - ((EventRecord*)ev)->modifiers , ((EventRecord*)ev)->when ) ; - } - break ; - } -} - -#endif - -void wxTopLevelWindowMac::MacDelayedDeactivation(long timestamp) -{ - if(s_macDeactivateWindow) - { - wxLogDebug(wxT("Doing delayed deactivation of %p"),s_macDeactivateWindow); - s_macDeactivateWindow->MacActivate(timestamp, false); - } -} - -void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating ) -{ - // wxLogDebug(wxT("TopLevel=%p::MacActivate"),this); - - if(s_macDeactivateWindow==this) - s_macDeactivateWindow=NULL; - MacDelayedDeactivation(timestamp); - wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId); - event.m_timeStamp = timestamp ; - event.SetEventObject(this); - - GetEventHandler()->ProcessEvent(event); - - UMAHighlightAndActivateWindow( (WindowRef)m_macWindow , inIsActivating ) ; - - // Early versions of MacOS X don't refresh backgrounds properly, - // so refresh the whole window on activation and deactivation. - long osVersion = UMAGetSystemVersion(); - if (osVersion >= 0x1000 && osVersion < 0x1020 ) - { - Refresh(TRUE); - } - else - { - // for the moment we have to resolve some redrawing issues like this - // the OS is stealing some redrawing areas as soon as it draws a control - Refresh(TRUE); - } -} - -#if !TARGET_CARBON - -void wxTopLevelWindowMac::MacKeyDown( WXEVENTREF ev ) -{ -} - -#endif - -void wxTopLevelWindowMac::SetTitle(const wxString& title) -{ - wxWindow::SetTitle( title ) ; - UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ; -} - -bool wxTopLevelWindowMac::Show(bool show) -{ - if ( !wxWindow::Show(show) ) - return FALSE; - - if (show) - { - #if wxUSE_SYSTEM_OPTIONS //code contributed by Ryan Wilcox December 18, 2003 - if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) ) - { - ::ShowWindow( (WindowRef)m_macWindow ); - } - else - #endif - { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil); - } - ::SelectWindow( (WindowRef)m_macWindow ) ; - // no need to generate events here, they will get them triggered by macos - // actually they should be , but apparently they are not - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - else - { - #if wxUSE_SYSTEM_OPTIONS - if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) ) - { - ::HideWindow((WindowRef) m_macWindow ); - } - else - #endif - { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil); - } - } - - if ( !show ) - { - } - else - { - Refresh() ; - } - - return TRUE; -} - -void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ; - wxMacWindowClipper clip (this); - - int former_x = m_x ; - int former_y = m_y ; - int former_w = m_width ; - int former_h = m_height ; - - int actualWidth = width; - int actualHeight = height; - int actualX = x; - int actualY = y; - - if ((m_minWidth != -1) && (actualWidth < m_minWidth)) - actualWidth = m_minWidth; - if ((m_minHeight != -1) && (actualHeight < m_minHeight)) - actualHeight = m_minHeight; - if ((m_maxWidth != -1) && (actualWidth > m_maxWidth)) - actualWidth = m_maxWidth; - if ((m_maxHeight != -1) && (actualHeight > m_maxHeight)) - actualHeight = m_maxHeight; - - bool doMove = false ; - bool doResize = false ; - - if ( actualX != former_x || actualY != former_y ) - { - doMove = true ; - } - if ( actualWidth != former_w || actualHeight != former_h ) - { - doResize = true ; - } - - if ( doMove || doResize ) - { - m_x = actualX ; - m_y = actualY ; - - if ( doMove ) - ::MoveWindow((WindowRef)m_macWindow, m_x, m_y , false); // don't make frontmost - - m_width = actualWidth ; - m_height = actualHeight ; - - if ( doResize ) - ::SizeWindow((WindowRef)m_macWindow, m_width, m_height , true); - - // the OS takes care of invalidating and erasing the new area so we only have to - // take care of refreshing for full repaints - - if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) ) - Refresh() ; - - - if ( IsKindOf( CLASSINFO( wxFrame ) ) ) - { - wxFrame* frame = (wxFrame*) this ; -#if wxUSE_STATUSBAR - frame->PositionStatusBar(); -#endif -#if wxUSE_TOOLBAR - frame->PositionToolBar(); -#endif - } - if ( doMove ) - wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified - - MacRepositionScrollBars() ; - if ( doMove ) - { - wxPoint point(m_x, m_y); - wxMoveEvent event(point, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - if ( doResize ) - { - MacRepositionScrollBars() ; - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - -} - -/* - * Invalidation Mechanism - * - * The update mechanism reflects exactely the windows mechanism - * the rect gets added to the window invalidate region, if the eraseBackground flag - * has been true for any part of the update rgn the background is erased in the entire region - * not just in the specified rect. - * - * In order to achive this, we also have an internal m_macNoEraseUpdateRgn, all rects that have - * the eraseBackground flag set to false are also added to this rgn. upon receiving an update event - * the update rgn is compared to the m_macNoEraseUpdateRgn and in case they differ, every window - * will get the eraseBackground event first - */ - -void wxTopLevelWindowMac::MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) -{ - GrafPtr formerPort ; - GetPort( &formerPort ) ; - SetPortWindowPort( (WindowRef)m_macWindow ) ; - - m_macNeedsErasing |= eraseBackground ; - - // if we already know that we will have to erase, there's no need to track the rest - if ( !m_macNeedsErasing) - { - // we end only here if eraseBackground is false - // if we already have a difference between m_macNoEraseUpdateRgn and UpdateRgn - // we will have to erase anyway - - RgnHandle updateRgn = NewRgn(); - RgnHandle diffRgn = NewRgn() ; - if ( updateRgn && diffRgn ) - { - GetWindowUpdateRgn( (WindowRef)m_macWindow , updateRgn ); - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - OffsetRgn( updateRgn , -pt.h , -pt.v ) ; - DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ; - if ( !EmptyRgn( diffRgn ) ) - { - m_macNeedsErasing = true ; - } - } - if ( updateRgn ) - DisposeRgn( updateRgn ); - if ( diffRgn ) - DisposeRgn( diffRgn ); - - if ( !m_macNeedsErasing ) - { - RgnHandle rectRgn = NewRgn() ; - SetRectRgn( rectRgn , ((Rect*)rect)->left , ((Rect*)rect)->top , ((Rect*)rect)->right , ((Rect*)rect)->bottom ) ; - UnionRgn( (RgnHandle) m_macNoEraseUpdateRgn , rectRgn , (RgnHandle) m_macNoEraseUpdateRgn ) ; - DisposeRgn( rectRgn ) ; - } - } - InvalWindowRect( (WindowRef)m_macWindow , (Rect*)rect ) ; - // turn this on to debug the refreshing cycle -#if wxMAC_DEBUG_REDRAW - PaintRect( rect ) ; -#endif - SetPort( formerPort ) ; -} - - -bool wxTopLevelWindowMac::SetShape(const wxRegion& region) -{ - wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); - -#if TARGET_CARBON - // The empty region signifies that the shape should be removed from the - // window. - if ( region.IsEmpty() ) - { - wxSize sz = GetClientSize(); - wxRegion rgn(0, 0, sz.x, sz.y); - return SetShape(rgn); - } - - // Make a copy of the region - RgnHandle shapeRegion = NewRgn(); - CopyRgn( (RgnHandle)region.GetWXHRGN(), shapeRegion ); - - // Dispose of any shape region we may already have - RgnHandle oldRgn = (RgnHandle)GetWRefCon( (WindowRef)MacGetWindowRef() ); - if ( oldRgn ) - DisposeRgn(oldRgn); - - // Save the region so we can use it later - SetWRefCon((WindowRef)MacGetWindowRef(), (SInt32)shapeRegion); - - // Tell the window manager that the window has changed shape - ReshapeCustomWindow((WindowRef)MacGetWindowRef()); - return TRUE; -#else - return FALSE; -#endif -} - -// --------------------------------------------------------------------------- -// Support functions for shaped windows, based on Apple's CustomWindow sample at -// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm -// --------------------------------------------------------------------------- - -#if TARGET_CARBON - -static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect) -{ - GetWindowPortBounds(window, inRect); - Point pt = {inRect->left, inRect->top}; - SetPort((GrafPtr) GetWindowPort(window)); - LocalToGlobal(&pt); - inRect->top = pt.v; - inRect->left = pt.h; - inRect->bottom += pt.v; - inRect->right += pt.h; -} - - -static SInt32 wxShapedMacWindowGetFeatures(WindowRef window, SInt32 param) -{ - /*------------------------------------------------------ - Define which options your custom window supports. - --------------------------------------------------------*/ - //just enable everything for our demo - *(OptionBits*)param=//kWindowCanGrow| - //kWindowCanZoom| - //kWindowCanCollapse| - //kWindowCanGetWindowRegion| - //kWindowHasTitleBar| - //kWindowSupportsDragHilite| - kWindowCanDrawInCurrentPort| - //kWindowCanMeasureTitle| - kWindowWantsDisposeAtProcessDeath| - kWindowSupportsSetGrowImageRegion| - kWindowDefSupportsColorGrafPort; - return 1; -} - -// The content region is left as a rectangle matching the window size, this is -// so the origin in the paint event, and etc. still matches what the -// programmer expects. -static void wxShapedMacWindowContentRegion(WindowRef window, RgnHandle rgn) -{ - SetEmptyRgn(rgn); - wxTopLevelWindowMac* win = wxFindWinFromMacWindow(window); - if (win) - { - wxRect r = win->GetRect(); - SetRectRgn(rgn, r.GetLeft(), r.GetTop(), r.GetRight(), r.GetBottom()); - } -} - -// The structure region is set to the shape given to the SetShape method. -static void wxShapedMacWindowStructureRegion(WindowRef window, RgnHandle rgn) -{ - RgnHandle cachedRegion = (RgnHandle) GetWRefCon(window); - - SetEmptyRgn(rgn); - if (cachedRegion) - { - Rect windowRect; - wxShapedMacWindowGetPos(window, &windowRect); //how big is the window - CopyRgn(cachedRegion, rgn); //make a copy of our cached region - OffsetRgn(rgn, windowRect.left, windowRect.top); // position it over window - //MapRgn(rgn, &mMaskSize, &windowRect); //scale it to our actual window size - } -} - - - -static SInt32 wxShapedMacWindowGetRegion(WindowRef window, SInt32 param) -{ - GetWindowRegionPtr rgnRec=(GetWindowRegionPtr)param; - - switch(rgnRec->regionCode) - { - case kWindowStructureRgn: - wxShapedMacWindowStructureRegion(window, rgnRec->winRgn); - break; - case kWindowContentRgn: - wxShapedMacWindowContentRegion(window, rgnRec->winRgn); - break; - default: - SetEmptyRgn(rgnRec->winRgn); - } //switch - - return noErr; -} - - -static SInt32 wxShapedMacWindowHitTest(WindowRef window,SInt32 param) -{ - /*------------------------------------------------------ - Determine the region of the window which was hit - --------------------------------------------------------*/ - Point hitPoint; - static RgnHandle tempRgn=nil; - - if(!tempRgn) - tempRgn=NewRgn(); - - SetPt(&hitPoint,LoWord(param),HiWord(param));//get the point clicked - - //Mac OS 8.5 or later - wxShapedMacWindowStructureRegion(window, tempRgn); - if (PtInRgn(hitPoint, tempRgn)) //in window content region? - return wInContent; - - return wNoHit;//no significant area was hit. -} - - -static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param) -{ - switch(message) - { - case kWindowMsgHitTest: - return wxShapedMacWindowHitTest(window,param); - - case kWindowMsgGetFeatures: - return wxShapedMacWindowGetFeatures(window,param); - - // kWindowMsgGetRegion is sent during CreateCustomWindow and ReshapeCustomWindow - case kWindowMsgGetRegion: - return wxShapedMacWindowGetRegion(window,param); - } - - return 0; -} - -#endif -// --------------------------------------------------------------------------- - diff --git a/src/mac/classic/treectrl.cpp b/src/mac/classic/treectrl.cpp deleted file mode 100644 index 7a548a7436..0000000000 --- a/src/mac/classic/treectrl.cpp +++ /dev/null @@ -1,419 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp -// Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl. -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "treectrl.h" -#endif - -#include "wx/stubs/textctrl.h" -#include "wx/treebase.h" -#include "wx/stubs/treectrl.h" - -#if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxTreeItem, wxObject) - -#endif - -wxTreeCtrl::wxTreeCtrl() -{ - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; -} - -bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxValidator& validator, const wxString& name) -{ - SetName(name); - SetValidator(validator); - - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; - - m_windowStyle = style; - - SetParent(parent); - - m_windowId = (id == -1) ? NewControlId() : id; - - if (parent) parent->AddChild(this); - - // TODO create tree control - - return FALSE; -} - -wxTreeCtrl::~wxTreeCtrl() -{ - if (m_textCtrl) - { - delete m_textCtrl; - } -} - -// Attributes -int wxTreeCtrl::GetCount() const -{ - // TODO - return 0; -} - -int wxTreeCtrl::GetIndent() const -{ - // TODO - return 0; -} - -void wxTreeCtrl::SetIndent(int indent) -{ - // TODO -} - -wxImageList *wxTreeCtrl::GetImageList(int which) const -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - return m_imageListNormal; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - return m_imageListState; - } - return NULL; -} - -void wxTreeCtrl::SetImageList(wxImageList *imageList, int which) -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - m_imageListNormal = imageList; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - m_imageListState = imageList; - } - // TODO -} - -long wxTreeCtrl::GetNextItem(long item, int code) const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::ItemHasChildren(long item) const -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::GetChild(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetItemParent(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetFirstVisibleItem() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetNextVisibleItem(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetSelection() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetRootItem() const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::GetItem(wxTreeItem& info) const -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::SetItem(wxTreeItem& info) -{ - // TODO - return FALSE; -} - -int wxTreeCtrl::GetItemState(long item, long stateMask) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_stateMask = stateMask; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - - return info.m_state; -} - -bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_state = state; - info.m_stateMask = stateMask; - info.m_itemId = item; - - return SetItem(info); -} - -bool wxTreeCtrl::SetItemImage(long item, int image, int selImage) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_IMAGE ; - info.m_image = image; - if ( selImage > -1) - { - info.m_selectedImage = selImage; - info.m_mask |= wxTREE_MASK_SELECTED_IMAGE; - } - info.m_itemId = item; - - return SetItem(info); -} - -wxString wxTreeCtrl::GetItemText(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - - if (!GetItem(info)) - return wxString(""); - return info.m_text; -} - -void wxTreeCtrl::SetItemText(long item, const wxString& str) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - info.m_text = str; - - SetItem(info); -} - -long wxTreeCtrl::GetItemData(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - return info.m_data; -} - -bool wxTreeCtrl::SetItemData(long item, long data) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - info.m_data = data; - - return SetItem(info); -} - -bool wxTreeCtrl::GetItemRect(long item, wxRect& rect, bool textOnly) const -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::GetEditControl() const -{ - return m_textCtrl; -} - -// Operations -bool wxTreeCtrl::DeleteItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ExpandItem(long item, int action) -{ - // TODO - switch ( action ) - { - case wxTREE_EXPAND_EXPAND: - break; - - case wxTREE_EXPAND_COLLAPSE: - break; - - case wxTREE_EXPAND_COLLAPSE_RESET: - break; - - case wxTREE_EXPAND_TOGGLE: - break; - - default: - wxFAIL_MSG("unknown action in wxTreeCtrl::ExpandItem"); - } - - bool bOk = FALSE; // TODO expand item - - // May not send messages, so emulate them - if ( bOk ) { - wxTreeEvent event(wxEVT_NULL, m_windowId); - event.m_item.m_itemId = item; - event.m_item.m_mask = - event.m_item.m_stateMask = 0xffff; // get all - GetItem(event.m_item); - - bool bIsExpanded = (event.m_item.m_state & wxTREE_STATE_EXPANDED) != 0; - - event.m_code = action; - event.SetEventObject(this); - - // @@@ return values of {EXPAND|COLLAPS}ING event handler is discarded - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDING - : wxEVT_COMMAND_TREE_ITEM_COLLAPSING); - GetEventHandler()->ProcessEvent(event); - - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDED - : wxEVT_COMMAND_TREE_ITEM_COLLAPSED); - GetEventHandler()->ProcessEvent(event); - } - - return bOk; -} - -long wxTreeCtrl::InsertItem(long parent, wxTreeItem& info, long insertAfter) -{ - // TODO - return 0; -} - -long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image, int selImage, - long insertAfter) -{ - wxTreeItem info; - info.m_text = label; - info.m_mask = wxTREE_MASK_TEXT; - if ( image > -1 ) - { - info.m_mask |= wxTREE_MASK_IMAGE | wxTREE_MASK_SELECTED_IMAGE; - info.m_image = image; - if ( selImage == -1 ) - info.m_selectedImage = image; - else - info.m_selectedImage = selImage; - } - - return InsertItem(parent, info, insertAfter); -} - -bool wxTreeCtrl::SelectItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ScrollTo(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::EditLabel(long item, wxClassInfo* textControlClass) -{ - // TODO - return NULL; -} - -// End label editing, optionally cancelling the edit -bool wxTreeCtrl::EndEditLabel(bool cancel) -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::HitTest(const wxPoint& point, int& flags) -{ - // TODO - return 0; -} - -bool wxTreeCtrl::SortChildren(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::EnsureVisible(long item) -{ - // TODO - return FALSE; -} - -// Tree item structure -wxTreeItem::wxTreeItem() -{ - m_mask = 0; - m_itemId = 0; - m_state = 0; - m_stateMask = 0; - m_image = -1; - m_selectedImage = -1; - m_children = 0; - m_data = 0; -} - -// Tree event -IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxCommandEvent) - -wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ - m_code = 0; - m_oldItem = 0; -} - diff --git a/src/mac/classic/uma.cpp b/src/mac/classic/uma.cpp deleted file mode 100644 index 48a7599f04..0000000000 --- a/src/mac/classic/uma.cpp +++ /dev/null @@ -1,815 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uma.cpp -// Purpose: UMA support -// Author: Stefan Csomor -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: The wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/defs.h" - -#if wxUSE_GUI - -#include "wx/dc.h" -#include - -#ifndef __DARWIN__ -# include -# if defined(TARGET_CARBON) -# if PM_USE_SESSION_APIS -# include -# endif -# include -# else -# include -# endif -#endif - -#ifndef __DARWIN__ -#include -#endif -#include "wx/mac/uma.h" - - -// since we have decided that we only support 8.6 upwards we are -// checking for these minimum requirements in the startup code of -// the application so all wxWindows code can safely assume that appearance 1.1 -// windows manager, control manager, navigation services etc. are -// present - -static bool sUMAHasAppearance = false ; -static long sUMAAppearanceVersion = 0 ; -static long sUMASystemVersion = 0 ; -static bool sUMAHasAquaLayout = false ; - -static bool sUMAHasInittedAppearance = false; - -extern int gAGABackgroundColor ; -bool UMAHasAppearance() { return sUMAHasAppearance ; } -long UMAGetAppearanceVersion() { return sUMAAppearanceVersion ; } -long UMAGetSystemVersion() { return sUMASystemVersion ; } - -static bool sUMAHasWindowManager = false ; -static long sUMAWindowManagerAttr = 0 ; - -bool UMAHasWindowManager() { return sUMAHasWindowManager ; } -long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; } -bool UMAHasAquaLayout() { return sUMAHasAquaLayout ; } - - -void UMACleanupToolbox() -{ - if (sUMAHasInittedAppearance) - { - UnregisterAppearanceClient() ; - } - if ( NavServicesAvailable() ) - { - NavUnload() ; - } - if ( TXNTerminateTextension != (void*) kUnresolvedCFragSymbolAddress ) - TXNTerminateTextension( ) ; -} -void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded ) -{ -#if !TARGET_CARBON - ::MaxApplZone(); - for (long i = 1; i <= inMoreMastersCalls; i++) - ::MoreMasters(); - - if (!isEmbedded) - { - ::InitGraf(&qd.thePort); - ::InitFonts(); - ::InitMenus(); - ::TEInit(); - ::InitDialogs(0L); - ::FlushEvents(everyEvent, 0); - } - - long total,contig; - PurgeSpace(&total, &contig); -#endif - - ::InitCursor(); - - if ( Gestalt(gestaltSystemVersion, &sUMASystemVersion) != noErr) - sUMASystemVersion = 0x0000 ; - - long theAppearance ; - if ( Gestalt( gestaltAppearanceAttr, &theAppearance ) == noErr ) - { - sUMAHasAppearance = true ; - OSStatus status = RegisterAppearanceClient(); - // If status equals appearanceProcessRegisteredErr it means the - // appearance client already was registered (For example if we run - // embedded, the host might have registered it). In such a case - // we don't unregister it later on. - if (status != appearanceProcessRegisteredErr) - { - // Appearance client wasn't registered yet. - sUMAHasInittedAppearance = true; - } - - if ( Gestalt( gestaltAppearanceVersion, &theAppearance ) == noErr ) - { - sUMAAppearanceVersion = theAppearance ; - } - else - { - sUMAAppearanceVersion = 0x0100 ; - } - } - if ( Gestalt( gestaltWindowMgrAttr, &sUMAWindowManagerAttr ) == noErr ) - { - sUMAHasWindowManager = sUMAWindowManagerAttr & gestaltWindowMgrPresent ; - } - -#if TARGET_CARBON -// Call currently implicitely done : InitFloatingWindows() ; -#else - if (!isEmbedded) - { - if ( sUMAHasWindowManager ) - InitFloatingWindows() ; - else - InitWindows(); - } -#endif - - if ( NavServicesAvailable() ) - { - NavLoad() ; - } - - long menuMgrAttr ; - Gestalt( gestaltMenuMgrAttr , &menuMgrAttr ) ; - if ( menuMgrAttr & gestaltMenuMgrAquaLayoutMask ) - sUMAHasAquaLayout = true ; - - if ( TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress ) - { - FontFamilyID fontId ; - Str255 fontName ; - SInt16 fontSize ; - Style fontStyle ; - GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; - GetFNum( fontName, &fontId ); - - TXNMacOSPreferredFontDescription fontDescriptions[] = - { - { fontId , (fontSize << 16) ,kTXNDefaultFontStyle, kTXNSystemDefaultEncoding } - } ; - int noOfFontDescriptions = sizeof( fontDescriptions ) / sizeof(TXNMacOSPreferredFontDescription) ; - - // kTXNAlwaysUseQuickDrawTextMask might be desirable because of speed increases but it crashes the app under OS X upon key stroke -#if 0 - // leads to unexpected content for clients, TODO configurable - OptionBits options = kTXNWantMoviesMask | kTXNWantSoundMask | kTXNWantGraphicsMask ; -#else - OptionBits options = 0 ; -#endif - -#if TARGET_CARBON - if ( !UMAHasAquaLayout() ) -#endif - { - options |= kTXNAlwaysUseQuickDrawTextMask ; - } - TXNInitTextension(fontDescriptions, noOfFontDescriptions, options ); - } - - - UMASetSystemIsInitialized(true); - -} - -/* -Boolean CanUseATSUI() - { - long result; - OSErr err = Gestalt(gestaltATSUVersion, &result); - return (err == noErr); - } -*/ -// process manager -long UMAGetProcessMode() -{ - OSErr err ; - ProcessInfoRec processinfo; - ProcessSerialNumber procno ; - - procno.highLongOfPSN = NULL ; - procno.lowLongOfPSN = kCurrentProcess ; - processinfo.processInfoLength = sizeof(ProcessInfoRec); - processinfo.processName = NULL; - processinfo.processAppSpec = NULL; - - err = ::GetProcessInformation( &procno , &processinfo ) ; - wxASSERT( err == noErr ) ; - return processinfo.processMode ; -} - -bool UMAGetProcessModeDoesActivateOnFGSwitch() -{ - return UMAGetProcessMode() & modeDoesActivateOnFGSwitch ; -} - -// menu manager - -MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding ) -{ - wxString str = wxStripMenuCodes( title ) ; - MenuRef menu ; -#if TARGET_CARBON - CreateNewMenu( id , 0 , &menu ) ; - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding ) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - menu = ::NewMenu( id , ptitle ) ; -#endif - return menu ; -} - -void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding) -{ - wxString str = wxStripMenuCodes( title ) ; -#if TARGET_CARBON - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - SetMenuTitle( menu , ptitle ) ; -#endif -} - -void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding) -{ - wxString str = wxStripMenuCodes( title ) ; -#if TARGET_CARBON - SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( str , ptitle ) ; - SetMenuItemText( menu , item , ptitle ) ; -#endif -} - - -UInt32 UMAMenuEvent( EventRecord *inEvent ) -{ - return MenuEvent( inEvent ) ; -} - -void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex inItem , bool enable) -{ - if ( enable ) - EnableMenuItem( inMenu , inItem ) ; - else - DisableMenuItem( inMenu , inItem ) ; -} - -void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , SInt16 id ) -{ - MacAppendMenu(menu, "\pA"); - UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding ); - SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ; -} - -void UMAInsertSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , SInt16 id ) -{ - MacInsertMenuItem(menu, "\pA" , item); - UMASetMenuItemText(menu, item , title , encoding); - SetMenuItemHierarchicalID( menu , item , id ) ; -} - -void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry ) -{ - if ( !entry ) - return ; - - UInt8 modifiers = 0 ; - SInt16 key = entry->GetKeyCode() ; - if ( key ) - { - bool explicitCommandKey = false ; - - if ( entry->GetFlags() & wxACCEL_CTRL ) - { - explicitCommandKey = true ; - } - - if (entry->GetFlags() & wxACCEL_ALT ) - { - modifiers |= kMenuOptionModifier ; - } - - if (entry->GetFlags() & wxACCEL_SHIFT) - { - modifiers |= kMenuShiftModifier ; - } - - SInt16 glyph = 0 ; - SInt16 macKey = key ; - if ( key >= WXK_F1 && key <= WXK_F15 ) - { - // for some reasons this must be 0 right now - // everything else leads to just the first function key item - // to be selected. Thanks to Ryan Wilcox for finding out. - macKey = 0 ; - glyph = kMenuF1Glyph + ( key - WXK_F1 ) ; - if ( key >= WXK_F13 ) - glyph += 13 ; - if ( !explicitCommandKey ) - modifiers |= kMenuNoCommandModifier ; - } - else - { - switch( key ) - { - case WXK_BACK : - macKey = kBackspaceCharCode ; - glyph = kMenuDeleteLeftGlyph ; - break ; - case WXK_TAB : - macKey = kTabCharCode ; - glyph = kMenuTabRightGlyph ; - break ; - case kEnterCharCode : - macKey = kEnterCharCode ; - glyph = kMenuEnterGlyph ; - break ; - case WXK_RETURN : - macKey = kReturnCharCode ; - glyph = kMenuReturnGlyph ; - break ; - case WXK_ESCAPE : - macKey = kEscapeCharCode ; - glyph = kMenuEscapeGlyph ; - break ; - case WXK_SPACE : - macKey = ' ' ; - glyph = kMenuSpaceGlyph ; - break ; - case WXK_DELETE : - macKey = kDeleteCharCode ; - glyph = kMenuDeleteRightGlyph ; - break ; - case WXK_CLEAR : - macKey = kClearCharCode ; - glyph = kMenuClearGlyph ; - break ; - case WXK_PRIOR : // PAGE UP - macKey = kPageUpCharCode ; - glyph = kMenuPageUpGlyph ; - break ; - case WXK_NEXT : - macKey = kPageDownCharCode ; - glyph = kMenuPageDownGlyph ; - break ; - case WXK_LEFT : - macKey = kLeftArrowCharCode ; - glyph = kMenuLeftArrowGlyph ; - break ; - case WXK_UP : - macKey = kUpArrowCharCode ; - glyph = kMenuUpArrowGlyph ; - break ; - case WXK_RIGHT : - macKey = kRightArrowCharCode ; - glyph = kMenuRightArrowGlyph ; - break ; - case WXK_DOWN : - macKey = kDownArrowCharCode ; - glyph = kMenuDownArrowGlyph ; - break ; - } - } - - SetItemCmd( menu, item , macKey ); - SetMenuItemModifiers(menu, item , modifiers ) ; - - if ( glyph ) - SetMenuItemKeyGlyph(menu, item , glyph ) ; - } -} - -void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , wxAcceleratorEntry *entry ) -{ - MacAppendMenu(menu, "\pA"); - UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding ); - UMASetMenuItemShortcut( menu , (SInt16) ::CountMenuItems(menu), entry ) ; -} - -void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry ) -{ - MacInsertMenuItem( menu , "\pA" , item) ; - UMASetMenuItemText(menu, item+1 , title , encoding ); - UMASetMenuItemShortcut( menu , item+1 , entry ) ; -} - -// quickdraw - -#if !TARGET_CARBON - -int gPrOpenCounter = 0 ; - -OSStatus UMAPrOpen() -{ - OSErr err = noErr ; - ++gPrOpenCounter ; - if ( gPrOpenCounter == 1 ) - { - PrOpen() ; - err = PrError() ; - wxASSERT( err == noErr ) ; - } - return err ; -} - -OSStatus UMAPrClose() -{ - OSErr err = noErr ; - wxASSERT( gPrOpenCounter >= 1 ) ; - if ( gPrOpenCounter == 1 ) - { - PrClose() ; - err = PrError() ; - wxASSERT( err == noErr ) ; - } - --gPrOpenCounter ; - return err ; -} - -pascal QDGlobalsPtr GetQDGlobalsPtr (void) ; -pascal QDGlobalsPtr GetQDGlobalsPtr (void) -{ - return QDGlobalsPtr (* (Ptr*) LMGetCurrentA5 ( ) - 0xCA); -} - -#endif - -void UMAShowWatchCursor() -{ - OSErr err = noErr; - - CursHandle watchFob = GetCursor (watchCursor); - - if (!watchFob) - err = nilHandleErr; - else - { - #if TARGET_CARBON -// Cursor preservedArrow; -// GetQDGlobalsArrow (&preservedArrow); -// SetQDGlobalsArrow (*watchFob); -// InitCursor ( ); -// SetQDGlobalsArrow (&preservedArrow); - SetCursor (*watchFob); - #else - SetCursor (*watchFob); - #endif - } -} - -void UMAShowArrowCursor() -{ -#if TARGET_CARBON - Cursor arrow; - SetCursor (GetQDGlobalsArrow (&arrow)); -#else - SetCursor (&(qd.arrow)); -#endif -} - -// window manager - -GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) -{ - wxASSERT( inWindowRef != NULL ) ; -#if TARGET_CARBON - return (GrafPtr) GetWindowPort( inWindowRef ) ; -#else - return (GrafPtr) inWindowRef ; -#endif -} - -void UMADisposeWindow( WindowRef inWindowRef ) -{ - wxASSERT( inWindowRef != NULL ) ; - DisposeWindow( inWindowRef ) ; -} - -void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding) -{ -#if TARGET_CARBON - SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( title , ptitle ) ; - SetWTitle( inWindowRef , ptitle ) ; -#endif -} - -// appearance additions - -void UMASetControlTitle( ControlHandle inControl , const wxString& title , wxFontEncoding encoding) -{ -#if TARGET_CARBON - SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title , encoding) ) ; -#else - Str255 ptitle ; - wxMacStringToPascal( title , ptitle ) ; - SetControlTitle( inControl , ptitle ) ; -#endif -} - -void UMAActivateControl( ControlHandle inControl ) -{ - // we have to add the control after again to the update rgn - // otherwise updates get lost - if ( !IsControlActive( inControl ) ) - { - bool visible = IsControlVisible( inControl ) ; - if ( visible ) - SetControlVisibility( inControl , false , false ) ; - ::ActivateControl( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - } -} - -void UMADrawControl( ControlHandle inControl ) -{ - WindowRef theWindow = GetControlOwner(inControl) ; - wxMacPortStateHelper help( (GrafPtr) GetWindowPort(theWindow) ) ; - RgnHandle updateRgn = NewRgn() ; - GetWindowUpdateRgn( theWindow , updateRgn ) ; - Point zero = { 0 , 0 } ; - LocalToGlobal( &zero ) ; - OffsetRgn( updateRgn , -zero.h , -zero.v ) ; - ::DrawControlInCurrentPort( inControl ) ; - InvalWindowRgn( theWindow, updateRgn) ; - DisposeRgn( updateRgn ) ; -} - -void UMAMoveControl( ControlHandle inControl , short x , short y ) -{ - bool visible = IsControlVisible( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - ::MoveControl( inControl , x , y ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} - -void UMASizeControl( ControlHandle inControl , short x , short y ) -{ - bool visible = IsControlVisible( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } - ::SizeControl( inControl , x , y ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} - -void UMADeactivateControl( ControlHandle inControl ) -{ - // we have to add the control after again to the update rgn - // otherwise updates get lost - bool visible = IsControlVisible( inControl ) ; - if ( visible ) - SetControlVisibility( inControl , false , false ) ; - ::DeactivateControl( inControl ) ; - if ( visible ) { - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; - } -} -// shows the control and adds the region to the update region -void UMAShowControl (ControlHandle inControl) -{ - SetControlVisibility( inControl , true , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; -} - -// shows the control and adds the region to the update region -void UMAHideControl (ControlHandle inControl) -{ - SetControlVisibility( inControl , false , false ) ; - Rect ctrlBounds ; - InvalWindowRect(GetControlOwner(inControl),GetControlBounds(inControl,&ctrlBounds) ) ; -} -// keyboard focus -OSErr UMASetKeyboardFocus (WindowPtr inWindow, - ControlHandle inControl, - ControlFocusPart inPart) -{ - OSErr err = noErr; - GrafPtr port ; - GetPort( &port ) ; - - SetPortWindowPort( inWindow ) ; - - err = SetKeyboardFocus( inWindow , inControl , inPart ) ; - SetPort( port ) ; - return err ; -} - - -// events -void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) -{ - wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) inWindow) ) ; - RgnHandle updateRgn = NewRgn() ; - GetWindowUpdateRgn( inWindow , updateRgn ) ; - - Point zero = { 0 , 0 } ; - LocalToGlobal( &zero ) ; - OffsetRgn( updateRgn , -zero.h , -zero.v ) ; - - UpdateControls( inWindow , inRgn ) ; - InvalWindowRgn( inWindow, updateRgn) ; - DisposeRgn( updateRgn ) ; -} - -bool UMAIsWindowFloating( WindowRef inWindow ) -{ - WindowClass cl ; - - GetWindowClass( inWindow , &cl ) ; - return cl == kFloatingWindowClass ; -} - -bool UMAIsWindowModal( WindowRef inWindow ) -{ - WindowClass cl ; - - GetWindowClass( inWindow , &cl ) ; - return cl < kFloatingWindowClass ; -} - -// others - -void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) -{ - if ( inWindowRef ) - { -// bool isHighlighted = IsWindowHighlited( inWindowRef ) ; -// if ( inActivate != isHightlited ) - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort( inWindowRef ) ; - HiliteWindow( inWindowRef , inActivate ) ; - ControlHandle control = NULL ; - ::GetRootControl( inWindowRef , & control ) ; - if ( control ) - { - if ( inActivate ) - UMAActivateControl( control ) ; - else - UMADeactivateControl( control ) ; - } - SetPort( port ) ; - } -} - -OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) -{ - return ::DrawThemePlacard( inRect , inState ) ; -} - -#if !TARGET_CARBON -static OSStatus helpMenuStatus = noErr ; -static MenuItemIndex firstCustomItemIndex = 0 ; -#endif - -OSStatus UMAGetHelpMenu( - MenuRef * outHelpMenu, - MenuItemIndex * outFirstCustomItemIndex) -{ -#if TARGET_CARBON - return HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ; -#else - MenuRef helpMenuHandle ; - helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ; - if ( firstCustomItemIndex == 0 && helpMenuStatus == noErr ) - { - firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ; - } - if ( outFirstCustomItemIndex ) - { - *outFirstCustomItemIndex = firstCustomItemIndex ; - } - *outHelpMenu = helpMenuHandle ; - return helpMenuStatus ; -#endif -} - -wxMacPortStateHelper::wxMacPortStateHelper( GrafPtr newport) -{ - m_clip = NULL ; - Setup( newport ) ; -} - -wxMacPortStateHelper::wxMacPortStateHelper() -{ - m_clip = NULL ; -} - -void wxMacPortStateHelper::Setup( GrafPtr newport ) -{ - GetPort( &m_oldPort ) ; - SetPort( newport ) ; - SetOrigin(0,0); - wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ; - m_clip = NewRgn() ; - GetClip( m_clip ); - m_textFont = GetPortTextFont( (CGrafPtr) newport); - m_textSize = GetPortTextSize( (CGrafPtr) newport); - m_textStyle = GetPortTextFace( (CGrafPtr) newport); - m_textMode = GetPortTextMode( (CGrafPtr) newport); - GetThemeDrawingState( &m_drawingState ) ; - m_currentPort = newport ; -} -void wxMacPortStateHelper::Clear() -{ - if ( m_clip ) - { - DisposeRgn( m_clip ) ; - DisposeThemeDrawingState( m_drawingState ) ; - m_clip = NULL ; - } -} - -wxMacPortStateHelper::~wxMacPortStateHelper() -{ - if ( m_clip ) - { - SetPort( m_currentPort ) ; - SetClip( m_clip ) ; - DisposeRgn( m_clip ) ; - TextFont( m_textFont ); - TextSize( m_textSize ); - TextFace( m_textStyle ); - TextMode( m_textMode ); - SetThemeDrawingState( m_drawingState , true ) ; - SetPort( m_oldPort ) ; - } -} - -OSStatus UMAPutScrap( Size size , OSType type , void *data ) -{ - OSStatus err = noErr ; -#if !TARGET_CARBON - err = PutScrap( size , type , data ) ; -#else - ScrapRef scrap; - err = GetCurrentScrap (&scrap); - if ( !err ) - { - err = PutScrapFlavor (scrap, type , 0, size, data); - } -#endif - return err ; -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -static bool sUMASystemInitialized = false ; - -bool UMASystemIsInitialized() -{ - return sUMASystemInitialized ; -} - -void UMASetSystemIsInitialized(bool val) -{ - sUMASystemInitialized = val; -} - - -#endif // wxUSE_BASE diff --git a/src/mac/classic/utils.cpp b/src/mac/classic/utils.cpp deleted file mode 100644 index b64f77fae0..0000000000 --- a/src/mac/classic/utils.cpp +++ /dev/null @@ -1,1395 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp -// Purpose: Various utilities -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -// Note: this is done in utilscmn.cpp now. -// #pragma implementation "utils.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/apptrait.h" - -#if wxUSE_GUI - #include "wx/mac/uma.h" - #include "wx/font.h" -#else - #include "wx/intl.h" -#endif - -#include - -#include -#include -#include -#include - -#ifdef __DARWIN__ -# include "MoreFilesX.h" -#else -# include "MoreFiles.h" -# include "MoreFilesExtras.h" -#endif - -#ifndef __DARWIN__ -#include -#include -#endif - -#include -#include -#include - -#include "wx/mac/private.h" // includes mac headers - -#if defined(__MWERKS__) && wxUSE_UNICODE - #include -#endif - -// --------------------------------------------------------------------------- -// code used in both base and GUI compilation -// --------------------------------------------------------------------------- - -// our OS version is the same in non GUI and GUI cases -static int DoGetOSVersion(int *majorVsn, int *minorVsn) -{ - long theSystem ; - - // are there x-platform conventions ? - - Gestalt(gestaltSystemVersion, &theSystem) ; - if (minorVsn != NULL) { - *minorVsn = (theSystem & 0xFF ) ; - } - if (majorVsn != NULL) { - *majorVsn = (theSystem >> 8 ) ; - } -#ifdef __DARWIN__ - return wxMAC_DARWIN; -#else - return wxMAC; -#endif -} - -#if wxUSE_BASE - -#ifndef __DARWIN__ -// defined in unix/utilsunx.cpp for Mac OS X - -// get full hostname (with domain name if possible) -bool wxGetFullHostName(wxChar *buf, int maxSize) -{ - return wxGetHostName(buf, maxSize); -} - -// Get hostname only (without domain name) -bool wxGetHostName(wxChar *buf, int maxSize) -{ - // Gets Chooser name of user by examining a System resource. - - const short kComputerNameID = -16413; - - short oldResFile = CurResFile() ; - UseResFile(0); - StringHandle chooserName = (StringHandle)::GetString(kComputerNameID); - UseResFile(oldResFile); - - if (chooserName && *chooserName) - { - HLock( (Handle) chooserName ) ; - wxString name = wxMacMakeStringFromPascal( *chooserName ) ; - HUnlock( (Handle) chooserName ) ; - ReleaseResource( (Handle) chooserName ) ; - wxStrncpy( buf , name , maxSize - 1 ) ; - } - else - buf[0] = 0 ; - - return TRUE; -} - -// Get user ID e.g. jacs -bool wxGetUserId(wxChar *buf, int maxSize) -{ - return wxGetUserName( buf , maxSize ) ; -} - -const wxChar* wxGetHomeDir(wxString *pstr) -{ - *pstr = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ; - return pstr->c_str() ; -} - -// Get user name e.g. Stefan Csomor -bool wxGetUserName(wxChar *buf, int maxSize) -{ - // Gets Chooser name of user by examining a System resource. - - const short kChooserNameID = -16096; - - short oldResFile = CurResFile() ; - UseResFile(0); - StringHandle chooserName = (StringHandle)::GetString(kChooserNameID); - UseResFile(oldResFile); - - if (chooserName && *chooserName) - { - HLock( (Handle) chooserName ) ; - wxString name = wxMacMakeStringFromPascal( *chooserName ) ; - HUnlock( (Handle) chooserName ) ; - ReleaseResource( (Handle) chooserName ) ; - wxStrncpy( buf , name , maxSize - 1 ) ; - } - else - buf[0] = 0 ; - - return TRUE; -} - -int wxKill(long pid, wxSignal sig , wxKillError *rc ) -{ - // TODO - return 0; -} - -WXDLLEXPORT bool wxGetEnv(const wxString& var, wxString *value) -{ - // TODO : under classic there is no environement support, under X yes - return false ; -} - -// set the env var name to the given value, return TRUE on success -WXDLLEXPORT bool wxSetEnv(const wxString& var, const wxChar *value) -{ - // TODO : under classic there is no environement support, under X yes - return false ; -} - -// -// Execute a program in an Interactive Shell -// -bool wxShell(const wxString& command) -{ - // TODO - return FALSE; -} - -// Shutdown or reboot the PC -bool wxShutdown(wxShutdownFlags wFlags) -{ - // TODO - return FALSE; -} - -// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -long wxGetFreeMemory() -{ - return FreeMem() ; -} - -void wxUsleep(unsigned long milliseconds) -{ - clock_t start = clock() ; - do - { - YieldToAnyThread() ; - } while( clock() - start < milliseconds / 1000.0 * CLOCKS_PER_SEC ) ; -} - -void wxSleep(int nSecs) -{ - wxUsleep(1000*nSecs); -} - -// Consume all events until no more left -void wxFlushEvents() -{ -} - -#endif // !__DARWIN__ - -// Emit a beeeeeep -void wxBell() -{ - SysBeep(30); -} - -wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo() -{ - static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); - info.name = _T("wxBase"); - return info; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() -{ - static wxToolkitInfo info; - info.os = DoGetOSVersion(&info.versionMajor, &info.versionMinor); - info.shortName = _T("mac"); - info.name = _T("wxMac"); -#ifdef __WXUNIVERSAL__ - info.shortName << _T("univ"); - info.name << _T("/wxUniversal"); -#endif - return info; -} - -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%.4f"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%ld"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%d"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} -#endif // wxUSE_RESOURCES - -int gs_wxBusyCursorCount = 0; -extern wxCursor gMacCurrentCursor ; -wxCursor gMacStoredActiveCursor ; - -// Set the cursor to the busy cursor for all windows -void wxBeginBusyCursor(wxCursor *cursor) -{ - if (gs_wxBusyCursorCount++ == 0) - { - gMacStoredActiveCursor = gMacCurrentCursor ; - cursor->MacInstall() ; - } - //else: nothing to do, already set -} - -// Restore cursor to normal -void wxEndBusyCursor() -{ - wxCHECK_RET( gs_wxBusyCursorCount > 0, - wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()") ); - - if (--gs_wxBusyCursorCount == 0) - { - gMacStoredActiveCursor.MacInstall() ; - gMacStoredActiveCursor = wxNullCursor ; - } -} - -// TRUE if we're between the above two calls -bool wxIsBusy() -{ - return (gs_wxBusyCursorCount > 0); -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -wxString wxMacFindFolder( short vol, - OSType folderType, - Boolean createFolder) -{ - short vRefNum ; - long dirID ; - wxString strDir ; - - if ( FindFolder( vol, folderType, createFolder, &vRefNum, &dirID) == noErr) - { - FSSpec file ; - if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr ) - { - strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ; - } - } - return strDir ; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -// Check whether this window wants to process messages, e.g. Stop button -// in long calculations. -bool wxCheckForInterrupt(wxWindow *wnd) -{ - // TODO - return FALSE; -} - -void wxGetMousePosition( int* x, int* y ) -{ - Point pt ; - - GetMouse( &pt ) ; - LocalToGlobal( &pt ) ; - *x = pt.h ; - *y = pt.v ; -}; - -// Return TRUE if we have a colour display -bool wxColourDisplay() -{ - return TRUE; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - Rect globRect ; - SetRect(&globRect, -32760, -32760, 32760, 32760); - GDHandle theMaxDevice; - - int theDepth = 8; - theMaxDevice = GetMaxDevice(&globRect); - if (theMaxDevice != nil) - theDepth = (**(**theMaxDevice).gdPMap).pixelSize; - - return theDepth ; -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - if (width != NULL) { - *width = screenBits.bounds.right - screenBits.bounds.left ; - } - if (height != NULL) { - *height = screenBits.bounds.bottom - screenBits.bounds.top ; - } -} - -void wxDisplaySizeMM(int *width, int *height) -{ - wxDisplaySize(width, height); - // on mac 72 is fixed (at least now ;-) - float cvPt2Mm = 25.4 / 72; - - if (width != NULL) { - *width = int( *width * cvPt2Mm ); - } - if (height != NULL) { - *height = int( *height * cvPt2Mm ); - } -} - -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ -#if TARGET_CARBON - Rect r ; - GetAvailableWindowPositioningBounds( GetMainDevice() , &r ) ; - if ( x ) - *x = r.left ; - if ( y ) - *y = r.top ; - if ( width ) - *width = r.right - r.left ; - if ( height ) - *height = r.bottom - r.top ; -#else - BitMap screenBits; - GetQDGlobalsScreenBits( &screenBits ); - - if (x) *x = 0; - if (y) *y = 0; - - if (width != NULL) { - *width = screenBits.bounds.right - screenBits.bounds.left ; - } - if (height != NULL) { - *height = screenBits.bounds.bottom - screenBits.bounds.top ; - } - - SInt16 mheight ; -#if TARGET_CARBON - GetThemeMenuBarHeight( &mheight ) ; -#else - mheight = LMGetMBarHeight() ; -#endif - if (height != NULL) { - *height -= mheight ; - } - if (y) - *y = mheight ; -#endif -} - -wxWindow* wxFindWindowAtPoint(const wxPoint& pt) -{ - return wxGenericFindWindowAtPoint(pt); -} - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -wxString wxGetOsDescription() -{ -#ifdef WXWIN_OS_DESCRIPTION - // use configure generated description if available - return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION) + wxString(wxT(")")); -#else - return wxT("MacOS") ; //TODO:define further -#endif -} - -#ifndef __DARWIN__ -wxChar *wxGetUserHome (const wxString& user) -{ - // TODO - return NULL; -} - -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) -{ - if ( path.empty() ) - return FALSE; - - wxString p = path ; - if (p[0u] == ':' ) { - p = wxGetCwd() + p ; - } - - int pos = p.Find(':') ; - if ( pos != wxNOT_FOUND ) { - p = p.Mid(1,pos) ; - } - - p = p + wxT(":") ; - - Str255 volumeName ; - XVolumeParam pb ; - - wxMacStringToPascal( p , volumeName ) ; - OSErr err = XGetVolumeInfoNoName( volumeName , 0 , &pb ) ; - if ( err == noErr ) { - if ( pTotal ) { - (*pTotal) = wxLongLong( pb.ioVTotalBytes ) ; - } - if ( pFree ) { - (*pFree) = wxLongLong( pb.ioVFreeBytes ) ; - } - } - - return err == noErr ; -} -#endif // !__DARWIN__ - -//--------------------------------------------------------------------------- -// wxMac Specific utility functions -//--------------------------------------------------------------------------- - -void wxMacStringToPascal( const wxString&from , StringPtr to ) -{ - wxCharBuffer buf = from.mb_str( wxConvLocal ) ; - int len = strlen(buf) ; - - if ( len > 255 ) - len = 255 ; - to[0] = len ; - memcpy( (char*) &to[1] , buf , len ) ; -} - -wxString wxMacMakeStringFromPascal( ConstStringPtr from ) -{ - return wxString( (char*) &from[1] , wxConvLocal , from[0] ) ; -} - - -wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) -{ - TextEncodingBase enc = 0 ; - if ( encoding == wxFONTENCODING_DEFAULT ) - { -#if wxUSE_GUI - encoding = wxFont::GetDefaultEncoding() ; -#else - encoding = wxLocale::GetSystemEncoding() ; -#endif - } - - switch( encoding) - { - case wxFONTENCODING_ISO8859_1 : - enc = kTextEncodingISOLatin1 ; - break ; - case wxFONTENCODING_ISO8859_2 : - enc = kTextEncodingISOLatin2; - break ; - case wxFONTENCODING_ISO8859_3 : - enc = kTextEncodingISOLatin3 ; - break ; - case wxFONTENCODING_ISO8859_4 : - enc = kTextEncodingISOLatin4; - break ; - case wxFONTENCODING_ISO8859_5 : - enc = kTextEncodingISOLatinCyrillic; - break ; - case wxFONTENCODING_ISO8859_6 : - enc = kTextEncodingISOLatinArabic; - break ; - case wxFONTENCODING_ISO8859_7 : - enc = kTextEncodingISOLatinGreek; - break ; - case wxFONTENCODING_ISO8859_8 : - enc = kTextEncodingISOLatinHebrew; - break ; - case wxFONTENCODING_ISO8859_9 : - enc = kTextEncodingISOLatin5; - break ; - case wxFONTENCODING_ISO8859_10 : - enc = kTextEncodingISOLatin6; - break ; - case wxFONTENCODING_ISO8859_13 : - enc = kTextEncodingISOLatin7; - break ; - case wxFONTENCODING_ISO8859_14 : - enc = kTextEncodingISOLatin8; - break ; - case wxFONTENCODING_ISO8859_15 : - enc = kTextEncodingISOLatin9; - break ; - - case wxFONTENCODING_KOI8 : - enc = kTextEncodingKOI8_R; - break ; - case wxFONTENCODING_ALTERNATIVE : // MS-DOS CP866 - enc = kTextEncodingDOSRussian; - break ; -/* - case wxFONTENCODING_BULGARIAN : - enc = ; - break ; -*/ - case wxFONTENCODING_CP437 : - enc =kTextEncodingDOSLatinUS ; - break ; - case wxFONTENCODING_CP850 : - enc = kTextEncodingDOSLatin1; - break ; - case wxFONTENCODING_CP852 : - enc = kTextEncodingDOSLatin2; - break ; - case wxFONTENCODING_CP855 : - enc = kTextEncodingDOSCyrillic; - break ; - case wxFONTENCODING_CP866 : - enc =kTextEncodingDOSRussian ; - break ; - case wxFONTENCODING_CP874 : - enc = kTextEncodingDOSThai; - break ; - case wxFONTENCODING_CP932 : - enc = kTextEncodingDOSJapanese; - break ; - case wxFONTENCODING_CP936 : - enc =kTextEncodingDOSChineseSimplif ; - break ; - case wxFONTENCODING_CP949 : - enc = kTextEncodingDOSKorean; - break ; - case wxFONTENCODING_CP950 : - enc = kTextEncodingDOSChineseTrad; - break ; - - case wxFONTENCODING_CP1250 : - enc = kTextEncodingWindowsLatin2; - break ; - case wxFONTENCODING_CP1251 : - enc =kTextEncodingWindowsCyrillic ; - break ; - case wxFONTENCODING_CP1252 : - enc =kTextEncodingWindowsLatin1 ; - break ; - case wxFONTENCODING_CP1253 : - enc = kTextEncodingWindowsGreek; - break ; - case wxFONTENCODING_CP1254 : - enc = kTextEncodingWindowsLatin5; - break ; - case wxFONTENCODING_CP1255 : - enc =kTextEncodingWindowsHebrew ; - break ; - case wxFONTENCODING_CP1256 : - enc =kTextEncodingWindowsArabic ; - break ; - case wxFONTENCODING_CP1257 : - enc = kTextEncodingWindowsBalticRim; - break ; - - case wxFONTENCODING_UTF7 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF7Format) ; - break ; - case wxFONTENCODING_UTF8 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF8Format) ; - break ; - case wxFONTENCODING_EUC_JP : - enc = kTextEncodingEUC_JP; - break ; - case wxFONTENCODING_UTF16BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF16LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF32BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - case wxFONTENCODING_UTF32LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - - case wxFONTENCODING_MACROMAN : - enc = kTextEncodingMacRoman ; - break ; - case wxFONTENCODING_MACJAPANESE : - enc = kTextEncodingMacJapanese ; - break ; - case wxFONTENCODING_MACCHINESETRAD : - enc = kTextEncodingMacChineseTrad ; - break ; - case wxFONTENCODING_MACKOREAN : - enc = kTextEncodingMacKorean ; - break ; - case wxFONTENCODING_MACARABIC : - enc = kTextEncodingMacArabic ; - break ; - case wxFONTENCODING_MACHEBREW : - enc = kTextEncodingMacHebrew ; - break ; - case wxFONTENCODING_MACGREEK : - enc = kTextEncodingMacGreek ; - break ; - case wxFONTENCODING_MACCYRILLIC : - enc = kTextEncodingMacCyrillic ; - break ; - case wxFONTENCODING_MACDEVANAGARI : - enc = kTextEncodingMacDevanagari ; - break ; - case wxFONTENCODING_MACGURMUKHI : - enc = kTextEncodingMacGurmukhi ; - break ; - case wxFONTENCODING_MACGUJARATI : - enc = kTextEncodingMacGujarati ; - break ; - case wxFONTENCODING_MACORIYA : - enc = kTextEncodingMacOriya ; - break ; - case wxFONTENCODING_MACBENGALI : - enc = kTextEncodingMacBengali ; - break ; - case wxFONTENCODING_MACTAMIL : - enc = kTextEncodingMacTamil ; - break ; - case wxFONTENCODING_MACTELUGU : - enc = kTextEncodingMacTelugu ; - break ; - case wxFONTENCODING_MACKANNADA : - enc = kTextEncodingMacKannada ; - break ; - case wxFONTENCODING_MACMALAJALAM : - enc = kTextEncodingMacMalayalam ; - break ; - case wxFONTENCODING_MACSINHALESE : - enc = kTextEncodingMacSinhalese ; - break ; - case wxFONTENCODING_MACBURMESE : - enc = kTextEncodingMacBurmese ; - break ; - case wxFONTENCODING_MACKHMER : - enc = kTextEncodingMacKhmer ; - break ; - case wxFONTENCODING_MACTHAI : - enc = kTextEncodingMacThai ; - break ; - case wxFONTENCODING_MACLAOTIAN : - enc = kTextEncodingMacLaotian ; - break ; - case wxFONTENCODING_MACGEORGIAN : - enc = kTextEncodingMacGeorgian ; - break ; - case wxFONTENCODING_MACARMENIAN : - enc = kTextEncodingMacArmenian ; - break ; - case wxFONTENCODING_MACCHINESESIMP : - enc = kTextEncodingMacChineseSimp ; - break ; - case wxFONTENCODING_MACTIBETAN : - enc = kTextEncodingMacTibetan ; - break ; - case wxFONTENCODING_MACMONGOLIAN : - enc = kTextEncodingMacMongolian ; - break ; - case wxFONTENCODING_MACETHIOPIC : - enc = kTextEncodingMacEthiopic ; - break ; - case wxFONTENCODING_MACCENTRALEUR : - enc = kTextEncodingMacCentralEurRoman ; - break ; - case wxFONTENCODING_MACVIATNAMESE : - enc = kTextEncodingMacVietnamese ; - break ; - case wxFONTENCODING_MACARABICEXT : - enc = kTextEncodingMacExtArabic ; - break ; - case wxFONTENCODING_MACSYMBOL : - enc = kTextEncodingMacSymbol ; - break ; - case wxFONTENCODING_MACDINGBATS : - enc = kTextEncodingMacDingbats ; - break ; - case wxFONTENCODING_MACTURKISH : - enc = kTextEncodingMacTurkish ; - break ; - case wxFONTENCODING_MACCROATIAN : - enc = kTextEncodingMacCroatian ; - break ; - case wxFONTENCODING_MACICELANDIC : - enc = kTextEncodingMacIcelandic ; - break ; - case wxFONTENCODING_MACROMANIAN : - enc = kTextEncodingMacRomanian ; - break ; - case wxFONTENCODING_MACCELTIC : - enc = kTextEncodingMacCeltic ; - break ; - case wxFONTENCODING_MACGAELIC : - enc = kTextEncodingMacGaelic ; - break ; - case wxFONTENCODING_MACKEYBOARD : - enc = kTextEncodingMacKeyboardGlyphs ; - break ; - default : - // to make gcc happy - break ; - } ; - return enc ; -} - -wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) -{ - wxFontEncoding enc = wxFONTENCODING_DEFAULT ; - - switch( encoding) - { - case kTextEncodingISOLatin1 : - enc = wxFONTENCODING_ISO8859_1 ; - break ; - case kTextEncodingISOLatin2 : - enc = wxFONTENCODING_ISO8859_2; - break ; - case kTextEncodingISOLatin3 : - enc = wxFONTENCODING_ISO8859_3 ; - break ; - case kTextEncodingISOLatin4 : - enc = wxFONTENCODING_ISO8859_4; - break ; - case kTextEncodingISOLatinCyrillic : - enc = wxFONTENCODING_ISO8859_5; - break ; - case kTextEncodingISOLatinArabic : - enc = wxFONTENCODING_ISO8859_6; - break ; - case kTextEncodingISOLatinGreek : - enc = wxFONTENCODING_ISO8859_7; - break ; - case kTextEncodingISOLatinHebrew : - enc = wxFONTENCODING_ISO8859_8; - break ; - case kTextEncodingISOLatin5 : - enc = wxFONTENCODING_ISO8859_9; - break ; - case kTextEncodingISOLatin6 : - enc = wxFONTENCODING_ISO8859_10; - break ; - case kTextEncodingISOLatin7 : - enc = wxFONTENCODING_ISO8859_13; - break ; - case kTextEncodingISOLatin8 : - enc = wxFONTENCODING_ISO8859_14; - break ; - case kTextEncodingISOLatin9 : - enc =wxFONTENCODING_ISO8859_15 ; - break ; - - case kTextEncodingKOI8_R : - enc = wxFONTENCODING_KOI8; - break ; -/* - case : - enc = wxFONTENCODING_BULGARIAN; - break ; -*/ - case kTextEncodingDOSLatinUS : - enc = wxFONTENCODING_CP437; - break ; - case kTextEncodingDOSLatin1 : - enc = wxFONTENCODING_CP850; - break ; - case kTextEncodingDOSLatin2 : - enc =wxFONTENCODING_CP852 ; - break ; - case kTextEncodingDOSCyrillic : - enc = wxFONTENCODING_CP855; - break ; - case kTextEncodingDOSRussian : - enc = wxFONTENCODING_CP866; - break ; - case kTextEncodingDOSThai : - enc =wxFONTENCODING_CP874 ; - break ; - case kTextEncodingDOSJapanese : - enc = wxFONTENCODING_CP932; - break ; - case kTextEncodingDOSChineseSimplif : - enc = wxFONTENCODING_CP936; - break ; - case kTextEncodingDOSKorean : - enc = wxFONTENCODING_CP949; - break ; - case kTextEncodingDOSChineseTrad : - enc = wxFONTENCODING_CP950; - break ; - - case kTextEncodingWindowsLatin2 : - enc = wxFONTENCODING_CP1250; - break ; - case kTextEncodingWindowsCyrillic : - enc = wxFONTENCODING_CP1251; - break ; - case kTextEncodingWindowsLatin1 : - enc = wxFONTENCODING_CP1252; - break ; - case kTextEncodingWindowsGreek : - enc = wxFONTENCODING_CP1253; - break ; - case kTextEncodingWindowsLatin5 : - enc = wxFONTENCODING_CP1254; - break ; - case kTextEncodingWindowsHebrew : - enc = wxFONTENCODING_CP1255; - break ; - case kTextEncodingWindowsArabic : - enc = wxFONTENCODING_CP1256; - break ; - case kTextEncodingWindowsBalticRim : - enc =wxFONTENCODING_CP1257 ; - break ; - case kTextEncodingEUC_JP : - enc = wxFONTENCODING_EUC_JP; - break ; - /* - case wxFONTENCODING_UTF7 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF7Format) ; - break ; - case wxFONTENCODING_UTF8 : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF8Format) ; - break ; - case wxFONTENCODING_UTF16BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF16LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - break ; - case wxFONTENCODING_UTF32BE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - case wxFONTENCODING_UTF32LE : - enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ; - break ; - */ - case kTextEncodingMacRoman : - enc = wxFONTENCODING_MACROMAN ; - break ; - case kTextEncodingMacJapanese : - enc = wxFONTENCODING_MACJAPANESE ; - break ; - case kTextEncodingMacChineseTrad : - enc = wxFONTENCODING_MACCHINESETRAD ; - break ; - case kTextEncodingMacKorean : - enc = wxFONTENCODING_MACKOREAN ; - break ; - case kTextEncodingMacArabic : - enc =wxFONTENCODING_MACARABIC ; - break ; - case kTextEncodingMacHebrew : - enc = wxFONTENCODING_MACHEBREW ; - break ; - case kTextEncodingMacGreek : - enc = wxFONTENCODING_MACGREEK ; - break ; - case kTextEncodingMacCyrillic : - enc = wxFONTENCODING_MACCYRILLIC ; - break ; - case kTextEncodingMacDevanagari : - enc = wxFONTENCODING_MACDEVANAGARI ; - break ; - case kTextEncodingMacGurmukhi : - enc = wxFONTENCODING_MACGURMUKHI ; - break ; - case kTextEncodingMacGujarati : - enc = wxFONTENCODING_MACGUJARATI ; - break ; - case kTextEncodingMacOriya : - enc =wxFONTENCODING_MACORIYA ; - break ; - case kTextEncodingMacBengali : - enc =wxFONTENCODING_MACBENGALI ; - break ; - case kTextEncodingMacTamil : - enc = wxFONTENCODING_MACTAMIL ; - break ; - case kTextEncodingMacTelugu : - enc = wxFONTENCODING_MACTELUGU ; - break ; - case kTextEncodingMacKannada : - enc = wxFONTENCODING_MACKANNADA ; - break ; - case kTextEncodingMacMalayalam : - enc = wxFONTENCODING_MACMALAJALAM ; - break ; - case kTextEncodingMacSinhalese : - enc = wxFONTENCODING_MACSINHALESE ; - break ; - case kTextEncodingMacBurmese : - enc = wxFONTENCODING_MACBURMESE ; - break ; - case kTextEncodingMacKhmer : - enc = wxFONTENCODING_MACKHMER ; - break ; - case kTextEncodingMacThai : - enc = wxFONTENCODING_MACTHAI ; - break ; - case kTextEncodingMacLaotian : - enc = wxFONTENCODING_MACLAOTIAN ; - break ; - case kTextEncodingMacGeorgian : - enc = wxFONTENCODING_MACGEORGIAN ; - break ; - case kTextEncodingMacArmenian : - enc = wxFONTENCODING_MACARMENIAN ; - break ; - case kTextEncodingMacChineseSimp : - enc = wxFONTENCODING_MACCHINESESIMP ; - break ; - case kTextEncodingMacTibetan : - enc = wxFONTENCODING_MACTIBETAN ; - break ; - case kTextEncodingMacMongolian : - enc = wxFONTENCODING_MACMONGOLIAN ; - break ; - case kTextEncodingMacEthiopic : - enc = wxFONTENCODING_MACETHIOPIC ; - break ; - case kTextEncodingMacCentralEurRoman: - enc = wxFONTENCODING_MACCENTRALEUR ; - break ; - case kTextEncodingMacVietnamese: - enc = wxFONTENCODING_MACVIATNAMESE ; - break ; - case kTextEncodingMacExtArabic : - enc = wxFONTENCODING_MACARABICEXT ; - break ; - case kTextEncodingMacSymbol : - enc = wxFONTENCODING_MACSYMBOL ; - break ; - case kTextEncodingMacDingbats : - enc = wxFONTENCODING_MACDINGBATS ; - break ; - case kTextEncodingMacTurkish : - enc = wxFONTENCODING_MACTURKISH ; - break ; - case kTextEncodingMacCroatian : - enc = wxFONTENCODING_MACCROATIAN ; - break ; - case kTextEncodingMacIcelandic : - enc = wxFONTENCODING_MACICELANDIC ; - break ; - case kTextEncodingMacRomanian : - enc = wxFONTENCODING_MACROMANIAN ; - break ; - case kTextEncodingMacCeltic : - enc = wxFONTENCODING_MACCELTIC ; - break ; - case kTextEncodingMacGaelic : - enc = wxFONTENCODING_MACGAELIC ; - break ; - case kTextEncodingMacKeyboardGlyphs : - enc = wxFONTENCODING_MACKEYBOARD ; - break ; - } ; - return enc ; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - - -// -// CFStringRefs (Carbon only) -// - -#if TARGET_CARBON - -// converts this string into a carbon foundation string with optional pc 2 mac encoding -void wxMacCFStringHolder::Assign( const wxString &st , wxFontEncoding encoding ) -{ - Release() ; - - wxString str = st ; - wxMacConvertNewlines13To10( &str ) ; -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault, - (UniChar*)str.wc_str() , str.Len() ); -#else - wxMBConvUTF16BE converter ; - size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ; - UniChar *unibuf = new UniChar[ unicharlen / sizeof(UniChar) + 1 ] ; - converter.WC2MB( (char*)unibuf , str.wc_str() , unicharlen ) ; - m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault , - unibuf , unicharlen / sizeof(UniChar) ) ; - delete[] unibuf ; -#endif -#else // not wxUSE_UNICODE - m_cfs = CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() , - wxMacGetSystemEncFromFontEnc( encoding ) ) ; -#endif - m_release = true ; -} - -wxString wxMacCFStringHolder::AsString(wxFontEncoding encoding) -{ - Size cflen = CFStringGetLength( m_cfs ) ; - size_t noChars ; - wxChar* buf = NULL ; - -#if wxUSE_UNICODE -#if SIZEOF_WCHAR_T == 2 - buf = new wxChar[ cflen + 1 ] ; - CFStringGetCharacters( m_cfs , CFRangeMake( 0 , cflen ) , (UniChar*) buf ) ; - noChars = cflen ; -#else - UniChar* unibuf = new UniChar[ cflen + 1 ] ; - CFStringGetCharacters( m_cfs , CFRangeMake( 0 , cflen ) , (UniChar*) unibuf ) ; - unibuf[cflen] = 0 ; - wxMBConvUTF16BE converter ; - noChars = converter.MB2WC( NULL , (const char*)unibuf , 0 ) ; - buf = new wxChar[ noChars + 1 ] ; - converter.MB2WC( buf , (const char*)unibuf , noChars ) ; - delete[] unibuf ; -#endif -#else - CFIndex cStrLen ; - CFStringGetBytes( m_cfs , CFRangeMake(0, cflen) , wxMacGetSystemEncFromFontEnc( encoding ) , - '?' , false , NULL , 0 , &cStrLen ) ; - buf = new wxChar[ cStrLen + 1 ] ; - CFStringGetBytes( m_cfs , CFRangeMake(0, cflen) , wxMacGetSystemEncFromFontEnc( encoding ) , - '?' , false , (unsigned char*) buf , cStrLen , &cStrLen) ; - noChars = cStrLen ; -#endif - - buf[noChars] = 0 ; - wxMacConvertNewlines10To13( buf ) ; - wxString result(buf) ; - delete[] buf ; - return result ; -} - -#endif //TARGET_CARBON - -void wxMacConvertNewlines13To10( char * data ) -{ - char * buf = data ; - while( (buf=strchr(buf,0x0d)) != NULL ) - { - *buf = 0x0a ; - buf++ ; - } -} - -void wxMacConvertNewlines10To13( char * data ) -{ - char * buf = data ; - while( (buf=strchr(buf,0x0a)) != NULL ) - { - *buf = 0x0d ; - buf++ ; - } -} - -void wxMacConvertNewlines13To10( wxString * data ) -{ - size_t len = data->Length() ; - - if ( len == 0 || wxStrchr(data->c_str(),0x0d)==NULL) - return ; - - wxString temp(*data) ; - wxStringBuffer buf(*data,len ) ; - memcpy( buf , temp.c_str() , (len+1)*sizeof(wxChar) ) ; - - wxMacConvertNewlines13To10( buf ) ; -} - -void wxMacConvertNewlines10To13( wxString * data ) -{ - size_t len = data->Length() ; - - if ( data->Length() == 0 || wxStrchr(data->c_str(),0x0a)==NULL) - return ; - - wxString temp(*data) ; - wxStringBuffer buf(*data,len ) ; - memcpy( buf , temp.c_str() , (len+1)*sizeof(wxChar) ) ; - wxMacConvertNewlines10To13( buf ) ; -} - - -#if wxUSE_UNICODE -void wxMacConvertNewlines13To10( wxChar * data ) -{ - wxChar * buf = data ; - while( (buf=wxStrchr(buf,0x0d)) != NULL ) - { - *buf = 0x0a ; - buf++ ; - } -} - -void wxMacConvertNewlines10To13( wxChar * data ) -{ - wxChar * buf = data ; - while( (buf=wxStrchr(buf,0x0a)) != NULL ) - { - *buf = 0x0d ; - buf++ ; - } -} -#endif - -// ---------------------------------------------------------------------------- -// debugging support -// ---------------------------------------------------------------------------- - -#if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400) - -// MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds... - -#ifndef __MetroNubUtils__ -#include "MetroNubUtils.h" -#endif - -#ifndef __GESTALT__ -#include -#endif - -#if TARGET_API_MAC_CARBON - - #include - - extern "C" long CallUniversalProc(UniversalProcPtr theProcPtr, ProcInfoType procInfo, ...); - - ProcPtr gCallUniversalProc_Proc = NULL; - -#endif - -static MetroNubUserEntryBlock* gMetroNubEntry = NULL; - -static long fRunOnce = false; - -/* --------------------------------------------------------------------------- - IsMetroNubInstalled - --------------------------------------------------------------------------- */ - -Boolean IsMetroNubInstalled() -{ - if (!fRunOnce) - { - long result, value; - - fRunOnce = true; - gMetroNubEntry = NULL; - - if (Gestalt(gestaltSystemVersion, &value) == noErr && value < 0x1000) - { - /* look for MetroNub's Gestalt selector */ - if (Gestalt(kMetroNubUserSignature, &result) == noErr) - { - - #if TARGET_API_MAC_CARBON - if (gCallUniversalProc_Proc == NULL) - { - CFragConnectionID connectionID; - Ptr mainAddress; - Str255 errorString; - ProcPtr symbolAddress; - OSErr err; - CFragSymbolClass symbolClass; - - symbolAddress = NULL; - err = GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch, kFindCFrag, - &connectionID, &mainAddress, errorString); - - if (err != noErr) - { - gCallUniversalProc_Proc = NULL; - goto end; - } - - err = FindSymbol(connectionID, "\pCallUniversalProc", - (Ptr *) &gCallUniversalProc_Proc, &symbolClass); - - if (err != noErr) - { - gCallUniversalProc_Proc = NULL; - goto end; - } - } - #endif - - { - MetroNubUserEntryBlock* block = (MetroNubUserEntryBlock *)result; - - /* make sure the version of the API is compatible */ - if (block->apiLowVersion <= kMetroNubUserAPIVersion && - kMetroNubUserAPIVersion <= block->apiHiVersion) - gMetroNubEntry = block; /* success! */ - } - - } - } - } - -end: - -#if TARGET_API_MAC_CARBON - return (gMetroNubEntry != NULL && gCallUniversalProc_Proc != NULL); -#else - return (gMetroNubEntry != NULL); -#endif -} - -/* --------------------------------------------------------------------------- - IsMWDebuggerRunning [v1 API] - --------------------------------------------------------------------------- */ - -Boolean IsMWDebuggerRunning() -{ - if (IsMetroNubInstalled()) - return CallIsDebuggerRunningProc(gMetroNubEntry->isDebuggerRunning); - else - return false; -} - -/* --------------------------------------------------------------------------- - AmIBeingMWDebugged [v1 API] - --------------------------------------------------------------------------- */ - -Boolean AmIBeingMWDebugged() -{ - if (IsMetroNubInstalled()) - return CallAmIBeingDebuggedProc(gMetroNubEntry->amIBeingDebugged); - else - return false; -} - -extern bool WXDLLEXPORT wxIsDebuggerRunning() -{ - return IsMWDebuggerRunning() && AmIBeingMWDebugged(); -} - -#else - -extern bool WXDLLEXPORT wxIsDebuggerRunning() -{ - return false; -} - -#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) - -#endif // wxUSE_GUI - diff --git a/src/mac/classic/utilsexc.cpp b/src/mac/classic/utilsexc.cpp deleted file mode 100644 index f270694d38..0000000000 --- a/src/mac/classic/utilsexc.cpp +++ /dev/null @@ -1,223 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utilsexec.cpp -// Purpose: Execution-related utilities -// Author: Stefan Csomor -// Modified by: David Elliott -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -//#pragma implementation -#endif - -#include "wx/log.h" -#include "wx/utils.h" -#ifdef __DARWIN__ -#include "wx/unix/execute.h" -#include -#include -extern "C" { -#include -} -#include -#endif - -#include -#include -#include - -#ifndef __DARWIN__ -#define wxEXECUTE_WIN_MESSAGE 10000 - -#include "wx/mac/private.h" - -/* -Below FinderLaunch function comes from: -http://developer.apple.com/technotes/tn/tn1002.html#fndrask -*/ - /* FinderLaunch converts a list of nTargets FSSpec records - pointed to by the targetList parameter and converts the - list to an Apple Event. It then sends that event to the - Finder. The array of FSSpec records pointed to by the - targetList parameter may contain references to files, - folders, or applications. The net effect of this command - is equivalent to the user selecting an icon in one of the - Finder's windows and then choosing the open command from - the Finder's file menu. */ -static OSErr FinderLaunch(long nTargets, FSSpec *targetList) { - OSErr err; - AppleEvent theAEvent, theReply; - AEAddressDesc fndrAddress; - AEDescList targetListDesc; - OSType fndrCreator; - Boolean wasChanged; - AliasHandle targetAlias; - long index; - - /* set up locals */ - AECreateDesc(typeNull, NULL, 0, &theAEvent); - AECreateDesc(typeNull, NULL, 0, &fndrAddress); - AECreateDesc(typeNull, NULL, 0, &theReply); - AECreateDesc(typeNull, NULL, 0, &targetListDesc); - targetAlias = NULL; - fndrCreator = 'MACS'; - - /* verify parameters */ - if ((nTargets == 0) || (targetList == NULL)) { - err = paramErr; - goto bail; - } - - /* create an open documents event targeting the - finder */ - err = AECreateDesc(typeApplSignature, (Ptr) &fndrCreator, - sizeof(fndrCreator), &fndrAddress); - if (err != noErr) goto bail; - err = AECreateAppleEvent(kCoreEventClass, kAEOpenDocuments, - &fndrAddress, kAutoGenerateReturnID, - kAnyTransactionID, &theAEvent); - if (err != noErr) goto bail; - - /* create the list of files to open */ - err = AECreateList(NULL, 0, false, &targetListDesc); - if (err != noErr) goto bail; - for ( index=0; index < nTargets; index++) { - if (targetAlias == NULL) - err = NewAlias(NULL, (targetList + index), - &targetAlias); - else err = UpdateAlias(NULL, (targetList + index), - targetAlias, &wasChanged); - if (err != noErr) goto bail; - HLock((Handle) targetAlias); - err = AEPutPtr(&targetListDesc, (index + 1), - typeAlias, *targetAlias, - GetHandleSize((Handle) targetAlias)); - HUnlock((Handle) targetAlias); - if (err != noErr) goto bail; - } - - /* add the file list to the Apple Event */ - err = AEPutParamDesc(&theAEvent, keyDirectObject, - &targetListDesc); - if (err != noErr) goto bail; - - /* send the event to the Finder */ - err = AESend(&theAEvent, &theReply, kAENoReply, - kAENormalPriority, kAEDefaultTimeout, NULL, NULL); - - /* clean up and leave */ -bail: - if (targetAlias != NULL) DisposeHandle((Handle) targetAlias); - AEDisposeDesc(&targetListDesc); - AEDisposeDesc(&theAEvent); - AEDisposeDesc(&fndrAddress); - AEDisposeDesc(&theReply); - return err; -} - -long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler)) -{ - wxASSERT_MSG( flags == wxEXEC_ASYNC, - wxT("wxExecute: Only wxEXEC_ASYNC is supported") ); - - FSSpec fsSpec; - wxMacFilename2FSSpec(command, &fsSpec); - - // 0 means execution failed. Returning non-zero is a PID, but not - // on Mac where PIDs are 64 bits and won't fit in a long, so we - // return a dummy value for now. - return ( FinderLaunch(1 /*one file*/, &fsSpec) == noErr ) ? -1 : 0; -} - -#endif - -#ifdef __DARWIN__ -void wxMAC_MachPortEndProcessDetect(CFMachPortRef port, void *data) -{ - wxEndProcessData *proc_data = (wxEndProcessData*)data; - wxLogDebug(wxT("Wow.. this actually worked!")); - int status = 0; - int rc = waitpid(abs(proc_data->pid), &status, WNOHANG); - if(!rc) - { - wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!")); - return; - } - if((rc != -1) && WIFEXITED(status)) - proc_data->exitcode = WEXITSTATUS(status); - else - proc_data->exitcode = -1; - wxHandleProcessTermination(proc_data); -} - -int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid) -{ - if(pid < 1) - return -1; - kern_return_t kernResult; - mach_port_t taskOfOurProcess; - mach_port_t machPortForProcess; - taskOfOurProcess = mach_task_self(); - if(taskOfOurProcess == MACH_PORT_NULL) - { - wxLogDebug(wxT("No mach_task_self()")); - return -1; - } - wxLogDebug(wxT("pid=%d"),pid); - kernResult = task_for_pid(taskOfOurProcess,pid, &machPortForProcess); - if(kernResult != KERN_SUCCESS) - { - wxLogDebug(wxT("no task_for_pid()")); - // try seeing if it is already dead or something - // FIXME: a better method would be to call the callback function - // from idle time until the process terminates. Of course, how - // likely is it that it will take more than 0.1 seconds for the - // mach terminate event to make its way to the BSD subsystem? - usleep(100); // sleep for 0.1 seconds - wxMAC_MachPortEndProcessDetect(NULL, (void*)proc_data); - return -1; - } - CFMachPortContext termcb_contextinfo; - termcb_contextinfo.version = NULL; - termcb_contextinfo.info = (void*)proc_data; - termcb_contextinfo.retain = NULL; - termcb_contextinfo.release = NULL; - termcb_contextinfo.copyDescription = NULL; - CFMachPortRef CFMachPortForProcess; - Boolean ShouldFreePort; - CFMachPortForProcess = CFMachPortCreateWithPort(NULL, machPortForProcess, NULL, &termcb_contextinfo, &ShouldFreePort); - if(!CFMachPortForProcess) - { - wxLogDebug(wxT("No CFMachPortForProcess")); - mach_port_deallocate(taskOfOurProcess, machPortForProcess); - return -1; - } - if(ShouldFreePort) - { - kernResult = mach_port_deallocate(taskOfOurProcess, machPortForProcess); - if(kernResult!=KERN_SUCCESS) - { - wxLogDebug(wxT("Couldn't deallocate mach port")); - return -1; - } - } - CFMachPortSetInvalidationCallBack(CFMachPortForProcess, &wxMAC_MachPortEndProcessDetect); - CFRunLoopSourceRef runloopsource; - runloopsource = CFMachPortCreateRunLoopSource(NULL,CFMachPortForProcess, (CFIndex)0); - if(!runloopsource) - { - wxLogDebug(wxT("Couldn't create runloopsource")); - return -1; - } - - CFRelease(CFMachPortForProcess); - - CFRunLoopAddSource(CFRunLoopGetCurrent(),runloopsource,kCFRunLoopDefaultMode); - CFRelease(runloopsource); - wxLogDebug(wxT("Successfully added notification to the runloop")); - return 0; -} -#endif diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp deleted file mode 100644 index a5c56e4202..0000000000 --- a/src/mac/classic/window.cpp +++ /dev/null @@ -1,2096 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp -// Purpose: wxWindowMac -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// RCS-ID: $Id$ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "window.h" -#endif - -#include "wx/setup.h" -#include "wx/menu.h" -#include "wx/window.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/panel.h" -#include "wx/layout.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/scrolbar.h" -#include "wx/statbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" -#include "wx/frame.h" -#include "wx/notebook.h" -#include "wx/tabctrl.h" -#include "wx/tooltip.h" -#include "wx/statusbr.h" -#include "wx/menuitem.h" -#include "wx/spinctrl.h" -#include "wx/log.h" -#include "wx/geometry.h" - -#if wxUSE_CARET - #include "wx/caret.h" -#endif // wxUSE_CARET - -#define wxWINDOW_HSCROLL 5998 -#define wxWINDOW_VSCROLL 5997 -#define MAC_SCROLLBAR_SIZE 16 - -#include "wx/mac/uma.h" -#ifndef __DARWIN__ -#include -#include -#endif - -#if wxUSE_DRAG_AND_DROP -#include "wx/dnd.h" -#endif - -#include - -extern wxList wxPendingDelete; -wxWindowMac* gFocusWindow = NULL ; - -#ifdef __WXUNIVERSAL__ - IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase) -#else // __WXMAC__ - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) -#endif // __WXUNIVERSAL__/__WXMAC__ - -#if !USE_SHARED_LIBRARY - -BEGIN_EVENT_TABLE(wxWindowMac, wxWindowBase) - EVT_NC_PAINT(wxWindowMac::OnNcPaint) - EVT_ERASE_BACKGROUND(wxWindowMac::OnEraseBackground) - EVT_SYS_COLOUR_CHANGED(wxWindowMac::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindowMac::OnInitDialog) - EVT_SET_FOCUS(wxWindowMac::OnSetFocus) - EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent) -END_EVENT_TABLE() - -#endif - -#define wxMAC_DEBUG_REDRAW 0 -#ifndef wxMAC_DEBUG_REDRAW -#define wxMAC_DEBUG_REDRAW 0 -#endif - -#define wxMAC_USE_THEME_BORDER 0 - - -// =========================================================================== -// implementation -// =========================================================================== - - -// ---------------------------------------------------------------------------- -// constructors and such -// ---------------------------------------------------------------------------- - -void wxWindowMac::Init() -{ - m_backgroundTransparent = FALSE; - - // as all windows are created with WS_VISIBLE style... - m_isShown = TRUE; - - m_x = 0; - m_y = 0 ; - m_width = 0 ; - m_height = 0 ; - - m_hScrollBar = NULL ; - m_vScrollBar = NULL ; -} - -// Destructor -wxWindowMac::~wxWindowMac() -{ - SendDestroyEvent(); - - // deleting a window while it is shown invalidates the region - if ( IsShown() ) { - wxWindowMac* iter = this ; - while( iter ) { - if ( iter->IsTopLevel() ) - { - Refresh() ; - break ; - } - iter = iter->GetParent() ; - - } - } - - m_isBeingDeleted = TRUE; - -#ifndef __WXUNIVERSAL__ - // VS: make sure there's no wxFrame with last focus set to us: - for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) - { - wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - { - frame->SetLastFocus((wxWindow*)NULL); - } - break; - } - } -#endif // __WXUNIVERSAL__ - - if ( s_lastMouseWindow == this ) - { - s_lastMouseWindow = NULL ; - } - - wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ; - if ( frame ) - { - if ( frame->GetLastFocus() == this ) - frame->SetLastFocus( NULL ) ; - } - - if ( gFocusWindow == this ) - { - gFocusWindow = NULL ; - } - - DestroyChildren(); - - // delete our drop target if we've got one -#if wxUSE_DRAG_AND_DROP - if ( m_dropTarget != NULL ) - { - delete m_dropTarget; - m_dropTarget = NULL; - } -#endif // wxUSE_DRAG_AND_DROP -} - -// Constructor -bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindowMac without parent") ); - -#if wxUSE_STATBOX - // wxGTK doesn't allow to create controls with static box as the parent so - // this will result in a crash when the program is ported to wxGTK - warn - // about it - // - // the correct solution is to create the controls as siblings of the - // static box - wxASSERT_MSG( !wxDynamicCast(parent, wxStaticBox), - _T("wxStaticBox can't be used as a window parent!") ); -#endif // wxUSE_STATBOX - - if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; - - parent->AddChild(this); - - m_x = (int)pos.x; - m_y = (int)pos.y; - AdjustForParentClientOrigin(m_x, m_y, wxSIZE_USE_EXISTING); - m_width = WidthDefault( size.x ); - m_height = HeightDefault( size.y ) ; -#ifndef __WXUNIVERSAL__ - // Don't give scrollbars to wxControls unless they ask for them - if ( (! IsKindOf(CLASSINFO(wxControl)) && ! IsKindOf(CLASSINFO(wxStatusBar))) || - (IsKindOf(CLASSINFO(wxControl)) && ( style & wxHSCROLL || style & wxVSCROLL))) - { - MacCreateScrollBars( style ) ; - } -#endif - - wxWindowCreateEvent event(this); - GetEventHandler()->AddPendingEvent(event); - - return TRUE; -} - -void wxWindowMac::SetFocus() -{ - if ( gFocusWindow == this ) - return ; - - if ( AcceptsFocus() ) - { - if (gFocusWindow ) - { -#if wxUSE_CARET - // Deal with caret - if ( gFocusWindow->m_caret ) - { - gFocusWindow->m_caret->OnKillFocus(); - } -#endif // wxUSE_CARET -#ifndef __WXUNIVERSAL__ - wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; - if ( control && control->GetMacControl() ) - { - UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNoPart ) ; - control->MacRedrawControl() ; - } -#endif - // Without testing the window id, for some reason - // a kill focus event can still be sent to - // the control just being focussed. - int thisId = this->m_windowId; - int gFocusWindowId = gFocusWindow->m_windowId; - if (gFocusWindowId != thisId) - { - wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId); - event.SetEventObject(gFocusWindow); - gFocusWindow->GetEventHandler()->ProcessEvent(event) ; - } - } - gFocusWindow = this ; - { - #if wxUSE_CARET - // Deal with caret - if ( m_caret ) - { - m_caret->OnSetFocus(); - } - #endif // wxUSE_CARET - // panel wants to track the window which was the last to have focus in it - wxChildFocusEvent eventFocus(this); - GetEventHandler()->ProcessEvent(eventFocus); - - #ifndef __WXUNIVERSAL__ - wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; - if ( control && control->GetMacControl() ) - { - UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetRootWindow() , (ControlHandle) control->GetMacControl() , kControlFocusNextPart ) ; - } - #endif - wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - } -} - -bool wxWindowMac::Enable(bool enable) -{ - if ( !wxWindowBase::Enable(enable) ) - return FALSE; - - MacSuperEnabled( enable ) ; - - return TRUE; -} - -void wxWindowMac::DoCaptureMouse() -{ - wxTheApp->s_captureWindow = this ; -} - -wxWindow* wxWindowBase::GetCapture() -{ - return wxTheApp->s_captureWindow ; -} - -void wxWindowMac::DoReleaseMouse() -{ - wxTheApp->s_captureWindow = NULL ; -} - -#if wxUSE_DRAG_AND_DROP - -void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget) -{ - if ( m_dropTarget != 0 ) { - delete m_dropTarget; - } - - m_dropTarget = pDropTarget; - if ( m_dropTarget != 0 ) - { - // TODO - } -} - -#endif - -// Old style file-manager drag&drop -void wxWindowMac::DragAcceptFiles(bool accept) -{ - // TODO -} - -// Get total size -void wxWindowMac::DoGetSize(int *x, int *y) const -{ - if(x) *x = m_width ; - if(y) *y = m_height ; -} - -void wxWindowMac::DoGetPosition(int *x, int *y) const -{ - int xx,yy; - - xx = m_x ; - yy = m_y ; - if ( !IsTopLevel() && GetParent()) - { - wxPoint pt(GetParent()->GetClientAreaOrigin()); - xx -= pt.x; - yy -= pt.y; - } - if(x) *x = xx; - if(y) *y = yy; -} - -#if wxUSE_MENUS -bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) -{ - menu->SetInvokingWindow(this); - menu->UpdateUI(); - ClientToScreen( &x , &y ) ; - - menu->MacBeforeDisplay( true ) ; - long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ; - if ( HiWord(menuResult) != 0 ) - { - MenuCommand id ; - GetMenuItemCommandID( GetMenuHandle(HiWord(menuResult)) , LoWord(menuResult) , &id ) ; - wxMenuItem* item = NULL ; - wxMenu* realmenu ; - item = menu->FindItem(id, &realmenu) ; - if (item->IsCheckable()) - { - item->Check( !item->IsChecked() ) ; - } - menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; - } - menu->MacAfterDisplay( true ) ; - - menu->SetInvokingWindow(NULL); - - return TRUE; -} -#endif - -void wxWindowMac::DoScreenToClient(int *x, int *y) const -{ - WindowRef window = (WindowRef) MacGetRootWindow() ; - - Point localwhere = {0,0} ; - - if(x) localwhere.h = * x ; - if(y) localwhere.v = * y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - ::GlobalToLocal( &localwhere ) ; - ::SetPort( port ) ; - - if(x) *x = localwhere.h ; - if(y) *y = localwhere.v ; - - MacRootWindowToWindow( x , y ) ; - if ( x ) - *x -= MacGetLeftBorderSize() ; - if ( y ) - *y -= MacGetTopBorderSize() ; -} - -void wxWindowMac::DoClientToScreen(int *x, int *y) const -{ - WindowRef window = (WindowRef) MacGetRootWindow() ; - - if ( x ) - *x += MacGetLeftBorderSize() ; - if ( y ) - *y += MacGetTopBorderSize() ; - - MacWindowToRootWindow( x , y ) ; - - Point localwhere = { 0,0 }; - if(x) localwhere.h = * x ; - if(y) localwhere.v = * y ; - - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - - ::LocalToGlobal( &localwhere ) ; - ::SetPort( port ) ; - if(x) *x = localwhere.h ; - if(y) *y = localwhere.v ; -} - -void wxWindowMac::MacClientToRootWindow( int *x , int *y ) const -{ - wxPoint origin = GetClientAreaOrigin() ; - if(x) *x += origin.x ; - if(y) *y += origin.y ; - - MacWindowToRootWindow( x , y ) ; -} - -void wxWindowMac::MacRootWindowToClient( int *x , int *y ) const -{ - wxPoint origin = GetClientAreaOrigin() ; - MacRootWindowToWindow( x , y ) ; - if(x) *x -= origin.x ; - if(y) *y -= origin.y ; -} - -void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const -{ - if ( !IsTopLevel() ) - { - if(x) *x += m_x ; - if(y) *y += m_y ; - GetParent()->MacWindowToRootWindow( x , y ) ; - } -} - -void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const -{ - if ( !IsTopLevel() ) - { - if(x) *x -= m_x ; - if(y) *y -= m_y ; - GetParent()->MacRootWindowToWindow( x , y ) ; - } -} - -bool wxWindowMac::SetCursor(const wxCursor& cursor) -{ - if (m_cursor == cursor) - return FALSE; - - if (wxNullCursor == cursor) - { - if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) ) - return FALSE ; - } - else - { - if ( ! wxWindowBase::SetCursor( cursor ) ) - return FALSE ; - } - - wxASSERT_MSG( m_cursor.Ok(), - wxT("cursor must be valid after call to the base version")); - - Point pt ; - wxWindowMac *mouseWin ; - GetMouse( &pt ) ; - - // Change the cursor NOW if we're within the correct window - - if ( MacGetWindowFromPoint( wxPoint( pt.h , pt.v ) , &mouseWin ) ) - { - if ( mouseWin == this && !wxIsBusy() ) - { - m_cursor.MacInstall() ; - } - } - - return TRUE ; -} - - -// Get size *available for subwindows* i.e. excluding menu bar etc. -void wxWindowMac::DoGetClientSize(int *x, int *y) const -{ - int ww, hh; - ww = m_width ; - hh = m_height ; - - ww -= MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ; - hh -= MacGetTopBorderSize( ) + MacGetBottomBorderSize( ); - - if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) ) - { - int x1 = 0 ; - int y1 = 0 ; - int w = m_width ; - int h = m_height ; - - MacClientToRootWindow( &x1 , &y1 ) ; - MacClientToRootWindow( &w , &h ) ; - - wxWindowMac *iter = (wxWindowMac*)this ; - - int totW = 10000 , totH = 10000; - while( iter ) - { - if ( iter->IsTopLevel() ) - { - totW = iter->m_width ; - totH = iter->m_height ; - break ; - } - - iter = iter->GetParent() ; - } - - if (m_hScrollBar && m_hScrollBar->IsShown() ) - { - hh -= MAC_SCROLLBAR_SIZE; - if ( h-y1 >= totH ) - { - hh += 1 ; - } - } - if (m_vScrollBar && m_vScrollBar->IsShown() ) - { - ww -= MAC_SCROLLBAR_SIZE; - if ( w-x1 >= totW ) - { - ww += 1 ; - } - } - } - if(x) *x = ww; - if(y) *y = hh; -} - - -// ---------------------------------------------------------------------------- -// tooltips -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLTIPS - -void wxWindowMac::DoSetToolTip(wxToolTip *tooltip) -{ - wxWindowBase::DoSetToolTip(tooltip); - - if ( m_tooltip ) - m_tooltip->SetWindow(this); -} - -#endif // wxUSE_TOOLTIPS - -void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) -{ - int former_x = m_x ; - int former_y = m_y ; - int former_w = m_width ; - int former_h = m_height ; - - int actualWidth = width; - int actualHeight = height; - int actualX = x; - int actualY = y; - - if ((m_minWidth != -1) && (actualWidth < m_minWidth)) - actualWidth = m_minWidth; - if ((m_minHeight != -1) && (actualHeight < m_minHeight)) - actualHeight = m_minHeight; - if ((m_maxWidth != -1) && (actualWidth > m_maxWidth)) - actualWidth = m_maxWidth; - if ((m_maxHeight != -1) && (actualHeight > m_maxHeight)) - actualHeight = m_maxHeight; - - bool doMove = false ; - bool doResize = false ; - - if ( actualX != former_x || actualY != former_y ) - { - doMove = true ; - } - if ( actualWidth != former_w || actualHeight != former_h ) - { - doResize = true ; - } - - if ( doMove || doResize ) - { - // erase former position - - bool partialRepaint = false ; - - if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) ) - { - wxPoint oldPos( m_x , m_y ) ; - wxPoint newPos( actualX , actualY ) ; - MacWindowToRootWindow( &oldPos.x , &oldPos.y ) ; - MacWindowToRootWindow( &newPos.x , &newPos.y ) ; - if ( oldPos == newPos ) - { - partialRepaint = true ; - RgnHandle oldRgn,newRgn,diffRgn ; - oldRgn = NewRgn() ; - newRgn = NewRgn() ; - diffRgn = NewRgn() ; - - // invalidate the differences between the old and the new area - - SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ; - SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ; - DiffRgn( newRgn , oldRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - DiffRgn( oldRgn , newRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - // we also must invalidate the border areas, someone might optimize this one day to invalidate only the really - // changing pixels... - - if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 || - MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 ) - { - RgnHandle innerOldRgn, innerNewRgn ; - innerOldRgn = NewRgn() ; - innerNewRgn = NewRgn() ; - - SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() , - oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ; - DiffRgn( oldRgn , innerOldRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() , - newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ; - DiffRgn( newRgn , innerNewRgn , diffRgn ) ; - InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ; - - DisposeRgn( innerOldRgn ) ; - DisposeRgn( innerNewRgn ) ; - } - - DisposeRgn(oldRgn) ; - DisposeRgn(newRgn) ; - DisposeRgn(diffRgn) ; - } - } - - if ( !partialRepaint ) - Refresh() ; - - m_x = actualX ; - m_y = actualY ; - m_width = actualWidth ; - m_height = actualHeight ; - - // update any low-level frame-relative positions - - MacUpdateDimensions() ; - // erase new position - - if ( !partialRepaint ) - Refresh() ; - if ( doMove ) - wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified - - MacRepositionScrollBars() ; - if ( doMove ) - { - wxPoint point(m_x, m_y); - wxMoveEvent event(point, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; - } - if ( doResize ) - { - MacRepositionScrollBars() ; - wxSize size(m_width, m_height); - wxSizeEvent event(size, m_windowId); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - } - -} - -// set the size of the window: if the dimensions are positive, just use them, -// but if any of them is equal to -1, it means that we must find the value for -// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in -// which case -1 is a valid value for x and y) -// -// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate -// the width/height to best suit our contents, otherwise we reuse the current -// width/height -void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - // get the current size and position... - int currentX, currentY; - GetPosition(¤tX, ¤tY); - - int currentW,currentH; - GetSize(¤tW, ¤tH); - - // ... and don't do anything (avoiding flicker) if it's already ok - if ( x == currentX && y == currentY && - width == currentW && height == currentH ) - { - MacRepositionScrollBars() ; // we might have a real position shift - return; - } - - if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) - x = currentX; - if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) ) - y = currentY; - - AdjustForParentClientOrigin(x, y, sizeFlags); - - wxSize size(-1, -1); - if ( width == -1 ) - { - if ( sizeFlags & wxSIZE_AUTO_WIDTH ) - { - size = DoGetBestSize(); - width = size.x; - } - else - { - // just take the current one - width = currentW; - } - } - - if ( height == -1 ) - { - if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) - { - if ( size.x == -1 ) - { - size = DoGetBestSize(); - } - //else: already called DoGetBestSize() above - - height = size.y; - } - else - { - // just take the current one - height = currentH; - } - } - - DoMoveWindow(x, y, width, height); - -} -// For implementation purposes - sometimes decorations make the client area -// smaller - -wxPoint wxWindowMac::GetClientAreaOrigin() const -{ - return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); -} - -void wxWindowMac::SetTitle(const wxString& title) -{ - m_label = title ; -} - -wxString wxWindowMac::GetTitle() const -{ - return m_label ; -} - -bool wxWindowMac::Show(bool show) -{ - if ( !wxWindowBase::Show(show) ) - return FALSE; - - MacSuperShown( show ) ; - Refresh() ; - - return TRUE; -} - -void wxWindowMac::MacSuperShown( bool show ) -{ - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - if ( child->m_isShown ) - child->MacSuperShown( show ) ; - node = node->GetNext(); - } -} - -void wxWindowMac::MacSuperEnabled( bool enabled ) -{ - if ( !IsTopLevel() ) - { - // to be absolutely correct we'd have to invalidate (with eraseBkground - // because unter MacOSX the frames are drawn with an addXXX mode) - // the borders area - } - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = (wxWindowMac *)node->GetData(); - if ( child->m_isShown ) - child->MacSuperEnabled( enabled ) ; - node = node->GetNext(); - } -} - -bool wxWindowMac::MacIsReallyShown() const -{ - if ( m_isShown && (m_parent != NULL && !IsTopLevel() ) ) { - return m_parent->MacIsReallyShown(); - } - return m_isShown; -/* - bool status = m_isShown ; - wxWindowMac * win = this ; - while ( status && win->m_parent != NULL ) - { - win = win->m_parent ; - status = win->m_isShown ; - } - return status ; -*/ -} - -int wxWindowMac::GetCharHeight() const -{ - wxClientDC dc ( (wxWindowMac*)this ) ; - return dc.GetCharHeight() ; -} - -int wxWindowMac::GetCharWidth() const -{ - wxClientDC dc ( (wxWindowMac*)this ) ; - return dc.GetCharWidth() ; -} - -void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, - int *descent, int *externalLeading, const wxFont *theFont ) const -{ - const wxFont *fontToUse = theFont; - if ( !fontToUse ) - fontToUse = &m_font; - - wxClientDC dc( (wxWindowMac*) this ) ; - long lx,ly,ld,le ; - dc.GetTextExtent( string , &lx , &ly , &ld, &le, (wxFont *)fontToUse ) ; - if ( externalLeading ) - *externalLeading = le ; - if ( descent ) - *descent = ld ; - if ( x ) - *x = lx ; - if ( y ) - *y = ly ; -} - -/* - * Rect is given in client coordinates, for further reading, read wxTopLevelWindowMac::InvalidateRect - * we always intersect with the entire window, not only with the client area - */ - -void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) -{ - if ( MacGetTopLevelWindow() == NULL ) - return ; - - if ( !MacIsReallyShown() ) - return ; - - wxPoint client = GetClientAreaOrigin(); - int x1 = -client.x; - int y1 = -client.y; - int x2 = m_width - client.x; - int y2 = m_height - client.y; - - if (IsKindOf( CLASSINFO(wxButton))) - { - // buttons have an "aura" - y1 -= 5; - x1 -= 5; - y2 += 5; - x2 += 5; - } - - Rect clientrect = { y1, x1, y2, x2 }; - - if ( rect ) - { - Rect r = { rect->y , rect->x , rect->y + rect->height , rect->x + rect->width } ; - SectRect( &clientrect , &r , &clientrect ) ; - } - - if ( !EmptyRect( &clientrect ) ) - { - int top = 0 , left = 0 ; - - MacClientToRootWindow( &left , &top ) ; - OffsetRect( &clientrect , left , top ) ; - - MacGetTopLevelWindow()->MacInvalidate( &clientrect , eraseBack ) ; - } -} - -wxWindowMac *wxGetActiveWindow() -{ - // actually this is a windows-only concept - return NULL; -} - -// Coordinates relative to the window -void wxWindowMac::WarpPointer (int x_pos, int y_pos) -{ - // We really don't move the mouse programmatically under Mac. -} - -const wxBrush& wxWindowMac::MacGetBackgroundBrush() -{ - if ( m_backgroundColour == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) - { - m_macBackgroundBrush.SetMacTheme( kThemeBrushDocumentWindowBackground ) ; - } - else if ( m_backgroundColour == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) ) - { - // on mac we have the difficult situation, that 3dface gray can be different colours, depending whether - // it is on a notebook panel or not, in order to take care of that we walk up the hierarchy until we have - // either a non gray background color or a non control window - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - wxWindowMac* parent = GetParent() ; - while( parent ) - { - if ( parent->MacGetRootWindow() != window ) - { - // we are in a different window on the mac system - parent = NULL ; - break ; - } - - { - if ( parent->m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) - && parent->m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) - { - // if we have any other colours in the hierarchy - m_macBackgroundBrush.SetColour( parent->m_backgroundColour ) ; - break ; - } - // if we have the normal colours in the hierarchy but another control etc. -> use it's background - if ( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - Rect extent = { 0 , 0 , 0 , 0 } ; - int x , y ; - x = y = 0 ; - wxSize size = parent->GetSize() ; - parent->MacClientToRootWindow( &x , &y ) ; - extent.left = x ; - extent.top = y ; - extent.top-- ; - extent.right = x + size.x ; - extent.bottom = y + size.y ; - m_macBackgroundBrush.SetMacThemeBackground( kThemeBackgroundTabPane , (WXRECTPTR) &extent ) ; // todo eventually change for inactive - break ; - } - } - parent = parent->GetParent() ; - } - if ( !parent ) - { - m_macBackgroundBrush.SetMacTheme( kThemeBrushDialogBackgroundActive ) ; // todo eventually change for inactive - } - } - else - { - m_macBackgroundBrush.SetColour( m_backgroundColour ) ; - } - - return m_macBackgroundBrush ; -} - -void wxWindowMac::OnEraseBackground(wxEraseEvent& event) -{ - event.GetDC()->Clear() ; -} - -void wxWindowMac::OnNcPaint( wxNcPaintEvent& event ) -{ - wxWindowDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - MacPaintBorders( dc.m_macLocalOrigin.x , dc.m_macLocalOrigin.y) ; -} - -int wxWindowMac::GetScrollPos(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetThumbPosition() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetThumbPosition() ; - } - return 0; -} - -// This now returns the whole range, not just the number -// of positions that we can scroll. -int wxWindowMac::GetScrollRange(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetRange() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetRange() ; - } - return 0; -} - -int wxWindowMac::GetScrollThumb(int orient) const -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - return m_hScrollBar->GetThumbSize() ; - } - else - { - if ( m_vScrollBar ) - return m_vScrollBar->GetThumbSize() ; - } - return 0; -} - -void wxWindowMac::SetScrollPos(int orient, int pos, bool refresh) -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - m_hScrollBar->SetThumbPosition( pos ) ; - } - else - { - if ( m_vScrollBar ) - m_vScrollBar->SetThumbPosition( pos ) ; - } -} - -void wxWindowMac::MacPaintBorders( int left , int top ) -{ - if( IsTopLevel() ) - return ; - - int major,minor; - wxGetOsVersion( &major, &minor ); - - RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ; - RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ; - - RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ; - RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ; - // OS X has lighter border edges than classic: - if (major >= 10) - { - darkShadow.red = 0x8E8E; - darkShadow.green = 0x8E8E; - darkShadow.blue = 0x8E8E; - lightShadow.red = 0xBDBD; - lightShadow.green = 0xBDBD; - lightShadow.blue = 0xBDBD; - } - - PenNormal() ; - - if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) ) - { -#if wxMAC_USE_THEME_BORDER - Rect rect = { top , left , m_height + top , m_width + left } ; - SInt32 border = 0 ; - /* - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; - InsetRect( &rect , border , border ); - DrawThemeListBoxFrame(&rect,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; - */ - - DrawThemePrimaryGroup(&rect ,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ; -#else - bool sunken = HasFlag( wxSUNKEN_BORDER ) ; - RGBForeColor( &face ); - MoveTo( left + 0 , top + m_height - 2 ); - LineTo( left + 0 , top + 0 ); - LineTo( left + m_width - 2 , top + 0 ); - - MoveTo( left + 2 , top + m_height - 3 ); - LineTo( left + m_width - 3 , top + m_height - 3 ); - LineTo( left + m_width - 3 , top + 2 ); - - RGBForeColor( sunken ? &face : &darkShadow ); - MoveTo( left + 0 , top + m_height - 1 ); - LineTo( left + m_width - 1 , top + m_height - 1 ); - LineTo( left + m_width - 1 , top + 0 ); - - RGBForeColor( sunken ? &lightShadow : &white ); - MoveTo( left + 1 , top + m_height - 3 ); - LineTo( left + 1, top + 1 ); - LineTo( left + m_width - 3 , top + 1 ); - - RGBForeColor( sunken ? &white : &lightShadow ); - MoveTo( left + 1 , top + m_height - 2 ); - LineTo( left + m_width - 2 , top + m_height - 2 ); - LineTo( left + m_width - 2 , top + 1 ); - - RGBForeColor( sunken ? &darkShadow : &face ); - MoveTo( left + 2 , top + m_height - 4 ); - LineTo( left + 2 , top + 2 ); - LineTo( left + m_width - 4 , top + 2 ); -#endif - } - else if (HasFlag(wxSIMPLE_BORDER)) - { - Rect rect = { top , left , m_height + top , m_width + left } ; - RGBForeColor( &darkShadow ) ; - FrameRect( &rect ) ; - } -} - -void wxWindowMac::RemoveChild( wxWindowBase *child ) -{ - if ( child == m_hScrollBar ) - m_hScrollBar = NULL ; - if ( child == m_vScrollBar ) - m_vScrollBar = NULL ; - - wxWindowBase::RemoveChild( child ) ; -} - -// New function that will replace some of the above. -void wxWindowMac::SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh) -{ - if ( orient == wxHORIZONTAL ) - { - if ( m_hScrollBar ) - { - if ( range == 0 || thumbVisible >= range ) - { - if ( m_hScrollBar->IsShown() ) - m_hScrollBar->Show(false) ; - } - else - { - if ( !m_hScrollBar->IsShown() ) - m_hScrollBar->Show(true) ; - m_hScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ; - } - } - } - else - { - if ( m_vScrollBar ) - { - if ( range == 0 || thumbVisible >= range ) - { - if ( m_vScrollBar->IsShown() ) - m_vScrollBar->Show(false) ; - } - else - { - if ( !m_vScrollBar->IsShown() ) - m_vScrollBar->Show(true) ; - m_vScrollBar->SetScrollbar( pos , thumbVisible , range , thumbVisible , refresh ) ; - } - } - } - MacRepositionScrollBars() ; -} - -// Does a physical scroll -void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) -{ - if( dx == 0 && dy ==0 ) - return ; - - - { - wxClientDC dc(this) ; - wxMacPortSetter helper(&dc) ; - - int width , height ; - GetClientSize( &width , &height ) ; - - Rect scrollrect = { dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) , dc.YLOG2DEVMAC(height) , dc.XLOG2DEVMAC(width) } ; - RgnHandle updateRgn = NewRgn() ; - ClipRect( &scrollrect ) ; - if ( rect ) - { - Rect r = { dc.YLOG2DEVMAC(rect->y) , dc.XLOG2DEVMAC(rect->x) , dc.YLOG2DEVMAC(rect->y + rect->height) , - dc.XLOG2DEVMAC(rect->x + rect->width) } ; - SectRect( &scrollrect , &r , &scrollrect ) ; - } - ScrollRect( &scrollrect , dx , dy , updateRgn ) ; - // we also have to scroll the update rgn in this rectangle - // in order not to loose updates - WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; - RgnHandle formerUpdateRgn = NewRgn() ; - RgnHandle scrollRgn = NewRgn() ; - RectRgn( scrollRgn , &scrollrect ) ; - GetWindowUpdateRgn( rootWindow , formerUpdateRgn ) ; - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - OffsetRgn( formerUpdateRgn , -pt.h , -pt.v ) ; - SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ; - if ( !EmptyRgn( formerUpdateRgn ) ) - { - MacOffsetRgn( formerUpdateRgn , dx , dy ) ; - SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ; - InvalWindowRgn(rootWindow , formerUpdateRgn ) ; - } - InvalWindowRgn(rootWindow , updateRgn ) ; - DisposeRgn( updateRgn ) ; - DisposeRgn( formerUpdateRgn ) ; - DisposeRgn( scrollRgn ) ; - } - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - if (child == m_vScrollBar) continue; - if (child == m_hScrollBar) continue; - if (child->IsTopLevel()) continue; - - int x,y; - child->GetPosition( &x, &y ); - int w,h; - child->GetSize( &w, &h ); - if (rect) - { - wxRect rc(x,y,w,h); - if (rect->Intersects(rc)) - child->SetSize( x+dx, y+dy, w, h ); - } - else - { - child->SetSize( x+dx, y+dy, w, h ); - } - } - - Update() ; - -} - -void wxWindowMac::MacOnScroll(wxScrollEvent &event ) -{ - if ( event.m_eventObject == m_vScrollBar || event.m_eventObject == m_hScrollBar ) - { - wxScrollWinEvent wevent; - wevent.SetPosition(event.GetPosition()); - wevent.SetOrientation(event.GetOrientation()); - wevent.m_eventObject = this; - - if (event.m_eventType == wxEVT_SCROLL_TOP) - wevent.m_eventType = wxEVT_SCROLLWIN_TOP; - else if (event.m_eventType == wxEVT_SCROLL_BOTTOM) - wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM; - else if (event.m_eventType == wxEVT_SCROLL_LINEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP; - else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_PAGEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP; - else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK; - else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE; - - GetEventHandler()->ProcessEvent(wevent); - } -} - -// Get the window with the focus -wxWindowMac *wxWindowBase::FindFocus() -{ - return gFocusWindow ; -} - -void wxWindowMac::OnSetFocus(wxFocusEvent& event) -{ - // panel wants to track the window which was the last to have focus in it, - // so we want to set ourselves as the window which last had focus - // - // notice that it's also important to do it upwards the tree becaus - // otherwise when the top level panel gets focus, it won't set it back to - // us, but to some other sibling - - // CS:don't know if this is still needed: - //wxChildFocusEvent eventFocus(this); - //(void)GetEventHandler()->ProcessEvent(eventFocus); - - event.Skip(); -} - -// Setup background and foreground colours correctly -void wxWindowMac::SetupColours() -{ - if ( GetParent() ) - SetBackgroundColour(GetParent()->GetBackgroundColour()); -} - -void wxWindowMac::OnInternalIdle() -{ - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this)) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - -// Raise the window to the top of the Z order -void wxWindowMac::Raise() -{ -} - -// Lower the window to the bottom of the Z order -void wxWindowMac::Lower() -{ -} - -void wxWindowMac::DoSetClientSize(int width, int height) -{ - if ( width != -1 || height != -1 ) - { - - if ( width != -1 && m_vScrollBar ) - width += MAC_SCROLLBAR_SIZE ; - if ( height != -1 && m_vScrollBar ) - height += MAC_SCROLLBAR_SIZE ; - - width += MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ; - height += MacGetTopBorderSize( ) + MacGetBottomBorderSize( ) ; - - DoSetSize( -1 , -1 , width , height ) ; - } -} - - -wxWindowMac* wxWindowMac::s_lastMouseWindow = NULL ; - -bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) -{ - if ( IsTopLevel() ) - { - if ((point.x < 0) || (point.y < 0) || - (point.x > (m_width)) || (point.y > (m_height))) - return FALSE; - } - else - { - if ((point.x < m_x) || (point.y < m_y) || - (point.x > (m_x + m_width)) || (point.y > (m_y + m_height))) - return FALSE; - } - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - wxPoint newPoint( point ) ; - - if ( !IsTopLevel() ) - { - newPoint.x -= m_x; - newPoint.y -= m_y; - } - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - // added the m_isShown test --dmazzoni - if ( child->MacGetRootWindow() == window && child->m_isShown ) - { - if (child->MacGetWindowFromPointSub(newPoint , outWin )) - return TRUE; - } - } - - *outWin = this ; - return TRUE; -} - -bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMac** outWin ) -{ - WindowRef window ; - - Point pt = { screenpoint.y , screenpoint.x } ; - if ( ::FindWindow( pt , &window ) == 3 ) - { - - wxWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - { - // No, this yields the CLIENT are, we need the whole frame. RR. - // point = win->ScreenToClient( point ) ; - - GrafPtr port; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( window ) ) ; - ::GlobalToLocal( &pt ) ; - ::SetPort( port ) ; - - wxPoint point( pt.h, pt.v ) ; - - return win->MacGetWindowFromPointSub( point , outWin ) ; - } - } - return FALSE ; -} - -static wxWindow *gs_lastWhich = NULL; - -bool wxWindowMac::MacSetupCursor( const wxPoint& pt) -{ - // first trigger a set cursor event - - wxPoint clientorigin = GetClientAreaOrigin() ; - wxSize clientsize = GetClientSize() ; - wxCursor cursor ; - if ( wxRect2DInt( clientorigin.x , clientorigin.y , clientsize.x , clientsize.y ).Contains( wxPoint2DInt( pt ) ) ) - { - wxSetCursorEvent event( pt.x , pt.y ); - - bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event); - if ( processedEvtSetCursor && event.HasCursor() ) - { - cursor = event.GetCursor() ; - } - else - { - - // the test for processedEvtSetCursor is here to prevent using m_cursor - // if the user code caught EVT_SET_CURSOR() and returned nothing from - // it - this is a way to say that our cursor shouldn't be used for this - // point - if ( !processedEvtSetCursor && m_cursor.Ok() ) - { - cursor = m_cursor ; - } - if ( wxIsBusy() ) - { - } - else - { - if ( !GetParent() ) - cursor = *wxSTANDARD_CURSOR ; - } - } - if ( cursor.Ok() ) - cursor.MacInstall() ; - } - return cursor.Ok() ; -} - -bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) -{ - if ((event.m_x < m_x) || (event.m_y < m_y) || - (event.m_x > (m_x + m_width)) || (event.m_y > (m_y + m_height))) - return FALSE; - - - if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */) - return FALSE ; - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - event.m_x -= m_x; - event.m_y -= m_y; - - int x = event.m_x ; - int y = event.m_y ; - - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - if ( child->MacGetRootWindow() == window && child->IsShown() && child->IsEnabled() ) - { - if (child->MacDispatchMouseEvent(event)) - return TRUE; - } - } - - wxWindow* cursorTarget = this ; - wxPoint cursorPoint( x , y ) ; - - while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) ) - { - cursorTarget = cursorTarget->GetParent() ; - if ( cursorTarget ) - cursorPoint += cursorTarget->GetPosition() ; - } - event.m_x = x ; - event.m_y = y ; - event.SetEventObject( this ) ; - - if ( event.GetEventType() == wxEVT_LEFT_DOWN ) - { - // set focus to this window - if (AcceptsFocus() && FindFocus()!=this) - SetFocus(); - } - -#if wxUSE_TOOLTIPS - if ( event.GetEventType() == wxEVT_MOTION - || event.GetEventType() == wxEVT_ENTER_WINDOW - || event.GetEventType() == wxEVT_LEAVE_WINDOW ) - wxToolTip::RelayEvent( this , event); -#endif // wxUSE_TOOLTIPS - - if (gs_lastWhich != this) - { - gs_lastWhich = this; - - // Double clicks must always occur on the same window - if (event.GetEventType() == wxEVT_LEFT_DCLICK) - event.SetEventType( wxEVT_LEFT_DOWN ); - if (event.GetEventType() == wxEVT_RIGHT_DCLICK) - event.SetEventType( wxEVT_RIGHT_DOWN ); - - // Same for mouse up events - if (event.GetEventType() == wxEVT_LEFT_UP) - return TRUE; - if (event.GetEventType() == wxEVT_RIGHT_UP) - return TRUE; - } - - GetEventHandler()->ProcessEvent( event ) ; - - return TRUE; -} - -wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) -{ - if ( m_tooltip ) - { - return m_tooltip->GetTip() ; - } - return wxEmptyString ; -} - -void wxWindowMac::Update() -{ - wxRegion visRgn = MacGetVisibleRegion( false ) ; - int top = 0 , left = 0 ; - MacWindowToRootWindow( &left , &top ) ; - WindowRef rootWindow = (WindowRef) MacGetRootWindow() ; - RgnHandle updateRgn = NewRgn() ; - // getting the update region in macos local coordinates - GetWindowUpdateRgn( rootWindow , updateRgn ) ; - GrafPtr port ; - ::GetPort( &port ) ; - ::SetPort( UMAGetWindowPort( rootWindow ) ) ; - Point pt = {0,0} ; - LocalToGlobal( &pt ) ; - ::SetPort( port ) ; - OffsetRgn( updateRgn , -pt.h , -pt.v ) ; - // translate to window local coordinates - OffsetRgn( updateRgn , -left , -top ) ; - SectRgn( updateRgn , (RgnHandle) visRgn.GetWXHRGN() , updateRgn ) ; - MacRedraw( updateRgn , 0 , true ) ; - // for flushing and validating we need macos-local coordinates again - OffsetRgn( updateRgn , left , top ) ; -#if TARGET_API_MAC_CARBON - if ( QDIsPortBuffered( GetWindowPort( rootWindow ) ) ) - { - QDFlushPortBuffer( GetWindowPort( rootWindow ) , updateRgn ) ; - } -#endif - ValidWindowRgn( rootWindow , updateRgn ) ; - DisposeRgn( updateRgn ) ; -} - -wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const -{ - wxTopLevelWindowMac* win = NULL ; - WindowRef window = (WindowRef) MacGetRootWindow() ; - if ( window ) - { - win = wxFindWinFromMacWindow( window ) ; - } - return win ; -} - -const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSiblings ) -{ - RgnHandle visRgn = NewRgn() ; - RgnHandle tempRgn = NewRgn() ; - RgnHandle tempStaticBoxRgn = NewRgn() ; - - if ( MacIsReallyShown() ) - { - SetRectRgn( visRgn , 0 , 0 , m_width , m_height ) ; - - //TODO : as soon as the new scheme has proven to work correctly, move this to wxStaticBox - if ( IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , borderOther , borderTop , m_width - borderOther , m_height - borderOther ) ; - DiffRgn( visRgn , tempStaticBoxRgn , visRgn ) ; - } - - if ( !IsTopLevel() ) - { - wxWindow* parent = GetParent() ; - while( parent ) - { - wxSize size = parent->GetSize() ; - int x , y ; - x = y = 0 ; - parent->MacWindowToRootWindow( &x, &y ) ; - MacRootWindowToWindow( &x , &y ) ; - - SetRectRgn( tempRgn , - x + parent->MacGetLeftBorderSize() , y + parent->MacGetTopBorderSize() , - x + size.x - parent->MacGetRightBorderSize(), - y + size.y - parent->MacGetBottomBorderSize()) ; - - SectRgn( visRgn , tempRgn , visRgn ) ; - if ( parent->IsTopLevel() ) - break ; - parent = parent->GetParent() ; - } - } - if ( respectChildrenAndSiblings ) - { - if ( GetWindowStyle() & wxCLIP_CHILDREN ) - { - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *child = node->GetData(); - - if ( !child->IsTopLevel() && child->IsShown() ) - { - SetRectRgn( tempRgn , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; - if ( child->IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ; - DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ; - } - DiffRgn( visRgn , tempRgn , visRgn ) ; - } - } - } - - if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() ) - { - bool thisWindowThrough = false ; - for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxWindowMac *sibling = node->GetData(); - if ( sibling == this ) - { - thisWindowThrough = true ; - continue ; - } - if( !thisWindowThrough ) - { - continue ; - } - - if ( !sibling->IsTopLevel() && sibling->IsShown() ) - { - SetRectRgn( tempRgn , sibling->m_x - m_x , sibling->m_y - m_y , sibling->m_x + sibling->m_width - m_x , sibling->m_y + sibling->m_height - m_y ) ; - if ( sibling->IsKindOf( CLASSINFO( wxStaticBox ) ) ) - { - int borderTop = 14 ; - int borderOther = 4 ; - if ( UMAGetSystemVersion() >= 0x1030 ) - borderTop += 2 ; - - SetRectRgn( tempStaticBoxRgn , sibling->m_x - m_x + borderOther , sibling->m_y - m_y + borderTop , sibling->m_x + sibling->m_width - m_x - borderOther , sibling->m_y + sibling->m_height - m_y - borderOther ) ; - DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ; - } - DiffRgn( visRgn , tempRgn , visRgn ) ; - } - } - } - } - } - m_macVisibleRegion = visRgn ; - DisposeRgn( visRgn ) ; - DisposeRgn( tempRgn ) ; - DisposeRgn( tempStaticBoxRgn ) ; - return m_macVisibleRegion ; -} - -void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) -{ - RgnHandle updatergn = (RgnHandle) updatergnr ; - // updatergn is always already clipped to our boundaries - // it is in window coordinates, not in client coordinates - - WindowRef window = (WindowRef) MacGetRootWindow() ; - - { - // ownUpdateRgn is the area that this window has to repaint, it is in window coordinates - RgnHandle ownUpdateRgn = NewRgn() ; - CopyRgn( updatergn , ownUpdateRgn ) ; - - SectRgn( ownUpdateRgn , (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , ownUpdateRgn ) ; - - // newupdate is the update region in client coordinates - RgnHandle newupdate = NewRgn() ; - wxSize point = GetClientSize() ; - wxPoint origin = GetClientAreaOrigin() ; - SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ; - SectRgn( newupdate , ownUpdateRgn , newupdate ) ; - OffsetRgn( newupdate , -origin.x , -origin.y ) ; - m_updateRegion = newupdate ; - DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion - - if ( erase && !EmptyRgn(ownUpdateRgn) ) - { - wxWindowDC dc(this); - if (!EmptyRgn(ownUpdateRgn)) - dc.SetClippingRegion(wxRegion(ownUpdateRgn)); - wxEraseEvent eevent( GetId(), &dc ); - eevent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( eevent ); - - wxNcPaintEvent eventNc( GetId() ); - eventNc.SetEventObject( this ); - GetEventHandler()->ProcessEvent( eventNc ); - } - DisposeRgn( ownUpdateRgn ) ; - if ( !m_updateRegion.Empty() ) - { - wxWindowList hiddenWindows ; - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; - - if ( child && child->MacGetRootWindow() == window && child->IsShown() && child->GetMacControl() ) - { - SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ; - hiddenWindows.Append( child ) ; - } - } - - wxPaintEvent event; - event.m_timeStamp = time ; - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - - for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext()) - { - wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; - - if ( child && child->GetMacControl() ) - { - SetControlVisibility( (ControlHandle) child->GetMacControl() , true , false ) ; - } - } - } - } - - // now intersect for each of the children their rect with the updateRgn and call MacRedraw recursively - - RgnHandle childupdate = NewRgn() ; - for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) - { - // calculate the update region for the child windows by intersecting the window rectangle with our own - // passed in update region and then offset it to be client-wise window coordinates again - wxWindowMac *child = node->GetData(); - SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; - SectRgn( childupdate , updatergn , childupdate ) ; - OffsetRgn( childupdate , -child->m_x , -child->m_y ) ; - if ( child->MacGetRootWindow() == window && child->IsShown() && !EmptyRgn( childupdate ) ) - { - // because dialogs may also be children - child->MacRedraw( childupdate , time , erase ) ; - } - } - DisposeRgn( childupdate ) ; - // eventually a draw grow box here - -} - -WXHWND wxWindowMac::MacGetRootWindow() const -{ - wxWindowMac *iter = (wxWindowMac*)this ; - - while( iter ) - { - if ( iter->IsTopLevel() ) - return ((wxTopLevelWindow*)iter)->MacGetWindowRef() ; - - iter = iter->GetParent() ; - } - wxASSERT_MSG( 1 , wxT("No valid mac root window") ) ; - return NULL ; -} - -void wxWindowMac::MacCreateScrollBars( long style ) -{ - wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ; - - bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ; - int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ; - int width, height ; - GetClientSize( &width , &height ) ; - - wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ; - wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ; - wxPoint hPoint(0 , height-MAC_SCROLLBAR_SIZE ) ; - wxSize hSize( width - adjust, MAC_SCROLLBAR_SIZE) ; - - m_vScrollBar = new wxScrollBar(this, wxWINDOW_VSCROLL, vPoint, - vSize , wxVERTICAL); - - if ( style & wxVSCROLL ) - { - - } - else - { - m_vScrollBar->Show(false) ; - } - m_hScrollBar = new wxScrollBar(this, wxWINDOW_HSCROLL, hPoint, - hSize , wxHORIZONTAL); - if ( style & wxHSCROLL ) - { - } - else - { - m_hScrollBar->Show(false) ; - } - - // because the create does not take into account the client area origin - MacRepositionScrollBars() ; // we might have a real position shift -} - -void wxWindowMac::MacRepositionScrollBars() -{ - bool hasBoth = ( m_hScrollBar && m_hScrollBar->IsShown()) && ( m_vScrollBar && m_vScrollBar->IsShown()) ; - int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1 : 0 ; - - // get real client area - - int width = m_width ; - int height = m_height ; - - width -= MacGetLeftBorderSize() + MacGetRightBorderSize(); - height -= MacGetTopBorderSize() + MacGetBottomBorderSize(); - - wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ; - wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ; - wxPoint hPoint(0 , height-MAC_SCROLLBAR_SIZE ) ; - wxSize hSize( width - adjust, MAC_SCROLLBAR_SIZE) ; - - int x = 0 ; - int y = 0 ; - int w = m_width ; - int h = m_height ; - - MacClientToRootWindow( &x , &y ) ; - MacClientToRootWindow( &w , &h ) ; - - wxWindowMac *iter = (wxWindowMac*)this ; - - int totW = 10000 , totH = 10000; - while( iter ) - { - if ( iter->IsTopLevel() ) - { - totW = iter->m_width ; - totH = iter->m_height ; - break ; - } - - iter = iter->GetParent() ; - } - - if ( x == 0 ) - { - hPoint.x = -1 ; - hSize.x += 1 ; - } - if ( y == 0 ) - { - vPoint.y = -1 ; - vSize.y += 1 ; - } - - if ( w-x >= totW ) - { - hSize.x += 1 ; - vPoint.x += 1 ; - } - - if ( h-y >= totH ) - { - vSize.y += 1 ; - hPoint.y += 1 ; - } - - if ( m_vScrollBar ) - { - m_vScrollBar->SetSize( vPoint.x , vPoint.y, vSize.x, vSize.y , wxSIZE_ALLOW_MINUS_ONE); - } - if ( m_hScrollBar ) - { - m_hScrollBar->SetSize( hPoint.x , hPoint.y, hSize.x, hSize.y, wxSIZE_ALLOW_MINUS_ONE); - } -} - -bool wxWindowMac::AcceptsFocus() const -{ - return MacCanFocus() && wxWindowBase::AcceptsFocus(); -} - -WXWidget wxWindowMac::MacGetContainerForEmbedding() -{ - return GetParent()->MacGetContainerForEmbedding() ; -} - -void wxWindowMac::MacSuperChangedPosition() -{ - // only window-absolute structures have to be moved i.e. controls - - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - child->MacSuperChangedPosition() ; - node = node->GetNext(); - } -} - -void wxWindowMac::MacTopLevelWindowChangedPosition() -{ - // only screen-absolute structures have to be moved i.e. glcanvas - - wxWindowListNode *node = GetChildren().GetFirst(); - while ( node ) - { - wxWindowMac *child = node->GetData(); - child->MacTopLevelWindowChangedPosition() ; - node = node->GetNext(); - } -} -long wxWindowMac::MacGetLeftBorderSize( ) const -{ - if( IsTopLevel() ) - return 0 ; - - if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER ) - { - SInt32 border = 3 ; -#if wxMAC_USE_THEME_BORDER -#if TARGET_CARBON - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; -#endif -#endif - return border ; - } - else if ( m_windowStyle &wxDOUBLE_BORDER) - { - SInt32 border = 3 ; -#if wxMAC_USE_THEME_BORDER -#if TARGET_CARBON - GetThemeMetric( kThemeMetricListBoxFrameOutset , &border ) ; -#endif -#endif - return border ; - } - else if (m_windowStyle &wxSIMPLE_BORDER) - { - return 1 ; - } - return 0 ; -} - -long wxWindowMac::MacGetRightBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacGetTopBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacGetBottomBorderSize( ) const -{ - // they are all symmetric in mac themes - return MacGetLeftBorderSize() ; -} - -long wxWindowMac::MacRemoveBordersFromStyle( long style ) -{ - return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ; -} - -// Find the wxWindowMac at the current mouse position, returning the mouse -// position. -wxWindowMac* wxFindWindowAtPointer(wxPoint& pt) -{ - pt = wxGetMousePosition(); - wxWindowMac* found = wxFindWindowAtPoint(pt); - return found; -} - -// Get the current mouse position. -wxPoint wxGetMousePosition() -{ - int x, y; - wxGetMousePosition(& x, & y); - return wxPoint(x, y); -} - -void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) -{ - if ( event.GetEventType() == wxEVT_RIGHT_DOWN ) - { - // copied from wxGTK : CS - // generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN - // except that: - // - // (a) it's a command event and so is propagated to the parent - // (b) under MSW it can be generated from kbd too - // (c) it uses screen coords (because of (a)) - wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, - this->GetId(), - this->ClientToScreen(event.GetPosition())); - if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) - event.Skip() ; - } - else - { - event.Skip() ; - } -} - diff --git a/src/mac/classic/wxmac.icns b/src/mac/classic/wxmac.icns deleted file mode 100644 index 2c4e6f097d2f4315aaabf16668dbab4f4db6ebd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36901 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 -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#include - -#define ALL_CALLBACK_TYPES (kCFSocketReadCallBack | kCFSocketWriteCallBack | kCFSocketConnectCallBack) - -struct MacGSocketData -{ - CFSocketRef socket; - CFRunLoopSourceRef source; -}; - -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) -{ - GSocket* socket = (GSocket*)info; - struct MacGSocketData* macdata; - macdata = (struct MacGSocketData*)socket->m_gui_dependent; - if (!macdata) return; - switch (callbackType) - { - case kCFSocketConnectCallBack: - assert(!socket->m_server); - socket->m_functions->Detected_Write(socket); - break; - case kCFSocketReadCallBack: - socket->m_functions->Detected_Read(socket); - break; - case kCFSocketWriteCallBack: - socket->m_functions->Detected_Write(socket); - break; - default: - break; /* We shouldn't get here. */ - } -} - -struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket) -{ - /* If socket is already created, returns a pointer to the data */ - /* Otherwise, creates socket and returns the pointer */ - CFSocketContext cont; - struct MacGSocketData* data = (struct MacGSocketData*)socket->m_gui_dependent; - - if (data && data->source) return data; - - /* CFSocket has not been created, create it: */ - if (socket->m_fd < 0 || !data) return NULL; - cont.version = 0; cont.retain = NULL; - cont.release = NULL; cont.copyDescription = NULL; - cont.info = socket; - - CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, - ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont); - CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0); - assert(source); - socket->m_gui_dependent = (char*)data; - - /* Keep the source and the socket around. */ - data->source = source; - data->socket = cf; - - return data; -} - -int _GSocket_GUI_Init(void) -{ - return 1; -} - -void _GSocket_GUI_Cleanup(void) -{ -} - -int _GSocket_GUI_Init_Socket(GSocket *socket) -{ - struct MacGSocketData *data = malloc(sizeof(struct MacGSocketData)); - if (data) - { - socket->m_gui_dependent = (char*)data; - data->socket = NULL; - data->source = NULL; - return 1; - } - return 0; -} - -void _GSocket_GUI_Destroy_Socket(GSocket *socket) -{ - struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent); - if (data) - { - CFRelease(data->socket); - free(data); - } -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketEnableCallBacks(data->socket, c); -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ - int c; - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - switch (event) - { - case GSOCK_CONNECTION: - if(socket->m_server) - c = kCFSocketReadCallBack; - else - c = kCFSocketConnectCallBack; - break; - case GSOCK_LOST: - case GSOCK_INPUT: - c = kCFSocketReadCallBack; - break; - case GSOCK_OUTPUT: - c = kCFSocketWriteCallBack; - break; - default: - c = 0; - } - CFSocketDisableCallBacks(data->socket, c); -} - -void _GSocket_Enable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - CFRunLoopAddSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopDefaultMode); -} - -void _GSocket_Disable_Events(GSocket *socket) -{ - struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket); - if (!data) return; - - /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */ - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes); - CFSocketInvalidate(data->socket); -} - -#endif // wxUSE_SOCKETS diff --git a/src/motif/gauge.cpp b/src/motif/gauge.cpp index 3cd261e8a1..4ab115b8a6 100644 --- a/src/motif/gauge.cpp +++ b/src/motif/gauge.cpp @@ -13,13 +13,8 @@ #pragma implementation "gauge.h" #endif -#ifdef __VMS +#ifdef __VMS__ #include -#undef XtDisplay -#undef XtScreen -#undef XtWindow -#undef XtIsRealized -#undef XtParent #endif # include "wx/gauge.h" diff --git a/src/motif/xmcombo/xmcombo.c b/src/motif/xmcombo/xmcombo.c index 601fe89c43..32f5686026 100644 --- a/src/motif/xmcombo/xmcombo.c +++ b/src/motif/xmcombo/xmcombo.c @@ -93,11 +93,6 @@ */ #ifdef __VMS #include -#undef XtDisplay -#undef XtScreen -#undef XtWindow -#undef XtIsRealized -#undef XtParent #endif #include diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 3c80ac8f54..eaa89292ad 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -139,6 +139,9 @@ void wxTopLevelWindowMSW::Init() m_iconized = m_maximizeOnShow = FALSE; + // unlike (almost?) all other windows, frames are created hidden + m_isShown = FALSE; + // Data to save/restore when calling ShowFullScreen m_fsStyle = 0; m_fsOldWindowStyle = 0; diff --git a/src/png/makefile.nt b/src/png/makefile.nt deleted file mode 100644 index ab823c8fc9..0000000000 --- a/src/png/makefile.nt +++ /dev/null @@ -1,68 +0,0 @@ -# -# File: makefile.nt -# Author: Julian Smart -# Created: 1993 -# Updated: -# Copyright: (c) 1993, AIAI, University of Edinburgh -# -# "%W% %G%" -# -# Makefile : Builds winpng.lib library for Windows 3.1 - -# Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = $(WXWIN) -WXLIB = $(WXDIR)\lib\wx.lib -WXINC = $(WXDIR)\include - -WINPNGDIR = ..\png -WINPNGINC = $(WINPNGDIR) -WINPNGLIB = ..\..\lib\winpng.lib - -INC = /I..\zlib - -FINAL=1 - -# Set this to nothing if your compiler is MS C++ 7 -ZOPTION= - -!ifndef FINAL -FINAL=0 -!endif - -PRECOMP=/YuWX.H - -!if "$(FINAL)" == "0" -OPT = /Od -CPPFLAGS= /W4 /Zi /MD /GX- $(ZOPTION) $(OPT) /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch -CFLAGS= /W4 /Zi /MD /GX- /Od /Dwx_msw $(INC) -LINKFLAGS=/NOD /CO /ONERROR:NOEXE -!else -# /Ox for real FINAL version -OPT = /O2 -CPPFLAGS= /W4 /MD /GX- /Dwx_msw $(INC) # $(PRECOMP) /Fp$(WXDIR)\src\msw\wx.pch -CFLAGS= /W4 /MD /GX- /Dwx_msw $(INC) -LINKFLAGS=/NOD /ONERROR:NOEXE -!endif - -OBJECTS = png.obj pngread.obj pngrtran.obj pngrutil.obj \ - pngpread.obj pngtrans.obj pngwrite.obj pngwtran.obj pngwutil.obj \ - pngerror.obj pngmem.obj pngwio.obj pngrio.obj pngget.obj pngset.obj - -all: $(WINPNGLIB) - -$(WINPNGLIB): $(OBJECTS) - erase $(WINPNGLIB) - lib @<< --out:$(WINPNGLIB) -$(OBJECTS) -<< - -.c.obj: - cl -DWIN32 $(OPT) $(CFLAGS) /c $*.c - -clean: - erase *.obj - erase *.exe - erase *.lib - -cleanall: clean diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index efedc9d763..c3a5c5a725 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -2549,8 +2549,10 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #if wxUSE_UNICODE wxMemoryBuffer buffer(len+1); success = (file.Read(buffer.GetData(), len) == len); - ((char*)buffer.GetData())[len] = 0; - contents = wxString(buffer, *wxConvCurrent); + if (success) { + ((char*)buffer.GetData())[len] = 0; + contents = wxString(buffer, *wxConvCurrent, len); + } #else wxString buffer; success = (file.Read(wxStringBuffer(buffer, len), len) == len); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 473e08d38e..a859ec1a47 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -358,8 +358,10 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) #if wxUSE_UNICODE wxMemoryBuffer buffer(len+1); success = (file.Read(buffer.GetData(), len) == len); - ((char*)buffer.GetData())[len] = 0; - contents = wxString(buffer, *wxConvCurrent); + if (success) { + ((char*)buffer.GetData())[len] = 0; + contents = wxString(buffer, *wxConvCurrent, len); + } #else wxString buffer; success = (file.Read(wxStringBuffer(buffer, len), len) == len); diff --git a/src/unix/net.cpp b/src/unix/net.cpp deleted file mode 100644 index 8fff0bfdd1..0000000000 --- a/src/unix/net.cpp +++ /dev/null @@ -1,422 +0,0 @@ -// -*- c++ -*- /////////////////////////////////////////////////////////////// -// Name: unix/net.cpp -// Purpose: Network related wxWindows classes and functions -// Author: Karsten Ballüder -// Modified by: -// Created: 03.10.99 -// RCS-ID: $Id$ -// Copyright: (c) Karsten Ballüder -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/setup.h" - -#if wxUSE_DIALUP_MANAGER - -#ifndef WX_PRECOMP -# include "wx/defs.h" -#endif // !PCH - -#include "wx/string.h" -#include "wx/event.h" -#include "wx/net.h" -#include "wx/timer.h" -#include "wx/filefn.h" -#include "wx/utils.h" -#include "wx/log.h" -#include "wx/file.h" - -#include -#include -#include -#include -#define __STRICT_ANSI__ -#include -#include -#include -#include -#include -#include - -// ---------------------------------------------------------------------------- -// A class which groups functions dealing with connecting to the network from a -// workstation using dial-up access to the net. There is at most one instance -// of this class in the program accessed via GetDialUpManager(). -// ---------------------------------------------------------------------------- - -/* TODO - * - * 1. more configurability for Unix: i.e. how to initiate the connection, how - * to check for online status, &c. - * 2. add a "long Dial(long connectionId = -1)" function which asks the user - * about which connection to dial (this may be done using native dialogs - * under NT, need generic dialogs for all others) and returns the identifier - * of the selected connection (it's opaque to the application) - it may be - * reused later to dial the same connection later (or use strings instead of - * longs may be?) - * 3. add an async version of dialing functions which notify the caller about - * the progress (or may be even start another thread to monitor it) - * 4. the static creation/accessor functions are not MT-safe - but is this - * really crucial? I think we may suppose they're always called from the - * main thread? - */ - -class WXDLLEXPORT wxDialUpManagerImpl : public wxDialUpManager -{ -public: - wxDialUpManagerImpl() - { - m_IsOnline = -1; // unknown - m_timer = NULL; - m_CanUseIfconfig = -1; // unknown - m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST; - m_BeaconPort = 80; - } - - /** Could the dialup manager be initialized correctly? If this function - returns FALSE, no other functions will work neither, so it's a good idea - to call this function and check its result before calling any other - wxDialUpManager methods. - */ - virtual bool IsOk() const - { return TRUE; } - - /** The simplest way to initiate a dial up: this function dials the given - ISP (exact meaning of the parameter depends on the platform), returns - TRUE on success or FALSE on failure and logs the appropriate error - message in the latter case. - @param nameOfISP optional paramater for dial program - @param username unused - @param password unused - */ - virtual bool Dial(const wxString& nameOfISP, - const wxString& WXUNUSED(username), - const wxString& WXUNUSED(password)); - - /// Hang up the currently active dial up connection. - virtual bool HangUp(); - - // returns TRUE if the computer is connected to the network: under Windows, - // this just means that a RAS connection exists, under Unix we check that - // the "well-known host" (as specified by SetWellKnownHost) is reachable - virtual bool IsOnline() const - { - if( (! m_timer) // we are not polling, so test now: - || m_IsOnline == -1 - ) - CheckStatus(); - return m_IsOnline != 0; - } - - // sometimes the built-in logic for determining the online status may fail, - // so, in general, the user should be allowed to override it. This function - // allows to forcefully set the online status - whatever our internal - // algorithm may think about it. - virtual void SetOnlineStatus(bool isOnline = TRUE) - { m_IsOnline = isOnline; } - - // set misc wxDialUpManager options - // -------------------------------- - - // enable automatical checks for the connection status and sending of - // wxEVT_DIALUP_CONNECTED/wxEVT_DIALUP_DISCONNECTED events. The interval - // parameter is only for Unix where we do the check manually: under - // Windows, the notification about the change of connection status is - // instantenous. - // - // Returns FALSE if couldn't set up automatic check for online status. - virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds); - - // disable automatic check for connection status change - notice that the - // wxEVT_DIALUP_XXX events won't be sent any more neither. - virtual void DisableAutoCheckOnlineStatus(); - - // under Unix, the value of well-known host is used to check whether we're - // connected to the internet. It's unused under Windows, but this function - // is always safe to call. The default value is www.yahoo.com. - virtual void SetWellKnownHost(const wxString& hostname, - int portno = 80); - /** Sets the commands to start up the network and to hang up - again. Used by the Unix implementations only. - */ - virtual void SetConnectCommand(const wxString &command, const wxString &hupcmd) - { m_ConnectCommand = command; m_HangUpCommand = hupcmd; } - -private: - /// -1: don´t know, 0 = no, 1 = yes - int m_IsOnline; - - /// Can we use ifconfig to list active devices? - int m_CanUseIfconfig; - /// The path to ifconfig - wxString m_IfconfigPath; - - /// beacon host: - wxString m_BeaconHost; - /// beacon host portnumber for connect: - int m_BeaconPort; - - /// command to connect to network - wxString m_ConnectCommand; - /// command to hang up - wxString m_HangUpCommand; - /// name of ISP - wxString m_ISPname; - /// a timer for regular testing - class AutoCheckTimer *m_timer; - - friend class AutoCheckTimer; - /// determine status - void CheckStatus(void) const; - - /// real status check - void CheckStatusInternal(void); -}; - - -class AutoCheckTimer : public wxTimer -{ -public: - AutoCheckTimer(wxDialUpManagerImpl *dupman) - { - m_dupman = dupman; - m_started = FALSE; - } - - virtual bool Start( int millisecs = -1 ) - { m_started = TRUE; return wxTimer::Start(millisecs, FALSE); } - - virtual void Notify() - { wxLogTrace("Checking dial up network status."); m_dupman->CheckStatus(); } - - virtual void Stop() - { if ( m_started ) wxTimer::Stop(); } -public: - bool m_started; - wxDialUpManagerImpl *m_dupman; -}; - -bool -wxDialUpManagerImpl::Dial(const wxString &isp, - const wxString & WXUNUSED(username), - const wxString & WXUNUSED(password)) -{ - if(m_IsOnline == 1) - return FALSE; - m_IsOnline = -1; - m_ISPname = isp; - wxString cmd; - if(m_ConnectCommand.Find("%s")) - cmd.Printf(m_ConnectCommand,m_ISPname.c_str()); - else - cmd = m_ConnectCommand; - return wxExecute(cmd, /* sync */ TRUE) == 0; -} - -bool -wxDialUpManagerImpl::HangUp(void) -{ - if(m_IsOnline == 0) - return FALSE; - m_IsOnline = -1; - wxString cmd; - if(m_HangUpCommand.Find("%s")) - cmd.Printf(m_HangUpCommand,m_ISPname.c_str()); - else - cmd = m_HangUpCommand; - return wxExecute(cmd, /* sync */ TRUE) == 0; -} - - -bool -wxDialUpManagerImpl::EnableAutoCheckOnlineStatus(size_t nSeconds) -{ - wxASSERT(m_timer == NULL); - m_timer = new AutoCheckTimer(this); - bool rc = m_timer->Start(nSeconds*1000); - if(! rc) - { - delete m_timer; - m_timer = NULL; - } - return rc; -} - -void -wxDialUpManagerImpl::DisableAutoCheckOnlineStatus() -{ - wxASSERT(m_timer != NULL); - m_timer->Stop(); - delete m_timer; - m_timer = NULL; -} - - -void -wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) -{ - /// does hostname contain a port number? - wxString port = hostname.After(':'); - if(port.Length()) - { - m_BeaconHost = hostname.Before(':'); - m_BeaconPort = atoi(port); - } - else - { - m_BeaconHost = hostname; - m_BeaconPort = portno; - } -} - - -void -wxDialUpManagerImpl::CheckStatus(void) const -{ - // This function calls the CheckStatusInternal() helper function - // which is OS - specific and then sends the events. - - int oldIsOnline = m_IsOnline; - ( /* non-const */ (wxDialUpManagerImpl *)this)->CheckStatusInternal(); - - // now send the events as appropriate: - if(m_IsOnline != oldIsOnline) - { - if(m_IsOnline) - ; // send ev - else - ; // send ev - } -} - -/* - We have three methods that we can use: - - 1. test via /sbin/ifconfig and grep for "sl", "ppp", "pl" - --> should be fast enough for regular polling - 2. test if we can reach the well known beacon host - --> too slow for polling - 3. check /proc/net/dev on linux?? - This method should be preferred, if possible. Need to do more - testing. - -*/ - -void -wxDialUpManagerImpl::CheckStatusInternal(void) -{ - m_IsOnline = -1; - - // First time check for ifconfig location. We only use the variant - // which does not take arguments, a la GNU. - if(m_CanUseIfconfig == -1) // unknown - { - if(wxFileExists("/sbin/ifconfig")) - m_IfconfigPath = "/sbin/ifconfig"; - else if(wxFileExists("/usr/sbin/ifconfig")) - m_IfconfigPath = "/usr/sbin/ifconfig"; - } - - wxLogNull ln; // suppress all error messages - // Let´s try the ifconfig method first, should be fastest: - if(m_CanUseIfconfig != 0) // unknown or yes - { - wxASSERT(m_IfconfigPath.length()); - - wxString tmpfile = wxGetTempFileName("_wxdialuptest"); - wxString cmd = "/bin/sh -c \'"; - cmd << m_IfconfigPath << " >" << tmpfile << '\''; - /* I tried to add an option to wxExecute() to not close stdout, - so we could let ifconfig write directly to the tmpfile, but - this does not work. That should be faster, as it doesn´t call - the shell first. I have no idea why. :-( (KB) */ -#if 0 - // temporarily redirect stdout/stderr: - int - new_stdout = dup(STDOUT_FILENO), - new_stderr = dup(STDERR_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); - - int - // new stdout: - output_fd = open(tmpfile, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR), - // new stderr: - null_fd = open("/dev/null", O_CREAT, S_IRUSR|S_IWUSR); - // verify well behaved unix behaviour: - wxASSERT(output_fd == STDOUT_FILENO); - wxASSERT(null_fd == STDERR_FILENO); - int rc = wxExecute(m_IfconfigPath,TRUE /* sync */,NULL ,wxEXECUTE_DONT_CLOSE_FDS); - close(null_fd); close(output_fd); - // restore old stdout, stderr: - int test; - test = dup(new_stdout); close(new_stdout); wxASSERT(test == STDOUT_FILENO); - test = dup(new_stderr); close(new_stderr); wxASSERT(test == STDERR_FILENO); - if(rc == 0) -#endif - if(wxExecute(cmd,TRUE /* sync */) == 0) - { - m_CanUseIfconfig = 1; - wxFile file; - if( file.Open(tmpfile) ) - { - char *output = new char [file.Length()+1]; - output[file.Length()] = '\0'; - if(file.Read(output,file.Length()) == file.Length()) - { - if(strstr(output,"ppp") // ppp - || strstr(output,"sl") // slip - || strstr(output,"pl") // plip - ) - m_IsOnline = 1; - else - m_IsOnline = 0; - } - file.Close(); - delete [] output; - } - // else m_IsOnline remains -1 as we don't know for sure - } - else // could not run ifconfig correctly - m_CanUseIfconfig = 0; // don´t try again - (void) wxRemoveFile(tmpfile); - if(m_IsOnline != -1) // we are done - return; - } - - // second method: try to connect to well known host: - // This can be used under Win 9x, too! - struct hostent *hp; - struct sockaddr_in serv_addr; - int sockfd; - - m_IsOnline = 0; // assume false - if((hp = gethostbyname(m_BeaconHost)) == NULL) - return; // no DNS no net - - serv_addr.sin_family = hp->h_addrtype; - memcpy(&serv_addr.sin_addr,hp->h_addr, hp->h_length); - serv_addr.sin_port = htons(m_BeaconPort); - if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) - { - // sys_error("cannot create socket for gw"); - return; - } - if( connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) - { - //sys_error("cannot connect to server"); - return; - } - //connected! - close(sockfd); -} - - -/* static */ -wxDialUpManager * -wxDialUpManager::wxDialUpManager::Create(void) -{ - return new wxDialUpManagerImpl; -} - -#endif // wxUSE_DIALUP_MANAGER diff --git a/utils/HelpGen/helpgen.dsp b/utils/HelpGen/helpgen.dsp deleted file mode 100644 index 30abedd5e4..0000000000 --- a/utils/HelpGen/helpgen.dsp +++ /dev/null @@ -1,471 +0,0 @@ -# Microsoft Developer Studio Project File - Name="HelpGen" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=HelpGen - Win32 DLL Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "helpgen.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "helpgen.mak" CFG="HelpGen - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "HelpGen - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Unicode Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Universal Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Universal Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Universal Unicode Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 Universal Unicode Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Unicode Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Unicode Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Universal Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Universal Release" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Universal Unicode Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "HelpGen - Win32 DLL Universal Unicode Release" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "HelpGen - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswd" -# PROP BASE Intermediate_Dir "vc_mswd\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswd" -# PROP Intermediate_Dir "vc_mswd\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswd\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswd\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswd" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswd" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswd\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswd\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_msw" -# PROP BASE Intermediate_Dir "vc_msw\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_msw" -# PROP Intermediate_Dir "vc_msw\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_msw\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\msw" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_msw\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\msw" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\msw" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\msw" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_msw\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_msw\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswud" -# PROP BASE Intermediate_Dir "vc_mswud\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswud" -# PROP Intermediate_Dir "vc_mswud\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswud\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswud\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswud" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswud" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswud\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswud\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswu" -# PROP BASE Intermediate_Dir "vc_mswu\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswu" -# PROP Intermediate_Dir "vc_mswu\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswu\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswu\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswu" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswu" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswu\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswu\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswunivd" -# PROP BASE Intermediate_Dir "vc_mswunivd\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswunivd" -# PROP Intermediate_Dir "vc_mswunivd\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivd\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivd\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivd" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivd" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivd\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivd\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswuniv" -# PROP BASE Intermediate_Dir "vc_mswuniv\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswuniv" -# PROP Intermediate_Dir "vc_mswuniv\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswuniv\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswuniv" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswuniv\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswuniv" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswuniv" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswuniv" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswuniv\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswuniv\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswunivud" -# PROP BASE Intermediate_Dir "vc_mswunivud\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswunivud" -# PROP Intermediate_Dir "vc_mswunivud\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivud\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivud\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivud" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivud" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivud\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivud\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswunivu" -# PROP BASE Intermediate_Dir "vc_mswunivu\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswunivu" -# PROP Intermediate_Dir "vc_mswunivu\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivu\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivu\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_lib\mswunivu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivu" /i "." /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_lib\mswunivu" /i "." /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivu\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console -# ADD LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivu\HelpGen.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswddll" -# PROP BASE Intermediate_Dir "vc_mswddll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswddll" -# PROP Intermediate_Dir "vc_mswddll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswd" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswd" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswdll" -# PROP BASE Intermediate_Dir "vc_mswdll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswdll" -# PROP Intermediate_Dir "vc_mswdll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswdll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\msw" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswdll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\msw" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\msw" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\msw" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswdll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswdll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswuddll" -# PROP BASE Intermediate_Dir "vc_mswuddll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswuddll" -# PROP Intermediate_Dir "vc_mswuddll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswuddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswuddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswud" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswud" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswuddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswuddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswudll" -# PROP BASE Intermediate_Dir "vc_mswudll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswudll" -# PROP Intermediate_Dir "vc_mswudll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswudll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswudll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswu" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswu" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswudll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswudll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Universal Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswunivddll" -# PROP BASE Intermediate_Dir "vc_mswunivddll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswunivddll" -# PROP Intermediate_Dir "vc_mswunivddll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivd" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivd" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivd" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Universal Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswunivdll" -# PROP BASE Intermediate_Dir "vc_mswunivdll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswunivdll" -# PROP Intermediate_Dir "vc_mswunivdll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivdll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswuniv" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivdll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswuniv" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswuniv" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswuniv" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivdll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivdll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Universal Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_mswunivuddll" -# PROP BASE Intermediate_Dir "vc_mswunivuddll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_mswunivuddll" -# PROP Intermediate_Dir "vc_mswunivuddll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivuddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MDd /Zi /Gm /GZ /Fdvc_mswunivuddll\HelpGen.pdb /Od /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivud" /W4 /I "." /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WXDEBUG__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivud" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "__WXDEBUG__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivud" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\HelpGen.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ELSEIF "$(CFG)" == "HelpGen - Win32 DLL Universal Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_mswunivudll" -# PROP BASE Intermediate_Dir "vc_mswunivudll\HelpGen" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_mswunivudll" -# PROP Intermediate_Dir "vc_mswunivudll\HelpGen" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivudll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD CPP /nologo /FD /GR /GX /MD /Fdvc_mswunivudll\HelpGen.pdb /O1 /I ".\..\..\include" /I ".\..\..\lib\vc_dll\mswunivu" /W4 /I "." /D "WIN32" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "_CONSOLE" /c -# ADD BASE RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivu" /i "." /d "WXUSINGDLL" /d _CONSOLE -# ADD RSC /l 0x405 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\include" /i ".\..\..\lib\vc_dll\mswunivu" /i "." /d "WXUSINGDLL" /d _CONSOLE -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivudll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console -# ADD LINK32 wxbase25u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib /nologo /machine:i386 /out:"vc_mswunivudll\HelpGen.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:console - -!ENDIF - -# Begin Target - -# Name "HelpGen - Win32 Debug" -# Name "HelpGen - Win32 Release" -# Name "HelpGen - Win32 Unicode Debug" -# Name "HelpGen - Win32 Unicode Release" -# Name "HelpGen - Win32 Universal Debug" -# Name "HelpGen - Win32 Universal Release" -# Name "HelpGen - Win32 Universal Unicode Debug" -# Name "HelpGen - Win32 Universal Unicode Release" -# Name "HelpGen - Win32 DLL Debug" -# Name "HelpGen - Win32 DLL Release" -# Name "HelpGen - Win32 DLL Unicode Debug" -# Name "HelpGen - Win32 DLL Unicode Release" -# Name "HelpGen - Win32 DLL Universal Debug" -# Name "HelpGen - Win32 DLL Universal Release" -# Name "HelpGen - Win32 DLL Universal Unicode Debug" -# Name "HelpGen - Win32 DLL Universal Unicode Release" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\HelpGen.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\cjparser.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\docripper.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\ifcontext.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\markup.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\scriptbinder.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\sourcepainter.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\srcparser.cpp -# End Source File -# End Group -# End Target -# End Project - diff --git a/utils/HelpGen/makefile.bcc b/utils/HelpGen/makefile.bcc deleted file mode 100644 index 3f62df1ccc..0000000000 --- a/utils/HelpGen/makefile.bcc +++ /dev/null @@ -1,181 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.1.1 (http://bakefile.sourceforge.net) -# Do not modify, all changes will be overwritten! -# ========================================================================= - -!ifndef BCCDIR -BCCDIR = $(MAKEDIR)\.. -!endif - -!include ../../build/msw/config.bcc - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -!if "$(BCCDIR)" == "\.." -!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4 -!endif - -### Variables: ### - -HELPGEN_CXXFLAGS = $(CPPFLAGS) $(__RUNTIME_LIBS_6) -I$(BCCDIR)\include \ - $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) -tWM -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ - $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -I.\..\..\include -I$(SETUPHDIR) \ - -I. $(__DLLFLAG_p) $(CXXFLAGS) -HELPGEN_OBJECTS = \ - $(OBJS)\HelpGen_HelpGen.obj \ - $(OBJS)\HelpGen_cjparser.obj \ - $(OBJS)\HelpGen_docripper.obj \ - $(OBJS)\HelpGen_ifcontext.obj \ - $(OBJS)\HelpGen_markup.obj \ - $(OBJS)\HelpGen_scriptbinder.obj \ - $(OBJS)\HelpGen_sourcepainter.obj \ - $(OBJS)\HelpGen_srcparser.obj -OBJS = \ - bcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -SETUPHDIR = \ - $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) - -### Conditionally set variables: ### - -!if "$(SHARED)" == "0" -LIBDIRNAME = .\..\..\lib\bcc_lib$(CFG) -!endif -!if "$(SHARED)" == "1" -LIBDIRNAME = .\..\..\lib\bcc_dll$(CFG) -!endif -!if "$(USE_GUI)" == "0" -PORTNAME = base -!endif -!if "$(USE_GUI)" == "1" -PORTNAME = msw -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default" -WXDEBUGFLAG = d -!endif -!if "$(DEBUG_FLAG)" == "1" -WXDEBUGFLAG = d -!endif -!if "$(SHARED)" == "1" -WXDLLFLAG = dll -!endif -!if "$(UNICODE)" == "1" -WXUNICODEFLAG = u -!endif -!if "$(WXUNIV)" == "1" -WXUNIVNAME = univ -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO = -v -!endif -!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO = -v- -!endif -!if "$(DEBUG_INFO)" == "0" -__DEBUGINFO = -v- -!endif -!if "$(DEBUG_INFO)" == "1" -__DEBUGINFO = -v -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default" -__DEBUG_DEFINE_p = -D__WXDEBUG__ -!endif -!if "$(DEBUG_FLAG)" == "1" -__DEBUG_DEFINE_p = -D__WXDEBUG__ -!endif -!if "$(SHARED)" == "1" -__DLLFLAG_p = -DWXUSINGDLL -!endif -!if "$(USE_GUI)" == "1" -__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib -!endif -!if "$(USE_GUI)" == "1" -__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib -!endif -!if "$(USE_GUI)" == "1" -__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib -!endif -!if "$(BUILD)" == "debug" -__OPTIMIZEFLAG_2 = -Od -!endif -!if "$(BUILD)" == "release" -__OPTIMIZEFLAG_2 = -O2 -!endif -!if "$(RUNTIME_LIBS)" == "dynamic" -__RUNTIME_LIBS_6 = -tWR -!endif -!if "$(RUNTIME_LIBS)" == "static" -__RUNTIME_LIBS_6 = -!endif -!if "$(RUNTIME_LIBS)" == "dynamic" -__RUNTIME_LIBS_7 = i -!endif -!if "$(RUNTIME_LIBS)" == "static" -__RUNTIME_LIBS_7 = -!endif -!if "$(UNICODE)" == "1" -__UNICODE_DEFINE_p = -D_UNICODE -!endif -!if "$(MSLU)" == "1" -__UNICOWS_LIB_p = unicows.lib -!endif -!if "$(MONOLITHIC)" == "0" -__WXLIB_BASE_p = wxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -!if "$(MONOLITHIC)" == "1" -__WXLIB_MONO_p = \ - wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -!if "$(WXUNIV)" == "1" -__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__ -!endif - - -all: $(OBJS) -$(OBJS): - -if not exist $(OBJS) mkdir $(OBJS) - -### Targets: ### - -all: $(OBJS)\HelpGen.exe - -$(OBJS)\HelpGen_HelpGen.obj: .\src\HelpGen.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_cjparser.obj: .\src\cjparser.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_docripper.obj: .\src\docripper.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_ifcontext.obj: .\src\ifcontext.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_markup.obj: .\src\markup.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_scriptbinder.obj: .\src\scriptbinder.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_sourcepainter.obj: .\src\sourcepainter.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_srcparser.obj: .\src\srcparser.cpp - $(CXX) -q -c -P -o$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen.exe: $(HELPGEN_OBJECTS) - ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib $(__DEBUGINFO) -L$(LIBDIRNAME) -ap @&&| - c0x32.obj $(HELPGEN_OBJECTS),$@,, $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(__UNICOWS_LIB_p) import32.lib ole2w32.lib import32.lib cw32mt$(__RUNTIME_LIBS_7).lib,, -| - -clean: - -if exist $(OBJS)\*.obj del $(OBJS)\*.obj - -if exist $(OBJS)\*.res del $(OBJS)\*.res - -if exist $(OBJS)\HelpGen.exe del $(OBJS)\HelpGen.exe - -if exist $(OBJS)\HelpGen.tds del $(OBJS)\HelpGen.tds - -if exist $(OBJS)\HelpGen.ilc del $(OBJS)\HelpGen.ilc - -if exist $(OBJS)\HelpGen.ild del $(OBJS)\HelpGen.ild - -if exist $(OBJS)\HelpGen.ilf del $(OBJS)\HelpGen.ilf - -if exist $(OBJS)\HelpGen.ils del $(OBJS)\HelpGen.ils diff --git a/utils/HelpGen/makefile.gcc b/utils/HelpGen/makefile.gcc deleted file mode 100644 index 24bdecd4cf..0000000000 --- a/utils/HelpGen/makefile.gcc +++ /dev/null @@ -1,166 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.1.1 (http://bakefile.sourceforge.net) -# Do not modify, all changes will be overwritten! -# ========================================================================= - -include ../../build/msw/config.gcc - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -HELPGEN_CXXFLAGS = $(CPPFLAGS) $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(GCCFLAGS) \ - -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ - $(__UNICODE_DEFINE_p) -I.\..\..\include -I$(SETUPHDIR) -Wall -I. \ - $(__DLLFLAG_p) $(CXXFLAGS) -HELPGEN_OBJECTS = \ - $(OBJS)\HelpGen_HelpGen.o \ - $(OBJS)\HelpGen_cjparser.o \ - $(OBJS)\HelpGen_docripper.o \ - $(OBJS)\HelpGen_ifcontext.o \ - $(OBJS)\HelpGen_markup.o \ - $(OBJS)\HelpGen_scriptbinder.o \ - $(OBJS)\HelpGen_sourcepainter.o \ - $(OBJS)\HelpGen_srcparser.o -OBJS = \ - gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -SETUPHDIR = \ - $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) - -### Conditionally set variables: ### - -ifeq ($(GCC_VERSION),2.95) -GCCFLAGS = -fvtable-thunks -endif -ifeq ($(SHARED),0) -LIBDIRNAME = .\..\..\lib\gcc_lib$(CFG) -endif -ifeq ($(SHARED),1) -LIBDIRNAME = .\..\..\lib\gcc_dll$(CFG) -endif -ifeq ($(USE_GUI),0) -PORTNAME = base -endif -ifeq ($(USE_GUI),1) -PORTNAME = msw -endif -ifeq ($(BUILD),debug) -ifeq ($(DEBUG_FLAG),default) -WXDEBUGFLAG = d -endif -endif -ifeq ($(DEBUG_FLAG),1) -WXDEBUGFLAG = d -endif -ifeq ($(SHARED),1) -WXDLLFLAG = dll -endif -ifeq ($(UNICODE),1) -WXUNICODEFLAG = u -endif -ifeq ($(WXUNIV),1) -WXUNIVNAME = univ -endif -ifeq ($(BUILD),debug) -ifeq ($(DEBUG_INFO),default) -__DEBUGINFO = -g -endif -endif -ifeq ($(BUILD),release) -ifeq ($(DEBUG_INFO),default) -__DEBUGINFO = -endif -endif -ifeq ($(DEBUG_INFO),0) -__DEBUGINFO = -endif -ifeq ($(DEBUG_INFO),1) -__DEBUGINFO = -g -endif -ifeq ($(BUILD),debug) -ifeq ($(DEBUG_FLAG),default) -__DEBUG_DEFINE_p = -D__WXDEBUG__ -endif -endif -ifeq ($(DEBUG_FLAG),1) -__DEBUG_DEFINE_p = -D__WXDEBUG__ -endif -ifeq ($(SHARED),1) -__DLLFLAG_p = -DWXUSINGDLL -endif -ifeq ($(USE_GUI),1) -__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG) -endif -ifeq ($(USE_GUI),1) -__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG) -endif -ifeq ($(USE_GUI),1) -__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG) -endif -ifeq ($(BUILD),debug) -__OPTIMIZEFLAG_2 = -O0 -endif -ifeq ($(BUILD),release) -__OPTIMIZEFLAG_2 = -O2 -endif -ifeq ($(UNICODE),1) -__UNICODE_DEFINE_p = -D_UNICODE -endif -ifeq ($(MSLU),1) -__UNICOWS_LIB_p = -lunicows -endif -ifeq ($(MONOLITHIC),0) -__WXLIB_BASE_p = -lwxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG) -endif -ifeq ($(MONOLITHIC),1) -__WXLIB_MONO_p = \ - -lwx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG) -endif -ifeq ($(WXUNIV),1) -__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__ -endif - - -all: $(OBJS) -$(OBJS): - -if not exist $(OBJS) mkdir $(OBJS) - -### Targets: ### - -all: $(OBJS)\HelpGen.exe - -$(OBJS)\HelpGen_HelpGen.o: ./src/HelpGen.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_cjparser.o: ./src/cjparser.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_docripper.o: ./src/docripper.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_ifcontext.o: ./src/ifcontext.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_markup.o: ./src/markup.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_scriptbinder.o: ./src/scriptbinder.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_sourcepainter.o: ./src/sourcepainter.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_srcparser.o: ./src/srcparser.cpp - $(CXX) -c -o $@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen.exe: $(HELPGEN_OBJECTS) - $(CXX) -o $@ $(HELPGEN_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) -mthreads -L$(LIBDIRNAME) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 - -clean: - -if exist $(OBJS)\*.o del $(OBJS)\*.o - -if exist $(OBJS)\HelpGen.exe del $(OBJS)\HelpGen.exe - -.PHONY: all clean diff --git a/utils/HelpGen/makefile.vc b/utils/HelpGen/makefile.vc deleted file mode 100644 index 5f801f0621..0000000000 --- a/utils/HelpGen/makefile.vc +++ /dev/null @@ -1,219 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.1.1 (http://bakefile.sourceforge.net) -# Do not modify, all changes will be overwritten! -# ========================================================================= - -!include <../../build/msw/config.vc> - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -HELPGEN_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS_7)$(__DEBUGRUNTIME_3) \ - /DWIN32 $(__DEBUGINFO_0) /Fd$(OBJS)\HelpGen.pdb $(____DEBUGRUNTIME_2_p) \ - $(__OPTIMIZEFLAG_4) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ - $(__UNICODE_DEFINE_p) /I.\..\..\include /I$(SETUPHDIR) /W4 /I. $(__DLLFLAG_p) \ - /D_CONSOLE $(CXXFLAGS) /GR /GX -HELPGEN_OBJECTS = \ - $(OBJS)\HelpGen_HelpGen.obj \ - $(OBJS)\HelpGen_cjparser.obj \ - $(OBJS)\HelpGen_docripper.obj \ - $(OBJS)\HelpGen_ifcontext.obj \ - $(OBJS)\HelpGen_markup.obj \ - $(OBJS)\HelpGen_scriptbinder.obj \ - $(OBJS)\HelpGen_sourcepainter.obj \ - $(OBJS)\HelpGen_srcparser.obj -OBJS = \ - vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -SETUPHDIR = \ - $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) - -### Conditionally set variables: ### - -!if "$(SHARED)" == "0" -LIBDIRNAME = .\..\..\lib\vc_lib$(CFG) -!endif -!if "$(SHARED)" == "1" -LIBDIRNAME = .\..\..\lib\vc_dll$(CFG) -!endif -!if "$(USE_GUI)" == "0" -PORTNAME = base -!endif -!if "$(USE_GUI)" == "1" -PORTNAME = msw -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default" -WXDEBUGFLAG = d -!endif -!if "$(DEBUG_FLAG)" == "1" -WXDEBUGFLAG = d -!endif -!if "$(SHARED)" == "1" -WXDLLFLAG = dll -!endif -!if "$(UNICODE)" == "1" -WXUNICODEFLAG = u -!endif -!if "$(WXUNIV)" == "1" -WXUNIVNAME = univ -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_0 = /Zi -!endif -!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_0 = -!endif -!if "$(DEBUG_INFO)" == "0" -__DEBUGINFO_0 = -!endif -!if "$(DEBUG_INFO)" == "1" -__DEBUGINFO_0 = /Zi -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_1 = /DEBUG -!endif -!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_1 = -!endif -!if "$(DEBUG_INFO)" == "0" -__DEBUGINFO_1 = -!endif -!if "$(DEBUG_INFO)" == "1" -__DEBUGINFO_1 = /DEBUG -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_3 = d -!endif -!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" -__DEBUGINFO_3 = -!endif -!if "$(DEBUG_INFO)" == "0" -__DEBUGINFO_3 = -!endif -!if "$(DEBUG_INFO)" == "1" -__DEBUGINFO_3 = d -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "0" -__DEBUGRUNTIME_3 = -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "1" -__DEBUGRUNTIME_3 = d -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "default" -__DEBUGRUNTIME_3 = $(__DEBUGINFO_3) -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default" -__DEBUG_DEFINE_p = /D__WXDEBUG__ -!endif -!if "$(DEBUG_FLAG)" == "1" -__DEBUG_DEFINE_p = /D__WXDEBUG__ -!endif -!if "$(SHARED)" == "1" -__DLLFLAG_p = /DWXUSINGDLL -!endif -!if "$(USE_GUI)" == "1" -__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib -!endif -!if "$(USE_GUI)" == "1" -__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib -!endif -!if "$(USE_GUI)" == "1" -__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib -!endif -!if "$(BUILD)" == "debug" -__OPTIMIZEFLAG_4 = /Od -!endif -!if "$(BUILD)" == "release" -__OPTIMIZEFLAG_4 = /O2 -!endif -!if "$(RUNTIME_LIBS)" == "dynamic" -__RUNTIME_LIBS_7 = D -!endif -!if "$(RUNTIME_LIBS)" == "static" -__RUNTIME_LIBS_7 = T -!endif -!if "$(UNICODE)" == "1" -__UNICODE_DEFINE_p = /D_UNICODE -!endif -!if "$(MSLU)" == "1" -__UNICOWS_LIB_p = unicows.lib -!endif -!if "$(MONOLITHIC)" == "0" -__WXLIB_BASE_p = wxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -!if "$(MONOLITHIC)" == "1" -__WXLIB_MONO_p = \ - wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -!if "$(WXUNIV)" == "1" -__WXUNIV_DEFINE_p = /D__WXUNIVERSAL__ -!endif -!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default" -____DEBUGINFO_2_p = /D_DEBUG -!endif -!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default" -____DEBUGINFO_2_p = -!endif -!if "$(DEBUG_INFO)" == "0" -____DEBUGINFO_2_p = -!endif -!if "$(DEBUG_INFO)" == "1" -____DEBUGINFO_2_p = /D_DEBUG -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "0" -____DEBUGRUNTIME_2_p = -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "1" -____DEBUGRUNTIME_2_p = /D_DEBUG -!endif -!if "$(DEBUG_RUNTIME_LIBS)" == "default" -____DEBUGRUNTIME_2_p = $(____DEBUGINFO_2_p) -!endif - - -all: $(OBJS) -$(OBJS): - -if not exist $(OBJS) mkdir $(OBJS) - -### Targets: ### - -all: $(OBJS)\HelpGen.exe - -$(OBJS)\HelpGen_HelpGen.obj: .\src\HelpGen.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_cjparser.obj: .\src\cjparser.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_docripper.obj: .\src\docripper.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_ifcontext.obj: .\src\ifcontext.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_markup.obj: .\src\markup.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_scriptbinder.obj: .\src\scriptbinder.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_sourcepainter.obj: .\src\sourcepainter.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen_srcparser.obj: .\src\srcparser.cpp - $(CXX) /c /nologo /TP /Fo$@ $(HELPGEN_CXXFLAGS) $** - -$(OBJS)\HelpGen.exe: $(HELPGEN_OBJECTS) - link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_1) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE @<< - $(HELPGEN_OBJECTS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(__UNICOWS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib -<< - -clean: - -if exist $(OBJS)\*.obj del $(OBJS)\*.obj - -if exist $(OBJS)\*.res del $(OBJS)\*.res - -if exist $(OBJS)\HelpGen.exe del $(OBJS)\HelpGen.exe - -if exist $(OBJS)\HelpGen.ilk del $(OBJS)\HelpGen.ilk - -if exist $(OBJS)\HelpGen.pdb del $(OBJS)\HelpGen.pdb diff --git a/utils/HelpGen/makefile.wat b/utils/HelpGen/makefile.wat deleted file mode 100644 index 615dfc93dd..0000000000 --- a/utils/HelpGen/makefile.wat +++ /dev/null @@ -1,225 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.1.1 (http://bakefile.sourceforge.net) -# Do not modify, all changes will be overwritten! -# ========================================================================= - -!include ../../build/msw/config.wat - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -# Speed up compilation a bit: -!ifdef __LOADDLL__ -! loaddll wcc wccd -! loaddll wccaxp wccdaxp -! loaddll wcc386 wccd386 -! loaddll wpp wppdi86 -! loaddll wppaxp wppdaxp -! loaddll wpp386 wppd386 -! loaddll wlink wlink -! loaddll wlib wlibd -!endif - -# We need these variables in some bakefile-made rules: -WATCOM_CWD = $+ $(%cdrive):$(%cwd) $- - -### Conditionally set variables: ### - -LIBDIRNAME = -!ifeq SHARED 0 -LIBDIRNAME = .\..\..\lib\wat_lib$(CFG) -!endif -!ifeq SHARED 1 -LIBDIRNAME = .\..\..\lib\wat_dll$(CFG) -!endif -PORTNAME = -!ifeq USE_GUI 0 -PORTNAME = base -!endif -!ifeq USE_GUI 1 -PORTNAME = msw -!endif -WXDEBUGFLAG = -!ifeq BUILD debug -!ifeq DEBUG_FLAG default -WXDEBUGFLAG = d -!endif -!endif -!ifeq DEBUG_FLAG 1 -WXDEBUGFLAG = d -!endif -WXDLLFLAG = -!ifeq SHARED 1 -WXDLLFLAG = dll -!endif -WXUNICODEFLAG = -!ifeq UNICODE 1 -WXUNICODEFLAG = u -!endif -WXUNIVNAME = -!ifeq WXUNIV 1 -WXUNIVNAME = univ -!endif -__DEBUGINFO_0 = -!ifeq BUILD debug -!ifeq DEBUG_INFO default -__DEBUGINFO_0 = -d2 -!endif -!endif -!ifeq BUILD release -!ifeq DEBUG_INFO default -__DEBUGINFO_0 = -d0 -!endif -!endif -!ifeq DEBUG_INFO 0 -__DEBUGINFO_0 = -d0 -!endif -!ifeq DEBUG_INFO 1 -__DEBUGINFO_0 = -d2 -!endif -__DEBUGINFO_1 = -!ifeq BUILD debug -!ifeq DEBUG_INFO default -__DEBUGINFO_1 = debug all -!endif -!endif -!ifeq BUILD release -!ifeq DEBUG_INFO default -__DEBUGINFO_1 = -!endif -!endif -!ifeq DEBUG_INFO 0 -__DEBUGINFO_1 = -!endif -!ifeq DEBUG_INFO 1 -__DEBUGINFO_1 = debug all -!endif -__DEBUG_DEFINE_p = -!ifeq BUILD debug -!ifeq DEBUG_FLAG default -__DEBUG_DEFINE_p = -d__WXDEBUG__ -!endif -!endif -!ifeq DEBUG_FLAG 1 -__DEBUG_DEFINE_p = -d__WXDEBUG__ -!endif -__DLLFLAG_p = -!ifeq SHARED 1 -__DLLFLAG_p = -dWXUSINGDLL -!endif -__LIB_JPEG_p = -!ifeq USE_GUI 1 -__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib -!endif -__LIB_PNG_p = -!ifeq USE_GUI 1 -__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib -!endif -__LIB_TIFF_p = -!ifeq USE_GUI 1 -__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib -!endif -__OPTIMIZEFLAG_2 = -!ifeq BUILD debug -__OPTIMIZEFLAG_2 = -od -!endif -!ifeq BUILD release -__OPTIMIZEFLAG_2 = -ot -ox -!endif -__RUNTIME_LIBS_5 = -!ifeq RUNTIME_LIBS dynamic -__RUNTIME_LIBS_5 = -br -!endif -!ifeq RUNTIME_LIBS static -__RUNTIME_LIBS_5 = -!endif -__UNICODE_DEFINE_p = -!ifeq UNICODE 1 -__UNICODE_DEFINE_p = -d_UNICODE -!endif -__WXLIB_BASE_p = -!ifeq MONOLITHIC 0 -__WXLIB_BASE_p = wxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -__WXLIB_MONO_p = -!ifeq MONOLITHIC 1 -__WXLIB_MONO_p = & - wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib -!endif -__WXUNIV_DEFINE_p = -!ifeq WXUNIV 1 -__WXUNIV_DEFINE_p = -d__WXUNIVERSAL__ -!endif - -### Variables: ### - -HELPGEN_CXXFLAGS = $(CPPFLAGS) $(__DEBUGINFO_0) $(__OPTIMIZEFLAG_2) -bm & - $(__RUNTIME_LIBS_5) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) & - $(__UNICODE_DEFINE_p) -i=.\..\..\include -i=$(SETUPHDIR) -i=. $(__DLLFLAG_p) & - $(CXXFLAGS) -HELPGEN_OBJECTS = & - $(OBJS)\HelpGen_HelpGen.obj & - $(OBJS)\HelpGen_cjparser.obj & - $(OBJS)\HelpGen_docripper.obj & - $(OBJS)\HelpGen_ifcontext.obj & - $(OBJS)\HelpGen_markup.obj & - $(OBJS)\HelpGen_scriptbinder.obj & - $(OBJS)\HelpGen_sourcepainter.obj & - $(OBJS)\HelpGen_srcparser.obj -OBJS = & - wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -SETUPHDIR = & - $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) - - -all : $(OBJS) -$(OBJS) : - -if not exist $(OBJS) mkdir $(OBJS) - -### Targets: ### - -all : .SYMBOLIC $(OBJS)\HelpGen.exe - -$(OBJS)\HelpGen_HelpGen.obj : .AUTODEPEND .\src\HelpGen.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_cjparser.obj : .AUTODEPEND .\src\cjparser.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_docripper.obj : .AUTODEPEND .\src\docripper.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_ifcontext.obj : .AUTODEPEND .\src\ifcontext.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_markup.obj : .AUTODEPEND .\src\markup.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_scriptbinder.obj : .AUTODEPEND .\src\scriptbinder.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_sourcepainter.obj : .AUTODEPEND .\src\sourcepainter.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen_srcparser.obj : .AUTODEPEND .\src\srcparser.cpp - $(CXX) -zq -fo=$^@ $(HELPGEN_CXXFLAGS) $< - -$(OBJS)\HelpGen.exe : $(HELPGEN_OBJECTS) - @%create $(OBJS)\HelpGen.lbc - @%append $(OBJS)\HelpGen.lbc option quiet - @%append $(OBJS)\HelpGen.lbc name $^@ - @%append $(OBJS)\HelpGen.lbc option caseexact - @%append $(OBJS)\HelpGen.lbc $(LDFLAGS) $(__DEBUGINFO_1) libpath $(LIBDIRNAME) system nt ref 'main_' - @for %i in ($(HELPGEN_OBJECTS)) do @%append $(OBJS)\HelpGen.lbc file %i - @for %i in ( $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib) do @%append $(OBJS)\HelpGen.lbc library %i - @%append $(OBJS)\HelpGen.lbc - wlink @$(OBJS)\HelpGen.lbc - -clean : .SYMBOLIC - -if exist $(OBJS)\*.obj del $(OBJS)\*.obj - -if exist $(OBJS)\*.res del $(OBJS)\*.res - -if exist $(OBJS)\*.lbc del $(OBJS)\*.lbc - -if exist $(OBJS)\*.ilk del $(OBJS)\*.ilk - -if exist $(OBJS)\HelpGen.exe del $(OBJS)\HelpGen.exe diff --git a/utils/wxprop/src/prop.cpp b/utils/wxprop/src/prop.cpp deleted file mode 100644 index 59802962de..0000000000 --- a/utils/wxprop/src/prop.cpp +++ /dev/null @@ -1,1119 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: prop.cpp -// Purpose: Propert sheet classes implementation -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows license -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "prop.h" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#include -#include -#include -#include - -#if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) -#include -#else -#include -#endif -#else -#include -#endif - -#include "wx/window.h" -#include "wx/utils.h" -#include "wx/list.h" -#include "prop.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPropertyValue, wxObject) - -wxPropertyValue::wxPropertyValue(void) -{ - m_type = wxPropertyValueNull; - m_next = NULL; - m_last = NULL; - m_value.first = NULL; - m_clientData = NULL; - m_modifiedFlag = FALSE; -} - -wxPropertyValue::wxPropertyValue(const wxPropertyValue& copyFrom) -{ - m_modifiedFlag = FALSE; - Copy((wxPropertyValue& )copyFrom); -} - -wxPropertyValue::wxPropertyValue(const char *val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueString; - - m_value.string = copystring(val); - m_clientData = NULL; - m_next = NULL; - m_last = NULL; -} - -wxPropertyValue::wxPropertyValue(const wxString& val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueString; - - m_value.string = copystring((const char *)val); - m_clientData = NULL; - m_next = NULL; - m_last = NULL; -} - -wxPropertyValue::wxPropertyValue(long the_integer) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueInteger; - m_value.integer = the_integer; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(bool val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValuebool; - m_value.integer = val; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(float the_real) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueReal; - m_value.real = the_real; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(double the_real) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueReal; - m_value.real = (float)the_real; - m_clientData = NULL; - m_next = NULL; -} - -// Pointer versions: we have a pointer to the real C++ value. -wxPropertyValue::wxPropertyValue(char **val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueStringPtr; - - m_value.stringPtr = val; - m_clientData = NULL; - m_next = NULL; - m_last = NULL; -} - -wxPropertyValue::wxPropertyValue(long *val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueIntegerPtr; - m_value.integerPtr = val; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(bool *val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueboolPtr; - m_value.boolPtr = val; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(float *val) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueRealPtr; - m_value.realPtr = val; - m_clientData = NULL; - m_next = NULL; -} - -wxPropertyValue::wxPropertyValue(wxList *the_list) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueList; - m_clientData = NULL; - m_last = NULL; - m_value.first = NULL; - - wxNode *node = the_list->First(); - while (node) - { - wxPropertyValue *expr = (wxPropertyValue *)node->Data(); - Append(expr); - node = node->Next(); - } - - delete the_list; -} - -wxPropertyValue::wxPropertyValue(wxStringList *the_list) -{ - m_modifiedFlag = FALSE; - m_type = wxPropertyValueList; - m_clientData = NULL; - m_last = NULL; - m_value.first = NULL; - - wxNode *node = the_list->First(); - while (node) - { - char *s = (char *)node->Data(); - Append(new wxPropertyValue(s)); - node = node->Next(); - } - delete the_list; -} - -wxPropertyValue::~wxPropertyValue(void) -{ - switch (m_type) - { - case wxPropertyValueInteger: - case wxPropertyValuebool: - case wxPropertyValueReal: - { - break; - } - case wxPropertyValueString: - { - delete[] m_value.string; - break; - } - case wxPropertyValueList: - { - wxPropertyValue *expr = m_value.first; - while (expr) - { - wxPropertyValue *expr1 = expr->m_next; - - delete expr; - expr = expr1; - } - break; - } - default: - case wxPropertyValueNull: break; - } -} - -void wxPropertyValue::Append(wxPropertyValue *expr) -{ - m_modifiedFlag = TRUE; - if (!m_value.first) - m_value.first = expr; - - if (m_last) - m_last->m_next = expr; - m_last = expr; -} - -void wxPropertyValue::Insert(wxPropertyValue *expr) -{ - m_modifiedFlag = TRUE; - expr->m_next = m_value.first; - m_value.first = expr; - - if (!m_last) - m_last = expr; -} - -// Delete from list -void wxPropertyValue::Delete(wxPropertyValue *node) -{ - wxPropertyValue *expr = GetFirst(); - - wxPropertyValue *previous = NULL; - while (expr && (expr != node)) - { - previous = expr; - expr = expr->GetNext(); - } - - if (expr) - { - if (previous) - previous->m_next = expr->m_next; - - // If node was the first in the list, - // make the list point to the NEXT one. - if (GetFirst() == expr) - { - m_value.first = expr->m_next; - } - - // If node was the last in the list, - // make the list 'last' pointer point to the PREVIOUS one. - if (GetLast() == expr) - { - if (previous) - m_last = previous; - else - m_last = NULL; - } - m_modifiedFlag = TRUE; - delete expr; - } - -} - -void wxPropertyValue::ClearList(void) -{ - wxPropertyValue *val = GetFirst(); - if (val) - m_modifiedFlag = TRUE; - - while (val) - { - wxPropertyValue *next = val->GetNext(); - delete val; - val = next; - } - m_value.first = NULL; - m_last = NULL; -} - -wxPropertyValue *wxPropertyValue::NewCopy(void) const -{ - switch (m_type) - { - case wxPropertyValueInteger: - return new wxPropertyValue(m_value.integer); - case wxPropertyValuebool: - return new wxPropertyValue((bool) (m_value.integer != 0)); - case wxPropertyValueReal: - return new wxPropertyValue(m_value.real); - case wxPropertyValueString: - return new wxPropertyValue(m_value.string); - case wxPropertyValueList: - { - wxPropertyValue *expr = m_value.first; - wxPropertyValue *new_list = new wxPropertyValue; - new_list->SetType(wxPropertyValueList); - while (expr) - { - wxPropertyValue *expr2 = expr->NewCopy(); - new_list->Append(expr2); - expr = expr->m_next; - } - return new_list; - } - case wxPropertyValueIntegerPtr: - return new wxPropertyValue(m_value.integerPtr); - case wxPropertyValueRealPtr: - return new wxPropertyValue(m_value.realPtr); - case wxPropertyValueboolPtr: - return new wxPropertyValue(m_value.boolPtr); - case wxPropertyValueStringPtr: - return new wxPropertyValue(m_value.stringPtr); - - case wxPropertyValueNull: -#ifdef __X__ - cerr << "Should never get here!\n"; -#endif - break; - } - return NULL; -} - -void wxPropertyValue::Copy(wxPropertyValue& copyFrom) -{ - m_type = copyFrom.Type(); - - switch (m_type) - { - case wxPropertyValueInteger: - (*this) = copyFrom.IntegerValue(); - return ; - - case wxPropertyValueReal: - (*this) = copyFrom.RealValue(); - return ; - - case wxPropertyValueString: - (*this) = wxString(copyFrom.StringValue()); - return ; - - case wxPropertyValuebool: - (*this) = copyFrom.BoolValue(); - return ; - - // Pointers - case wxPropertyValueboolPtr: - (*this) = copyFrom.BoolValuePtr(); - return ; - case wxPropertyValueRealPtr: - (*this) = copyFrom.RealValuePtr(); - return ; - case wxPropertyValueIntegerPtr: - (*this) = copyFrom.IntegerValuePtr(); - return ; - case wxPropertyValueStringPtr: - { - char** s = copyFrom.StringValuePtr(); - (*this) = s != 0; - return ; - } - - case wxPropertyValueList: - { - m_value.first = NULL; - m_next = NULL; - m_last = NULL; - wxPropertyValue *expr = copyFrom.m_value.first; - while (expr) - { - wxPropertyValue *expr2 = expr->NewCopy(); - Append(expr2); - expr = expr->m_next; - } - return; - } - case wxPropertyValueNull: -#ifdef __X__ - cerr << "Should never get here!\n"; -#endif - break; - } -} - -// Return nth argument of a clause (starting from 1) -wxPropertyValue *wxPropertyValue::Arg(wxPropertyValueType type, int arg) const -{ - wxPropertyValue *expr = m_value.first; - for (int i = 1; i < arg; i++) - if (expr) - expr = expr->m_next; - - if (expr && (expr->m_type == type)) - return expr; - else - return NULL; -} - -// Return nth argument of a list expression (starting from zero) -wxPropertyValue *wxPropertyValue::Nth(int arg) const -{ - if (m_type != wxPropertyValueList) - return NULL; - - wxPropertyValue *expr = m_value.first; - for (int i = 0; i < arg; i++) - if (expr) - expr = expr->m_next; - else return NULL; - - if (expr) - return expr; - else - return NULL; -} - - // Returns the number of elements in a list expression -int wxPropertyValue::Number(void) const -{ - if (m_type != wxPropertyValueList) - return 0; - - int i = 0; - wxPropertyValue *expr = m_value.first; - while (expr) - { - expr = expr->m_next; - i ++; - } - return i; -} - -void wxPropertyValue::WritePropertyClause(ostream& stream) // Write this expression as a top-level clause -{ - if (m_type != wxPropertyValueList) - return; - - wxPropertyValue *node = m_value.first; - if (node) - { - node->WritePropertyType(stream); - stream << "("; - node = node->m_next; - bool first = TRUE; - while (node) - { - if (!first) - stream << " "; - node->WritePropertyType(stream); - node = node->m_next; - if (node) stream << ",\n"; - first = FALSE; - } - stream << ").\n\n"; - } -} - -void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any other subexpression -{ - switch (m_type) - { - case wxPropertyValueInteger: - { - stream << m_value.integer; - break; - } - case wxPropertyValueIntegerPtr: - { - stream << *m_value.integerPtr; - break; - } - case wxPropertyValuebool: - { - if (m_value.integer) - stream << "True"; - else - stream << "False"; - break; - } - case wxPropertyValueboolPtr: - { - if (*m_value.integerPtr) - stream << "True"; - else - stream << "False"; - break; - } - case wxPropertyValueReal: - { - float f = m_value.real; - sprintf(wxBuffer, "%.6g", (double)f); - stream << wxBuffer; - break; - } - case wxPropertyValueRealPtr: - { - float f = *m_value.realPtr; -/* Now the parser can cope with this. - // Prevent printing in 'e' notation. Any better way? - if (fabs(f) < 0.00001) - f = 0.0; -*/ - sprintf(wxBuffer, "%.6g", f); - stream << wxBuffer; - break; - } - case wxPropertyValueString: - { -// stream << "\""; - int i; - int len = strlen(m_value.string); - for (i = 0; i < len; i++) - { - char ch = m_value.string[i]; -// if (ch == '"' || ch == '\\') -// stream << "\\"; - stream << ch; - } - -// stream << "\""; - break; - } - case wxPropertyValueStringPtr: - { - int i; - int len = strlen(*(m_value.stringPtr)); - for (i = 0; i < len; i++) - { - char ch = *(m_value.stringPtr)[i]; - - } - break; - } - case wxPropertyValueList: - { - if (!m_value.first) - stream << "[]"; - else - { - wxPropertyValue *expr = m_value.first; - - stream << "["; - while (expr) - { - expr->WritePropertyType(stream); - expr = expr->m_next; - if (expr) stream << ", "; - } - stream << "]"; - } - break; - } - case wxPropertyValueNull: break; - } -} - -wxString wxPropertyValue::GetStringRepresentation(void) -{ - char buf[500]; - buf[0] = 0; - - ostrstream str((char *)buf, (int)500, ios::out); - WritePropertyType(str); - str << '\0'; - str.flush(); - - wxString theString(buf); - return theString; -} - -void wxPropertyValue::operator=(const wxPropertyValue& val) -{ - m_modifiedFlag = TRUE; - Copy((wxPropertyValue&)val); -} - -// void wxPropertyValue::operator=(const char *val) -void wxPropertyValue::operator=(const wxString& val1) -{ - const char *val = (const char *)val1; - - m_modifiedFlag = TRUE; - if (m_type == wxPropertyValueNull) - m_type = wxPropertyValueString; - - if (m_type == wxPropertyValueString) - { - if (val) - m_value.string = copystring(val); - else - m_value.string = NULL; - } - else if (m_type == wxPropertyValueStringPtr) - { - if (*m_value.stringPtr) - delete[] *m_value.stringPtr; - if (val) - *m_value.stringPtr = copystring(val); - else - *m_value.stringPtr = NULL; - } - - m_clientData = NULL; - m_next = NULL; - m_last = NULL; - -} - -void wxPropertyValue::operator=(const long val) -{ - m_modifiedFlag = TRUE; - if (m_type == wxPropertyValueNull) - m_type = wxPropertyValueInteger; - - if (m_type == wxPropertyValueInteger) - m_value.integer = val; - else if (m_type == wxPropertyValueIntegerPtr) - *m_value.integerPtr = val; - else if (m_type == wxPropertyValueReal) - m_value.real = (float)val; - else if (m_type == wxPropertyValueRealPtr) - *m_value.realPtr = (float)val; - - m_clientData = NULL; - m_next = NULL; -} - -void wxPropertyValue::operator=(const bool val) -{ - m_modifiedFlag = TRUE; - if (m_type == wxPropertyValueNull) - m_type = wxPropertyValuebool; - - if (m_type == wxPropertyValuebool) - m_value.integer = (long)val; - else if (m_type == wxPropertyValueboolPtr) - *m_value.boolPtr = val; - - m_clientData = NULL; - m_next = NULL; -} - -void wxPropertyValue::operator=(const float val) -{ - m_modifiedFlag = TRUE; - if (m_type == wxPropertyValueNull) - m_type = wxPropertyValueReal; - - if (m_type == wxPropertyValueInteger) - m_value.integer = (long)val; - else if (m_type == wxPropertyValueIntegerPtr) - *m_value.integerPtr = (long)val; - else if (m_type == wxPropertyValueReal) - m_value.real = val; - else if (m_type == wxPropertyValueRealPtr) - *m_value.realPtr = val; - - m_clientData = NULL; - m_next = NULL; -} - -void wxPropertyValue::operator=(const char **val) -{ - m_modifiedFlag = TRUE; - m_type = wxPropertyValueStringPtr; - - if (val) - m_value.stringPtr = (char **)val; - else - m_value.stringPtr = NULL; - m_clientData = NULL; - m_next = NULL; - m_last = NULL; - -} - -void wxPropertyValue::operator=(const long *val) -{ - m_modifiedFlag = TRUE; - m_type = wxPropertyValueIntegerPtr; - m_value.integerPtr = (long *)val; - m_clientData = NULL; - m_next = NULL; -} - -void wxPropertyValue::operator=(const bool *val) -{ - m_modifiedFlag = TRUE; - m_type = wxPropertyValueboolPtr; - m_value.boolPtr = (bool *)val; - m_clientData = NULL; - m_next = NULL; -} - -void wxPropertyValue::operator=(const float *val) -{ - m_modifiedFlag = TRUE; - m_type = wxPropertyValueRealPtr; - m_value.realPtr = (float *)val; - m_clientData = NULL; - m_next = NULL; -} - -long wxPropertyValue::IntegerValue(void) const - { - if (m_type == wxPropertyValueInteger) - return m_value.integer; - else if (m_type == wxPropertyValueReal) - return (long)m_value.real; - else if (m_type == wxPropertyValueIntegerPtr) - return *m_value.integerPtr; - else if (m_type == wxPropertyValueRealPtr) - return (long)(*m_value.realPtr); - else return 0; - } - -long *wxPropertyValue::IntegerValuePtr(void) const -{ - return m_value.integerPtr; -} - -float wxPropertyValue::RealValue(void) const { - if (m_type == wxPropertyValueReal) - return m_value.real; - else if (m_type == wxPropertyValueRealPtr) - return *m_value.realPtr; - else if (m_type == wxPropertyValueInteger) - return (float)m_value.integer; - else if (m_type == wxPropertyValueIntegerPtr) - return (float)*(m_value.integerPtr); - else return 0.0; - } - -float *wxPropertyValue::RealValuePtr(void) const -{ - return m_value.realPtr; -} - -bool wxPropertyValue::BoolValue(void) const { - if (m_type == wxPropertyValueReal) - return (m_value.real != 0.0); - if (m_type == wxPropertyValueRealPtr) - return (*(m_value.realPtr) != 0.0); - else if (m_type == wxPropertyValueInteger) - return (m_value.integer != 0); - else if (m_type == wxPropertyValueIntegerPtr) - return (*(m_value.integerPtr) != 0); - else if (m_type == wxPropertyValuebool) - return (m_value.integer != 0); - else if (m_type == wxPropertyValueboolPtr) - return (*(m_value.boolPtr) != 0); - else return FALSE; - } - -bool *wxPropertyValue::BoolValuePtr(void) const -{ - return m_value.boolPtr; -} - -char *wxPropertyValue::StringValue(void) const { - if (m_type == wxPropertyValueString) - return m_value.string; - else if (m_type == wxPropertyValueStringPtr) - return *(m_value.stringPtr); - else return NULL; - } - -char **wxPropertyValue::StringValuePtr(void) const -{ - return m_value.stringPtr; -} - -/* - * A property (name plus value) - */ - -IMPLEMENT_DYNAMIC_CLASS(wxProperty, wxObject) - -wxProperty::wxProperty(void) -{ - m_propertyRole = (char *)NULL; - m_propertyValidator = NULL; - m_propertyWindow = NULL; - m_enabled = TRUE; -} - -wxProperty::wxProperty(wxProperty& copyFrom) -{ - m_value = copyFrom.GetValue(); - m_name = copyFrom.GetName(); - m_propertyRole = copyFrom.GetRole(); - m_propertyValidator = copyFrom.GetValidator(); - m_enabled = copyFrom.IsEnabled(); - m_propertyWindow = NULL; -} - -wxProperty::wxProperty(wxString nm, wxString role, wxPropertyValidator *ed):m_name(nm), m_propertyRole(role) -{ - m_propertyValidator = ed; - m_propertyWindow = NULL; - m_enabled = TRUE; -} - -wxProperty::wxProperty(wxString nm, const wxPropertyValue& val, wxString role, wxPropertyValidator *ed): - m_name(nm), m_value(val), m_propertyRole(role) -{ - m_propertyValidator = ed; - m_propertyWindow = NULL; - m_enabled = TRUE; -} - -wxProperty::~wxProperty(void) -{ - if (m_propertyValidator) - delete m_propertyValidator; -} - -wxPropertyValue& wxProperty::GetValue(void) const -{ - return (wxPropertyValue&) m_value; -} - -wxPropertyValidator *wxProperty::GetValidator(void) const -{ - return m_propertyValidator; -} - -wxString& wxProperty::GetName(void) const -{ - return (wxString&) m_name; -} - -wxString& wxProperty::GetRole(void) const -{ - return (wxString&) m_propertyRole; -} - -void wxProperty::SetValue(const wxPropertyValue& val) -{ - m_value = val; -} - -void wxProperty::SetValidator(wxPropertyValidator *ed) -{ - m_propertyValidator = ed; -} - -void wxProperty::SetRole(wxString& role) -{ - m_propertyRole = role; -} - -void wxProperty::SetName(wxString& nm) -{ - m_name = nm; -} - -void wxProperty::operator=(const wxPropertyValue& val) -{ - m_value = val; -} - -/* - * Base property view class - */ - -IMPLEMENT_DYNAMIC_CLASS(wxPropertyView, wxEvtHandler) - -wxPropertyView::wxPropertyView(long flags) -{ - m_buttonFlags = flags; - m_propertySheet = NULL; - m_currentValidator = NULL; - m_currentProperty = NULL; -} - -wxPropertyView::~wxPropertyView(void) -{ -} - -void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry *registry) -{ - m_validatorRegistryList.Append(registry); -} - -wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property) -{ - if (property->GetValidator()) - return property->GetValidator(); - - wxNode *node = m_validatorRegistryList.First(); - while (node) - { - wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->Data(); - wxPropertyValidator *validator = registry->GetValidator(property->GetRole()); - if (validator) - return validator; - node = node->Next(); - } - return NULL; -/* - if (!wxDefaultPropertyValidator) - wxDefaultPropertyValidator = new wxPropertyListValidator; - return wxDefaultPropertyValidator; -*/ -} - -/* - * Property sheet - */ - -IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet, wxObject) - -wxPropertySheet::wxPropertySheet(void):m_properties(wxKEY_STRING) -{ -} - -wxPropertySheet::~wxPropertySheet(void) -{ - Clear(); -} - -bool wxPropertySheet::Save( ostream& WXUNUSED(str) ) -{ - return FALSE; -} - -bool wxPropertySheet::Load( ostream& WXUNUSED(str) ) -{ - return FALSE; -} - -void wxPropertySheet::UpdateAllViews( wxPropertyView *WXUNUSED(thisView) ) -{ -} - -// Add a property -void wxPropertySheet::AddProperty(wxProperty *property) -{ - m_properties.Append((const char*) property->GetName(), property); -} - -// Get property by name -wxProperty *wxPropertySheet::GetProperty(wxString name) -{ - wxNode *node = m_properties.Find((const char*) name); - if (!node) - return NULL; - else - return (wxProperty *)node->Data(); -} - -// Clear all properties -void wxPropertySheet::Clear(void) -{ - wxNode *node = m_properties.First(); - while (node) - { - wxProperty *prop = (wxProperty *)node->Data(); - wxNode *next = node->Next(); - delete prop; - delete node; - node = next; - } -} - -// Sets/clears the modified flag for each property value -void wxPropertySheet::SetAllModified(bool flag) -{ - wxNode *node = m_properties.First(); - while (node) - { - wxProperty *prop = (wxProperty *)node->Data(); - prop->GetValue().SetModified(flag); - node = node->Next(); - } -} - -/* - * Property validator registry - * - */ - -IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry, wxHashTable) - -wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING) -{ -} - -wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void) -{ - ClearRegistry(); -} - -void wxPropertyValidatorRegistry::RegisterValidator(const wxString& typeName, wxPropertyValidator *validator) -{ - Put((const char*) typeName, validator); -} - -wxPropertyValidator *wxPropertyValidatorRegistry::GetValidator(const wxString& typeName) -{ - return (wxPropertyValidator *)Get((const char*) typeName); -} - -void wxPropertyValidatorRegistry::ClearRegistry(void) -{ - BeginFind(); - wxNode *node; - while (node = Next()) - { - delete (wxPropertyValidator *)node->Data(); - } -} - - /* - * Property validator - */ - - -IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator, wxEvtHandler) - -wxPropertyValidator::wxPropertyValidator(long flags) -{ - m_validatorFlags = flags; - m_validatorProperty = NULL; -} - -wxPropertyValidator::~wxPropertyValidator(void) -{} - -bool wxPropertyValidator::StringToFloat (char *s, float *number) { - double num; - bool ok = StringToDouble (s, &num); - *number = (float) num; - return ok; -} - -bool wxPropertyValidator::StringToDouble (char *s, double *number) { - bool ok = TRUE; - char *value_ptr; - *number = strtod (s, &value_ptr); - if (value_ptr) { - int len = strlen (value_ptr); - for (int i = 0; i < len; i++) { - ok = (isspace (value_ptr[i]) != 0); - if (!ok) return FALSE; - } - } - return ok; -} - -bool wxPropertyValidator::StringToInt (char *s, int *number) { - long num; - bool ok = StringToLong (s, &num); - *number = (int) num; - return ok; -} - -bool wxPropertyValidator::StringToLong (char *s, long *number) { - bool ok = TRUE; - char *value_ptr; - *number = strtol (s, &value_ptr, 10); - if (value_ptr) { - int len = strlen (value_ptr); - for (int i = 0; i < len; i++) { - ok = (isspace (value_ptr[i]) != 0); - if (!ok) return FALSE; - } - } - return ok; -} - -char *wxPropertyValidator::FloatToString (float number) { - static char buf[20]; - sprintf (buf, "%.6g", number); - return buf; -} - -char *wxPropertyValidator::DoubleToString (double number) { - static char buf[20]; - sprintf (buf, "%.6g", number); - return buf; -} - -char *wxPropertyValidator::IntToString (int number) { - return ::IntToString (number); -} - -char *wxPropertyValidator::LongToString (long number) { - return ::LongToString (number); - } - - diff --git a/wxPython/b.bat b/wxPython/b.bat index 7d8e917fea..a57cd4fb74 100755 --- a/wxPython/b.bat +++ b/wxPython/b.bat @@ -33,7 +33,6 @@ rem just remove the *.pyd's elseiff "%1" == "d" then shift set CMD=del wx\*.pyd - set OTHERCMD=del wx\*.pdb rem touch all the *.i files so swig will regenerate elseiff "%1" == "t" then diff --git a/wxPython/config.py b/wxPython/config.py index 6ff33be005..38a4abf14d 100644 --- a/wxPython/config.py +++ b/wxPython/config.py @@ -38,8 +38,8 @@ import distutils.command.clean VER_MAJOR = 2 # The first three must match wxWidgets VER_MINOR = 5 VER_RELEASE = 1 -VER_SUBREL = 2 # wxPython release num for x.y.z release of wxWidgets -VER_FLAGS = "p" # release flags, such as prerelease num, unicode, etc. +VER_SUBREL = 4 # wxPython release num for x.y.z release of wxWidgets +VER_FLAGS = "" # release flags, such as prerelease num, unicode, etc. DESCRIPTION = "Cross platform GUI toolkit for Python" AUTHOR = "Robin Dunn" diff --git a/wxPython/contrib/activex/activex_wrap.cpp b/wxPython/contrib/activex/activex_wrap.cpp index 7076c339a1..50fd6b3ee3 100644 --- a/wxPython/contrib/activex/activex_wrap.cpp +++ b/wxPython/contrib/activex/activex_wrap.cpp @@ -398,7 +398,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 34bcf29c82..89463e7978 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -748,10 +748,10 @@ public: // order to continue the search. PyObject* GetFirstChild(const wxTreeItemId& item) { long cookie = 0; - wxTreeItemId ritem = self->GetFirstChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; @@ -763,10 +763,10 @@ public: // Returns a wxTreeItemId and an opaque "cookie" value that should be // passed to GetNextChild in order to continue the search. PyObject* GetNextChild(const wxTreeItemId& item, long cookie) { - wxTreeItemId ritem = self->GetNextChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; diff --git a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp index f259f142e3..7d2870f862 100644 --- a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp @@ -343,7 +343,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -451,9 +459,9 @@ SWIG_AsUnsignedLong(PyObject * obj) if (PyLong_Check(obj)) { return PyLong_AsUnsignedLong(obj); } else { - long i = PyInt_AsLong(obj); + long i = SWIG_AsLong(obj); if ( !PyErr_Occurred() && (i < 0)) { - PyErr_SetString(PyExc_TypeError, "negative value for unsigned type"); + PyErr_SetString(PyExc_TypeError, "negative value received for unsigned type"); } return i; } @@ -630,19 +638,19 @@ PyObject *wxPyTreeListCtrl_GetSelections(wxPyTreeListCtrl *self){ } PyObject *wxPyTreeListCtrl_GetFirstChild(wxPyTreeListCtrl *self,wxTreeItemId const &item){ long cookie = 0; - wxTreeItemId ritem = self->GetFirstChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; } PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId const &item,long cookie){ - wxTreeItemId ritem = self->GetNextChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; @@ -6624,6 +6632,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -6684,12 +6695,12 @@ static void *_p_wxPreviewCanvasTo_p_wxWindow(void *x) { static void *_p_wxStaticLineTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxStaticLine *) x)); } -static void *_p_wxPyControlTo_p_wxWindow(void *x) { - return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); -} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } +static void *_p_wxPyControlTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); +} static void *_p_wxGaugeTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxGauge *) x)); } @@ -6813,6 +6824,9 @@ static void *_p_wxStatusBarTo_p_wxWindow(void *x) { static void *_p_wxMDIParentFrameTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } @@ -6900,6 +6914,9 @@ static void *_p_wxToolBarTo_p_wxWindow(void *x) { static void *_p_wxThinSplitterWindowTo_p_wxSplitterWindow(void *x) { return (void *)((wxSplitterWindow *) ((wxThinSplitterWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -7575,6 +7592,9 @@ static void *_p_wxXPMHandlerTo_p_wxObject(void *x) { static void *_p_wxShowEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *) ((wxShowEvent *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } @@ -7899,6 +7919,9 @@ static void *_p_wxStatusBarTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIParentFrameTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *)(wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } @@ -8065,7 +8088,7 @@ static void *_p_wxUpdateUIEventTo_p_wxCommandEvent(void *x) { return (void *)((wxCommandEvent *) ((wxUpdateUIEvent *) x)); } static swig_type_info _swigt__p_wxEditableListBox[] = {{"_p_wxEditableListBox", 0, "wxEditableListBox *", 0, 0, 0, 0},{"_p_wxEditableListBox", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0, 0, 0, 0},{"_p_wxColour", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCtrl[] = {{"_p_wxPyTreeCtrl", 0, "wxPyTreeCtrl *", 0, 0, 0, 0},{"_p_wxPyTreeCtrl", 0, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxPyTreeCtrl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxRemotelyScrolledTreeCtrl[] = {{"_p_wxRemotelyScrolledTreeCtrl", 0, "wxRemotelyScrolledTreeCtrl *", 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8074,9 +8097,9 @@ static swig_type_info _swigt__p_wxPyTreeListCtrl[] = {{"_p_wxPyTreeListCtrl", 0, static swig_type_info _swigt__p_wxImageList[] = {{"_p_wxImageList", 0, "wxImageList *", 0, 0, 0, 0},{"_p_wxImageList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxScrollBar[] = {{"_p_wxScrollBar", 0, "wxScrollBar *", 0, 0, 0, 0},{"_p_wxScrollBar", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashWindow[] = {{"_p_wxDynamicSashWindow", 0, "wxDynamicSashWindow *", 0, 0, 0, 0},{"_p_wxDynamicSashWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterWindow[] = {{"_p_wxSplitterWindow", 0, "wxSplitterWindow *", 0, 0, 0, 0},{"_p_wxSplitterWindow", 0, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxSplitterWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCompanionWindow[] = {{"_p_wxPyTreeCompanionWindow", 0, "wxPyTreeCompanionWindow *", 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxThinSplitterWindow[] = {{"_p_wxThinSplitterWindow", 0, "wxThinSplitterWindow *", 0, 0, 0, 0},{"_p_wxThinSplitterWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterScrolledWindow[] = {{"_p_wxSplitterScrolledWindow", 0, "wxSplitterScrolledWindow *", 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8087,11 +8110,11 @@ static swig_type_info _swigt__p_wxLEDNumberCtrl[] = {{"_p_wxLEDNumberCtrl", 0, " static swig_type_info _swigt__p_wxDynamicSashSplitEvent[] = {{"_p_wxDynamicSashSplitEvent", 0, "wxDynamicSashSplitEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxTreeItemId[] = {{"_p_wxTreeItemId", 0, "wxTreeItemId *", 0, 0, 0, 0},{"_p_wxTreeItemId", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashUnifyEvent[] = {{"_p_wxDynamicSashUnifyEvent", 0, "wxDynamicSashUnifyEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControl", 0, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeItemData[] = {{"_p_wxPyTreeItemData", 0, "wxPyTreeItemData *", 0, 0, 0, 0},{"_p_wxPyTreeItemData", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEvent", 0, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0, 0, 0, 0},{"_p_int", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp b/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp index 12440d2726..edf223da32 100644 --- a/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp @@ -343,7 +343,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -451,9 +459,9 @@ SWIG_AsUnsignedLong(PyObject * obj) if (PyLong_Check(obj)) { return PyLong_AsUnsignedLong(obj); } else { - long i = PyInt_AsLong(obj); + long i = SWIG_AsLong(obj); if ( !PyErr_Occurred() && (i < 0)) { - PyErr_SetString(PyExc_TypeError, "negative value for unsigned type"); + PyErr_SetString(PyExc_TypeError, "negative value received for unsigned type"); } return i; } @@ -630,19 +638,19 @@ PyObject *wxPyTreeListCtrl_GetSelections(wxPyTreeListCtrl *self){ } PyObject *wxPyTreeListCtrl_GetFirstChild(wxPyTreeListCtrl *self,wxTreeItemId const &item){ long cookie = 0; - wxTreeItemId ritem = self->GetFirstChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; } PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId const &item,long cookie){ - wxTreeItemId ritem = self->GetNextChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; @@ -6624,6 +6632,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -6684,12 +6695,12 @@ static void *_p_wxPreviewCanvasTo_p_wxWindow(void *x) { static void *_p_wxStaticLineTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxStaticLine *) x)); } -static void *_p_wxPyControlTo_p_wxWindow(void *x) { - return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); -} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } +static void *_p_wxPyControlTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); +} static void *_p_wxGaugeTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxGauge *) x)); } @@ -6813,6 +6824,9 @@ static void *_p_wxStatusBarTo_p_wxWindow(void *x) { static void *_p_wxMDIParentFrameTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } @@ -6900,6 +6914,9 @@ static void *_p_wxToolBarTo_p_wxWindow(void *x) { static void *_p_wxThinSplitterWindowTo_p_wxSplitterWindow(void *x) { return (void *)((wxSplitterWindow *) ((wxThinSplitterWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -7575,6 +7592,9 @@ static void *_p_wxXPMHandlerTo_p_wxObject(void *x) { static void *_p_wxShowEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *) ((wxShowEvent *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } @@ -7899,6 +7919,9 @@ static void *_p_wxStatusBarTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIParentFrameTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *)(wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } @@ -8065,7 +8088,7 @@ static void *_p_wxUpdateUIEventTo_p_wxCommandEvent(void *x) { return (void *)((wxCommandEvent *) ((wxUpdateUIEvent *) x)); } static swig_type_info _swigt__p_wxEditableListBox[] = {{"_p_wxEditableListBox", 0, "wxEditableListBox *", 0, 0, 0, 0},{"_p_wxEditableListBox", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0, 0, 0, 0},{"_p_wxColour", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCtrl[] = {{"_p_wxPyTreeCtrl", 0, "wxPyTreeCtrl *", 0, 0, 0, 0},{"_p_wxPyTreeCtrl", 0, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxPyTreeCtrl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxRemotelyScrolledTreeCtrl[] = {{"_p_wxRemotelyScrolledTreeCtrl", 0, "wxRemotelyScrolledTreeCtrl *", 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8074,9 +8097,9 @@ static swig_type_info _swigt__p_wxPyTreeListCtrl[] = {{"_p_wxPyTreeListCtrl", 0, static swig_type_info _swigt__p_wxImageList[] = {{"_p_wxImageList", 0, "wxImageList *", 0, 0, 0, 0},{"_p_wxImageList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxScrollBar[] = {{"_p_wxScrollBar", 0, "wxScrollBar *", 0, 0, 0, 0},{"_p_wxScrollBar", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashWindow[] = {{"_p_wxDynamicSashWindow", 0, "wxDynamicSashWindow *", 0, 0, 0, 0},{"_p_wxDynamicSashWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterWindow[] = {{"_p_wxSplitterWindow", 0, "wxSplitterWindow *", 0, 0, 0, 0},{"_p_wxSplitterWindow", 0, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxSplitterWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCompanionWindow[] = {{"_p_wxPyTreeCompanionWindow", 0, "wxPyTreeCompanionWindow *", 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxThinSplitterWindow[] = {{"_p_wxThinSplitterWindow", 0, "wxThinSplitterWindow *", 0, 0, 0, 0},{"_p_wxThinSplitterWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterScrolledWindow[] = {{"_p_wxSplitterScrolledWindow", 0, "wxSplitterScrolledWindow *", 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8087,11 +8110,11 @@ static swig_type_info _swigt__p_wxLEDNumberCtrl[] = {{"_p_wxLEDNumberCtrl", 0, " static swig_type_info _swigt__p_wxDynamicSashSplitEvent[] = {{"_p_wxDynamicSashSplitEvent", 0, "wxDynamicSashSplitEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxTreeItemId[] = {{"_p_wxTreeItemId", 0, "wxTreeItemId *", 0, 0, 0, 0},{"_p_wxTreeItemId", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashUnifyEvent[] = {{"_p_wxDynamicSashUnifyEvent", 0, "wxDynamicSashUnifyEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControl", 0, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeItemData[] = {{"_p_wxPyTreeItemData", 0, "wxPyTreeItemData *", 0, 0, 0, 0},{"_p_wxPyTreeItemData", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEvent", 0, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0, 0, 0, 0},{"_p_int", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp b/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp index 9184b1fb82..ad61943e04 100644 --- a/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp @@ -343,7 +343,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -451,9 +459,9 @@ SWIG_AsUnsignedLong(PyObject * obj) if (PyLong_Check(obj)) { return PyLong_AsUnsignedLong(obj); } else { - long i = PyInt_AsLong(obj); + long i = SWIG_AsLong(obj); if ( !PyErr_Occurred() && (i < 0)) { - PyErr_SetString(PyExc_TypeError, "negative value for unsigned type"); + PyErr_SetString(PyExc_TypeError, "negative value received for unsigned type"); } return i; } @@ -630,19 +638,19 @@ PyObject *wxPyTreeListCtrl_GetSelections(wxPyTreeListCtrl *self){ } PyObject *wxPyTreeListCtrl_GetFirstChild(wxPyTreeListCtrl *self,wxTreeItemId const &item){ long cookie = 0; - wxTreeItemId ritem = self->GetFirstChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; } PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId const &item,long cookie){ - wxTreeItemId ritem = self->GetNextChild(item, cookie); + wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie)); wxPyEndBlockThreads(blocked); return tup; @@ -6624,6 +6632,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -6684,12 +6695,12 @@ static void *_p_wxPreviewCanvasTo_p_wxWindow(void *x) { static void *_p_wxStaticLineTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxStaticLine *) x)); } -static void *_p_wxPyControlTo_p_wxWindow(void *x) { - return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); -} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } +static void *_p_wxPyControlTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxControl *) ((wxPyControl *) x)); +} static void *_p_wxGaugeTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxControl *) ((wxGauge *) x)); } @@ -6813,6 +6824,9 @@ static void *_p_wxStatusBarTo_p_wxWindow(void *x) { static void *_p_wxMDIParentFrameTo_p_wxWindow(void *x) { return (void *)((wxWindow *) (wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } @@ -6900,6 +6914,9 @@ static void *_p_wxToolBarTo_p_wxWindow(void *x) { static void *_p_wxThinSplitterWindowTo_p_wxSplitterWindow(void *x) { return (void *)((wxSplitterWindow *) ((wxThinSplitterWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSplitterScrolledWindowTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxSplitterScrolledWindow *) x)); } @@ -7575,6 +7592,9 @@ static void *_p_wxXPMHandlerTo_p_wxObject(void *x) { static void *_p_wxShowEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *) ((wxShowEvent *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } @@ -7899,6 +7919,9 @@ static void *_p_wxStatusBarTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIParentFrameTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *)(wxTopLevelWindow *)(wxFrame *) ((wxMDIParentFrame *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } @@ -8065,7 +8088,7 @@ static void *_p_wxUpdateUIEventTo_p_wxCommandEvent(void *x) { return (void *)((wxCommandEvent *) ((wxUpdateUIEvent *) x)); } static swig_type_info _swigt__p_wxEditableListBox[] = {{"_p_wxEditableListBox", 0, "wxEditableListBox *", 0, 0, 0, 0},{"_p_wxEditableListBox", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDragImage", _p_wxGenericDragImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListItem", _p_wxListItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookSizer", _p_wxNotebookSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTreeListColumnInfo", _p_wxTreeListColumnInfoTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelp", _p_wxContextHelpTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBookCtrlSizer", _p_wxBookCtrlSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBarToolBase", _p_wxToolBarToolBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0, 0, 0, 0},{"_p_wxColour", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCtrl[] = {{"_p_wxPyTreeCtrl", 0, "wxPyTreeCtrl *", 0, 0, 0, 0},{"_p_wxPyTreeCtrl", 0, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxPyTreeCtrl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxRemotelyScrolledTreeCtrl[] = {{"_p_wxRemotelyScrolledTreeCtrl", 0, "wxRemotelyScrolledTreeCtrl *", 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8074,9 +8097,9 @@ static swig_type_info _swigt__p_wxPyTreeListCtrl[] = {{"_p_wxPyTreeListCtrl", 0, static swig_type_info _swigt__p_wxImageList[] = {{"_p_wxImageList", 0, "wxImageList *", 0, 0, 0, 0},{"_p_wxImageList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxScrollBar[] = {{"_p_wxScrollBar", 0, "wxScrollBar *", 0, 0, 0, 0},{"_p_wxScrollBar", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashWindow[] = {{"_p_wxDynamicSashWindow", 0, "wxDynamicSashWindow *", 0, 0, 0, 0},{"_p_wxDynamicSashWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterWindow[] = {{"_p_wxSplitterWindow", 0, "wxSplitterWindow *", 0, 0, 0, 0},{"_p_wxSplitterWindow", 0, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxSplitterWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeCompanionWindow[] = {{"_p_wxPyTreeCompanionWindow", 0, "wxPyTreeCompanionWindow *", 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxThinSplitterWindow[] = {{"_p_wxThinSplitterWindow", 0, "wxThinSplitterWindow *", 0, 0, 0, 0},{"_p_wxThinSplitterWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxSplitterScrolledWindow[] = {{"_p_wxSplitterScrolledWindow", 0, "wxSplitterScrolledWindow *", 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -8087,11 +8110,11 @@ static swig_type_info _swigt__p_wxLEDNumberCtrl[] = {{"_p_wxLEDNumberCtrl", 0, " static swig_type_info _swigt__p_wxDynamicSashSplitEvent[] = {{"_p_wxDynamicSashSplitEvent", 0, "wxDynamicSashSplitEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxTreeItemId[] = {{"_p_wxTreeItemId", 0, "wxTreeItemId *", 0, 0, 0, 0},{"_p_wxTreeItemId", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxThinSplitterWindow", _p_wxThinSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDynamicSashWindow", _p_wxDynamicSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTreeCompanionWindow", _p_wxPyTreeCompanionWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxDynamicSashUnifyEvent[] = {{"_p_wxDynamicSashUnifyEvent", 0, "wxDynamicSashUnifyEvent *", 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0, 0, 0, 0},{"_p_wxBookCtrl", _p_wxBookCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBar", _p_wxToolBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToggleButton", _p_wxToggleButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioButton", _p_wxRadioButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxLEDNumberCtrl", _p_wxLEDNumberCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControl", 0, 0, 0, 0, 0, 0},{"_p_wxPyControl", _p_wxPyControlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxToolBarBase", _p_wxToolBarBaseTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxDirFilterListCtrl", _p_wxDirFilterListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyListCtrl", _p_wxPyListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeListCtrl", _p_wxPyTreeListCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxComboBox", _p_wxComboBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGenericDirCtrl", _p_wxGenericDirCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxScrollBar", _p_wxScrollBarTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxGauge", _p_wxGaugeTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticLine", _p_wxStaticLineTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListbook", _p_wxListbookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRemotelyScrolledTreeCtrl", _p_wxRemotelyScrolledTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxPyTreeCtrl", _p_wxPyTreeCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckBox", _p_wxCheckBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxRadioBox", _p_wxRadioBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxChoice", _p_wxChoiceTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListBox", _p_wxListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxCheckListBox", _p_wxCheckListBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxListView", _p_wxListViewTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxNotebook", _p_wxNotebookTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBitmap", _p_wxStaticBitmapTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinCtrl", _p_wxSpinCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticText", _p_wxStaticTextTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxStaticBox", _p_wxStaticBoxTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSlider", _p_wxSliderTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxContextHelpButton", _p_wxContextHelpButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxSpinButton", _p_wxSpinButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxButton", _p_wxButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxBitmapButton", _p_wxBitmapButtonTo_p_wxControl, 0, 0, 0, 0, 0},{"_p_wxTextCtrl", _p_wxTextCtrlTo_p_wxControl, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxSplitterScrolledWindow", _p_wxSplitterScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxEditableListBox", _p_wxEditableListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyTreeItemData[] = {{"_p_wxPyTreeItemData", 0, "wxPyTreeItemData *", 0, 0, 0, 0},{"_p_wxPyTreeItemData", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTreeEvent", _p_wxTreeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTextUrlEvent", _p_wxTextUrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxBookCtrlEvent", _p_wxBookCtrlEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashUnifyEvent", _p_wxDynamicSashUnifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListEvent", _p_wxListEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDynamicSashSplitEvent", _p_wxDynamicSashSplitEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxHelpEvent", _p_wxHelpEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotebookEvent", _p_wxNotebookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxListbookEvent", _p_wxListbookEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEvent", 0, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSpinEvent", _p_wxSpinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0, 0, 0, 0},{"_p_int", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp index 610f31d8b4..fe69fdfd60 100644 --- a/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp @@ -328,7 +328,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp index 1a4e714f6c..d84670aaed 100644 --- a/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp @@ -332,7 +332,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp index 6a5674405f..c779ee14fc 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp @@ -328,7 +328,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/iewin/iewin_wrap.cpp b/wxPython/contrib/iewin/iewin_wrap.cpp index 6523504c2e..2f7735599e 100644 --- a/wxPython/contrib/iewin/iewin_wrap.cpp +++ b/wxPython/contrib/iewin/iewin_wrap.cpp @@ -310,7 +310,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/ogl/gtk/ogl_wrap.cpp b/wxPython/contrib/ogl/gtk/ogl_wrap.cpp index fb7bbec1e6..b137351d19 100644 --- a/wxPython/contrib/ogl/gtk/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/gtk/ogl_wrap.cpp @@ -312,17 +312,15 @@ static swig_type_info *swig_types[42]; SWIGSTATICINLINE(double) SWIG_AsDouble(PyObject *obj) { - double val = (PyFloat_Check(obj)) ? PyFloat_AsDouble(obj) : -#if HAVE_LONG_LONG - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLongLong(obj)); -#else - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLong(obj)); -#endif - if (PyErr_Occurred()) { - PyErr_Clear(); - PyErr_SetString(PyExc_TypeError, "a double is expected"); - } - return val; + if (PyNumber_Check(obj)) + return PyFloat_AsDouble(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -369,7 +367,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -33366,6 +33372,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPyVListBoxTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxPyVScrolledWindow *) ((wxPyVListBox *) x)); } @@ -33387,6 +33396,9 @@ static void *_p_wxPyPreviewControlBarTo_p_wxPanel(void *x) { static void *_p_wxPyShapeCanvasTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyShapeCanvas *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPreviewCanvasTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxPreviewCanvas *) x)); } @@ -33465,6 +33477,9 @@ static void *_p_wxSplitterWindowTo_p_wxWindow(void *x) { static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } @@ -33870,6 +33885,9 @@ static void *_p_wxPyVScrolledWindowTo_p_wxObject(void *x) { static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxSashEvent *) x)); } @@ -34104,6 +34122,9 @@ static void *_p_wxTopLevelWindowTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxControl *) x)); } @@ -34243,21 +34264,21 @@ static swig_type_info _swigt__p_wxPyControlPoint[] = {{"_p_wxPyControlPoint", 0, static swig_type_info _swigt__p_wxArrowHead[] = {{"_p_wxArrowHead", 0, "wxArrowHead *", 0, 0, 0, 0},{"_p_wxArrowHead", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxStringList[] = {{"_p_wxStringList", 0, "wxStringList *", 0, 0, 0, 0},{"_p_wxStringList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_bool[] = {{"_p_bool", 0, "bool *", 0, 0, 0, 0},{"_p_bool", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxList[] = {{"_p_wxList", 0, "wxList *", 0, 0, 0, 0},{"_p_wxList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_double[] = {{"_p_double", 0, "double *", 0, 0, 0, 0},{"_p_double", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDivisionShape[] = {{"_p_wxPyDivisionShape", 0, "wxPyDivisionShape *", 0, 0, 0, 0},{"_p_wxPyDivisionShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDrawnShape[] = {{"_p_wxPyDrawnShape", 0, "wxPyDrawnShape *", 0, 0, 0, 0},{"_p_wxPyDrawnShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyPolygonShape[] = {{"_p_wxPyPolygonShape", 0, "wxPyPolygonShape *", 0, 0, 0, 0},{"_p_wxPyPolygonShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxBitmap[] = {{"_p_wxBitmap", 0, "wxBitmap *", 0, 0, 0, 0},{"_p_wxBitmap", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyBitmapShape[] = {{"_p_wxPyBitmapShape", 0, "wxPyBitmapShape *", 0, 0, 0, 0},{"_p_wxPyBitmapShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeEvtHandler[] = {{"_p_wxPyShapeEvtHandler", 0, "wxPyShapeEvtHandler *", 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyEllipseShape[] = {{"_p_wxPyEllipseShape", 0, "wxPyEllipseShape *", 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyEllipseShape, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeCanvas[] = {{"_p_wxPyShapeCanvas", 0, "wxPyShapeCanvas *", 0, 0, 0, 0},{"_p_wxPyShapeCanvas", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPoint[] = {{"_p_wxPoint", 0, "wxPoint *", 0, 0, 0, 0},{"_p_wxPoint", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/ogl/mac/ogl_wrap.cpp b/wxPython/contrib/ogl/mac/ogl_wrap.cpp index 3c1cfccfd6..4e3a462b0e 100644 --- a/wxPython/contrib/ogl/mac/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/mac/ogl_wrap.cpp @@ -312,17 +312,15 @@ static swig_type_info *swig_types[42]; SWIGSTATICINLINE(double) SWIG_AsDouble(PyObject *obj) { - double val = (PyFloat_Check(obj)) ? PyFloat_AsDouble(obj) : -#if HAVE_LONG_LONG - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLongLong(obj)); -#else - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLong(obj)); -#endif - if (PyErr_Occurred()) { - PyErr_Clear(); - PyErr_SetString(PyExc_TypeError, "a double is expected"); - } - return val; + if (PyNumber_Check(obj)) + return PyFloat_AsDouble(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -369,7 +367,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -33366,6 +33372,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPyVListBoxTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxPyVScrolledWindow *) ((wxPyVListBox *) x)); } @@ -33387,6 +33396,9 @@ static void *_p_wxPyPreviewControlBarTo_p_wxPanel(void *x) { static void *_p_wxPyShapeCanvasTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyShapeCanvas *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPreviewCanvasTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxPreviewCanvas *) x)); } @@ -33465,6 +33477,9 @@ static void *_p_wxSplitterWindowTo_p_wxWindow(void *x) { static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } @@ -33870,6 +33885,9 @@ static void *_p_wxPyVScrolledWindowTo_p_wxObject(void *x) { static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxSashEvent *) x)); } @@ -34104,6 +34122,9 @@ static void *_p_wxTopLevelWindowTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxControl *) x)); } @@ -34243,21 +34264,21 @@ static swig_type_info _swigt__p_wxPyControlPoint[] = {{"_p_wxPyControlPoint", 0, static swig_type_info _swigt__p_wxArrowHead[] = {{"_p_wxArrowHead", 0, "wxArrowHead *", 0, 0, 0, 0},{"_p_wxArrowHead", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxStringList[] = {{"_p_wxStringList", 0, "wxStringList *", 0, 0, 0, 0},{"_p_wxStringList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_bool[] = {{"_p_bool", 0, "bool *", 0, 0, 0, 0},{"_p_bool", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxList[] = {{"_p_wxList", 0, "wxList *", 0, 0, 0, 0},{"_p_wxList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_double[] = {{"_p_double", 0, "double *", 0, 0, 0, 0},{"_p_double", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDivisionShape[] = {{"_p_wxPyDivisionShape", 0, "wxPyDivisionShape *", 0, 0, 0, 0},{"_p_wxPyDivisionShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDrawnShape[] = {{"_p_wxPyDrawnShape", 0, "wxPyDrawnShape *", 0, 0, 0, 0},{"_p_wxPyDrawnShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyPolygonShape[] = {{"_p_wxPyPolygonShape", 0, "wxPyPolygonShape *", 0, 0, 0, 0},{"_p_wxPyPolygonShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxBitmap[] = {{"_p_wxBitmap", 0, "wxBitmap *", 0, 0, 0, 0},{"_p_wxBitmap", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyBitmapShape[] = {{"_p_wxPyBitmapShape", 0, "wxPyBitmapShape *", 0, 0, 0, 0},{"_p_wxPyBitmapShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeEvtHandler[] = {{"_p_wxPyShapeEvtHandler", 0, "wxPyShapeEvtHandler *", 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyEllipseShape[] = {{"_p_wxPyEllipseShape", 0, "wxPyEllipseShape *", 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyEllipseShape, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeCanvas[] = {{"_p_wxPyShapeCanvas", 0, "wxPyShapeCanvas *", 0, 0, 0, 0},{"_p_wxPyShapeCanvas", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPoint[] = {{"_p_wxPoint", 0, "wxPoint *", 0, 0, 0, 0},{"_p_wxPoint", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/ogl/msw/ogl_wrap.cpp b/wxPython/contrib/ogl/msw/ogl_wrap.cpp index fb7bbec1e6..b137351d19 100644 --- a/wxPython/contrib/ogl/msw/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/msw/ogl_wrap.cpp @@ -312,17 +312,15 @@ static swig_type_info *swig_types[42]; SWIGSTATICINLINE(double) SWIG_AsDouble(PyObject *obj) { - double val = (PyFloat_Check(obj)) ? PyFloat_AsDouble(obj) : -#if HAVE_LONG_LONG - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLongLong(obj)); -#else - ((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLong(obj)); -#endif - if (PyErr_Occurred()) { - PyErr_Clear(); - PyErr_SetString(PyExc_TypeError, "a double is expected"); - } - return val; + if (PyNumber_Check(obj)) + return PyFloat_AsDouble(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -369,7 +367,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } @@ -33366,6 +33372,9 @@ static void *_p_wxScrolledWindowTo_p_wxPanel(void *x) { static void *_p_wxPyVScrolledWindowTo_p_wxPanel(void *x) { return (void *)((wxPanel *) ((wxPyVScrolledWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxPanel(void *x) { + return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPyVListBoxTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxPyVScrolledWindow *) ((wxPyVListBox *) x)); } @@ -33387,6 +33396,9 @@ static void *_p_wxPyPreviewControlBarTo_p_wxPanel(void *x) { static void *_p_wxPyShapeCanvasTo_p_wxPanel(void *x) { return (void *)((wxPanel *) (wxScrolledWindow *) ((wxPyShapeCanvas *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxScrolledWindow(void *x) { + return (void *)((wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxPreviewCanvasTo_p_wxScrolledWindow(void *x) { return (void *)((wxScrolledWindow *) ((wxPreviewCanvas *) x)); } @@ -33465,6 +33477,9 @@ static void *_p_wxSplitterWindowTo_p_wxWindow(void *x) { static void *_p_wxSashWindowTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxSashWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxWindow(void *x) { return (void *)((wxWindow *) ((wxControl *) x)); } @@ -33870,6 +33885,9 @@ static void *_p_wxPyVScrolledWindowTo_p_wxObject(void *x) { static void *_p_wxMDIClientWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxSashEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxSashEvent *) x)); } @@ -34104,6 +34122,9 @@ static void *_p_wxTopLevelWindowTo_p_wxEvtHandler(void *x) { static void *_p_wxMDIClientWindowTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxMDIClientWindow *) x)); } +static void *_p_wxPyScrolledWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxPanel *)(wxScrolledWindow *) ((wxPyScrolledWindow *) x)); +} static void *_p_wxControlTo_p_wxEvtHandler(void *x) { return (void *)((wxEvtHandler *) (wxWindow *) ((wxControl *) x)); } @@ -34243,21 +34264,21 @@ static swig_type_info _swigt__p_wxPyControlPoint[] = {{"_p_wxPyControlPoint", 0, static swig_type_info _swigt__p_wxArrowHead[] = {{"_p_wxArrowHead", 0, "wxArrowHead *", 0, 0, 0, 0},{"_p_wxArrowHead", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxStringList[] = {{"_p_wxStringList", 0, "wxStringList *", 0, 0, 0, 0},{"_p_wxStringList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPanel[] = {{"_p_wxPanel", 0, "wxPanel *", 0, 0, 0, 0},{"_p_wxPanel", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxPanel, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_bool[] = {{"_p_bool", 0, "bool *", 0, 0, 0, 0},{"_p_bool", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxList[] = {{"_p_wxList", 0, "wxList *", 0, 0, 0, 0},{"_p_wxList", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0, 0, 0, 0},{"_p_wxFont", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxScrolledWindow[] = {{"_p_wxScrolledWindow", 0, "wxScrolledWindow *", 0, 0, 0, 0},{"_p_wxScrolledWindow", 0, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxScrolledWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_double[] = {{"_p_double", 0, "double *", 0, 0, 0, 0},{"_p_double", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDivisionShape[] = {{"_p_wxPyDivisionShape", 0, "wxPyDivisionShape *", 0, 0, 0, 0},{"_p_wxPyDivisionShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyDrawnShape[] = {{"_p_wxPyDrawnShape", 0, "wxPyDrawnShape *", 0, 0, 0, 0},{"_p_wxPyDrawnShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyPolygonShape[] = {{"_p_wxPyPolygonShape", 0, "wxPyPolygonShape *", 0, 0, 0, 0},{"_p_wxPyPolygonShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxBitmap[] = {{"_p_wxBitmap", 0, "wxBitmap *", 0, 0, 0, 0},{"_p_wxBitmap", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxQueryLayoutInfoEvent", _p_wxQueryLayoutInfoEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxOGLConstraint", _p_wxOGLConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxArrowHead", _p_wxArrowHeadTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontData", _p_wxFontDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintData", _p_wxPrintDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxLayoutAlgorithm", _p_wxLayoutAlgorithmTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindDialogEvent", _p_wxFindDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterEvent", _p_wxSplitterEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceData", _p_wxFindReplaceDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourData", _p_wxColourDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrinter", _p_wxPrinterTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCalculateLayoutEvent", _p_wxCalculateLayoutEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", _p_wxPyShapeEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintout", _p_wxPyPrintoutTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTaskBarIconEvent", _p_wxTaskBarIconEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDiagram", _p_wxDiagramTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSashEvent", _p_wxSashEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintPreview", _p_wxPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPrintPreview", _p_wxPyPrintPreviewTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAttachmentPoint", _p_wxAttachmentPointTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPseudoMetaFile", _p_wxPseudoMetaFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialogData", _p_wxPageSetupDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPrintDialogData", _p_wxPrintDialogDataTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShapeRegion", _p_wxShapeRegionTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyBitmapShape[] = {{"_p_wxPyBitmapShape", 0, "wxPyBitmapShape *", 0, 0, 0, 0},{"_p_wxPyBitmapShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeEvtHandler[] = {{"_p_wxPyShapeEvtHandler", 0, "wxPyShapeEvtHandler *", 0, 0, 0, 0},{"_p_wxPyControlPoint", _p_wxPyControlPointTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyRectangleShape", _p_wxPyRectangleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCompositeShape", _p_wxPyCompositeShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyLineShape", _p_wxPyLineShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDividedShape", _p_wxPyDividedShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", _p_wxPyEllipseShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPolygonShape", _p_wxPyPolygonShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDrawnShape", _p_wxPyDrawnShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyDivisionShape", _p_wxPyDivisionShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShape", _p_wxPyShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyShapeEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyBitmapShape", _p_wxPyBitmapShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyTextShape", _p_wxPyTextShapeTo_p_wxPyShapeEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxSplashScreen", _p_wxSplashScreenTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMiniFrame", _p_wxMiniFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPanel", _p_wxPyPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFindReplaceDialog", _p_wxFindReplaceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTextEntryDialog", _p_wxTextEntryDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSingleChoiceDialog", _p_wxSingleChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMultiChoiceDialog", _p_wxMultiChoiceDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFileDialog", _p_wxFileDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMessageDialog", _p_wxMessageDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxProgressDialog", _p_wxProgressDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPanel", _p_wxPanelTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxStatusBar", _p_wxStatusBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPopupTransientWindow", _p_wxPyPopupTransientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPopupWindow", _p_wxPopupWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashLayoutWindow", _p_wxSashLayoutWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplashScreenWindow", _p_wxSplashScreenWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSplitterWindow", _p_wxSplitterWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxSashWindow", _p_wxSashWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTopLevelWindow", _p_wxTopLevelWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIClientWindow", _p_wxMDIClientWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVScrolledWindow", _p_wxPyVScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyScrolledWindow", _p_wxPyScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxScrolledWindow", _p_wxScrolledWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTipWindow", _p_wxTipWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewFrame", _p_wxPyPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewFrame", _p_wxPreviewFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIChildFrame", _p_wxMDIChildFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyShapeCanvas", _p_wxPyShapeCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewCanvas", _p_wxPreviewCanvasTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyWindow", _p_wxPyWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyHtmlListBox", _p_wxPyHtmlListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyVListBox", _p_wxPyVListBoxTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyPreviewControlBar", _p_wxPyPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPreviewControlBar", _p_wxPreviewControlBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxTaskBarIcon", _p_wxTaskBarIconTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFrame", _p_wxFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxFontDialog", _p_wxFontDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDirDialog", _p_wxDirDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxColourDialog", _p_wxColourDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxDialog", _p_wxDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPageSetupDialog", _p_wxPageSetupDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPrintDialog", _p_wxPrintDialogTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMDIParentFrame", _p_wxMDIParentFrameTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyEllipseShape[] = {{"_p_wxPyEllipseShape", 0, "wxPyEllipseShape *", 0, 0, 0, 0},{"_p_wxPyCircleShape", _p_wxPyCircleShapeTo_p_wxPyEllipseShape, 0, 0, 0, 0, 0},{"_p_wxPyEllipseShape", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPyShapeCanvas[] = {{"_p_wxPyShapeCanvas", 0, "wxPyShapeCanvas *", 0, 0, 0, 0},{"_p_wxPyShapeCanvas", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxPoint[] = {{"_p_wxPoint", 0, "wxPoint *", 0, 0, 0, 0},{"_p_wxPoint", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; diff --git a/wxPython/contrib/stc/stc_wrap.cpp b/wxPython/contrib/stc/stc_wrap.cpp index 13d9c00f0f..a5e2ad39c7 100644 --- a/wxPython/contrib/stc/stc_wrap.cpp +++ b/wxPython/contrib/stc/stc_wrap.cpp @@ -317,7 +317,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/contrib/xrc/xrc_wrap.cpp b/wxPython/contrib/xrc/xrc_wrap.cpp index e11dd11403..723abd9834 100644 --- a/wxPython/contrib/xrc/xrc_wrap.cpp +++ b/wxPython/contrib/xrc/xrc_wrap.cpp @@ -330,7 +330,15 @@ SWIG_CheckLongInRange(long value, const char* type, SWIGSTATICINLINE(long) SWIG_AsLong(PyObject * obj) { - return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); + if (PyNumber_Check(obj)) + return PyInt_AsLong(obj); + else { + PyObject* errmsg = PyString_FromFormat("Expected number, got %s", + obj->ob_type->tp_name); + PyErr_SetObject(PyExc_TypeError, errmsg); + Py_DECREF(errmsg); + return 0; + } } diff --git a/wxPython/demo/ActiveX_FlashWindow.py b/wxPython/demo/ActiveX_FlashWindow.py index 3d6a2d0273..70e681d4c4 100644 --- a/wxPython/demo/ActiveX_FlashWindow.py +++ b/wxPython/demo/ActiveX_FlashWindow.py @@ -74,8 +74,9 @@ def runTest(frame, nb, log): dlg.Destroy() -overview = """\ -

wx.lib.pdfwin.FlashWindow

+overview = """\ + +

wx.lib.flashwin.FlashWindow

The wx.lib.pdfwin.FlashWindow class is yet another example of using ActiveX controls from wxPython using the new wx.activex module. This diff --git a/wxPython/demo/ActiveX_PDFWindow.py b/wxPython/demo/ActiveX_PDFWindow.py index 35c3956c30..6281f3e1bd 100644 --- a/wxPython/demo/ActiveX_PDFWindow.py +++ b/wxPython/demo/ActiveX_PDFWindow.py @@ -73,7 +73,8 @@ def runTest(frame, nb, log): dlg.Destroy() -overview = """\ +overview = """\ +

wx.lib.pdfwin.PDFWindow

The wx.lib.pdfwin.PDFWindow class is another example of using ActiveX diff --git a/wxPython/demo/BitmapButton.py b/wxPython/demo/BitmapButton.py index c28562d38b..02d2c618ee 100644 --- a/wxPython/demo/BitmapButton.py +++ b/wxPython/demo/BitmapButton.py @@ -49,9 +49,9 @@ def runTest(frame, nb, log): overview = """ -

StaticBitmap

+

BitmapButton

-

A StaticBitmap control displays a bitmap. It can have a separate bitmap for each button state: normal, selected, disabled.

+

A BitmapButton control displays a bitmap. It can have a separate bitmap for each button state: normal, selected, disabled.

The bitmaps to be displayed should have a small number of colours, such as 16, to avoid palette problems.

diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 733baf9f53..ddce684930 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -212,7 +212,6 @@ _treeList = [ 'FileHistory', 'FontEnumerator', 'Joystick', - 'NewNamespace', 'OGL', 'PrintFramework', 'ShapedWindow', diff --git a/wxPython/demo/Mask.py b/wxPython/demo/Mask.py index 3820c323b8..149019ca72 100644 --- a/wxPython/demo/Mask.py +++ b/wxPython/demo/Mask.py @@ -58,6 +58,7 @@ class TestMaskWindow(wx.ScrolledWindow): def OnPaint (self, e): + self.SetBackgroundColour(wx.Colour(0,128,0)) dc = wx.PaintDC(self) self.PrepareDC(dc) dc.SetTextForeground(wx.WHITE) diff --git a/wxPython/demo/NewNamespace.py b/wxPython/demo/NewNamespace.py deleted file mode 100644 index 15c4a752bb..0000000000 --- a/wxPython/demo/NewNamespace.py +++ /dev/null @@ -1,47 +0,0 @@ - -import wx # This module uses the new wx namespace -from wx import html -from Main import opj - -#---------------------------------------------------------------------- - -class TestPanel(wx.Panel): - def __init__(self, parent, log): - self.log = log - wx.Panel.__init__(self, parent, -1) - - hwin = html.HtmlWindow(self, -1) - hwin.LoadFile(opj('data/wxPackage.html')) - - sizer = wx.BoxSizer(wx.VERTICAL) - sizer.Add(hwin, 1, wx.EXPAND) - - self.SetSizer(sizer) - - -#---------------------------------------------------------------------- - -def runTest(frame, nb, log): - win = TestPanel(nb, log) - return win - -#---------------------------------------------------------------------- - - - -overview = """ -

Using the New Namespace

- -This sample isn't really a demo, but rather a place to display the -introductory doc for using the new namespace. - - -""" - - - -if __name__ == '__main__': - import sys,os - import run - run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) - diff --git a/wxPython/demo/Timer.py b/wxPython/demo/Timer.py index af5e77e43d..22b7192a2c 100644 --- a/wxPython/demo/Timer.py +++ b/wxPython/demo/Timer.py @@ -229,7 +229,7 @@ class NotifyTimer(wx.Timer): self.log = log def Notify(self): - log.write("got NotifyTimer event\n") + self.log.write("got NotifyTimer event\n") diff --git a/wxPython/demo/XmlResourceHandler.py b/wxPython/demo/XmlResourceHandler.py index 1f415e35a6..1fe3f3f7ad 100644 --- a/wxPython/demo/XmlResourceHandler.py +++ b/wxPython/demo/XmlResourceHandler.py @@ -9,7 +9,7 @@ resourceText = r''' - + 200,100 @@ -21,35 +21,53 @@ resourceText = r''' #---------------------------------------------------------------------- -class MyBluePanel(wx.Panel): +class MyCustomPanel(wx.Panel): def __init__(self, parent, id, pos, size, style, name): wx.Panel.__init__(self, parent, id, pos, size, style, name) # This is the little bit of customization that we do for this - # silly example. It could just as easily have been done in - # the resource. - self.SetBackgroundColour("BLUE") - self.SetForegroundColour("WHITE") + # silly example. + self.Bind(wx.EVT_SIZE, self.OnSize) + t = wx.StaticText(self, -1, "MyCustomPanel") + f = t.GetFont() + f.SetWeight(wx.BOLD) + f.SetPointSize(f.GetPointSize()+2) + t.SetFont(f) + self.t = t + + def OnSize(self, evt): + sz = self.GetSize() + w, h = self.t.GetTextExtent(self.t.GetLabel()) + self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) # To do it the more complex way, (see below) we need to write the # class a little differently... This could obviously be done with a # single class, but I wanted to make separate ones to make clear what # the different requirements are. -class PreMyBluePanel(wx.Panel): +class PreMyCustomPanel(wx.Panel): def __init__(self): p = wx.PrePanel() self.PostCreate(p) def Create(self, parent, id, pos, size, style, name): wx.Panel.Create(self, parent, id, pos, size, style, name) - self.SetBackgroundColour("BLUE") - self.SetForegroundColour("WHITE") + self.Bind(wx.EVT_SIZE, self.OnSize) + t = wx.StaticText(self, -1, "MyCustomPanel") + f = t.GetFont() + f.SetWeight(wx.BOLD) + f.SetPointSize(f.GetPointSize()+2) + t.SetFont(f) + self.t = t + def OnSize(self, evt): + sz = self.GetSize() + w, h = self.t.GetTextExtent(self.t.GetLabel()) + self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) #---------------------------------------------------------------------- -class MyBluePanelXmlHandler(xrc.XmlResourceHandler): +class MyCustomPanelXmlHandler(xrc.XmlResourceHandler): def __init__(self): xrc.XmlResourceHandler.__init__(self) # Specify the styles recognized by objects of this type @@ -61,7 +79,7 @@ class MyBluePanelXmlHandler(xrc.XmlResourceHandler): # This method and the next one are required for XmlResourceHandlers def CanHandle(self, node): - return self.IsOfClass(node, "MyBluePanel") + return self.IsOfClass(node, "MyCustomPanel") def DoCreateResource(self): # NOTE: wxWindows can be created in either a single-phase or @@ -86,20 +104,20 @@ class MyBluePanelXmlHandler(xrc.XmlResourceHandler): assert self.GetInstance() is None # Now create the object - panel = MyBluePanel(self.GetParentAsWindow(), - self.GetID(), - self.GetPosition(), - self.GetSize(), - self.GetStyle("style", wx.TAB_TRAVERSAL), - self.GetName() - ) + panel = MyCustomPanel(self.GetParentAsWindow(), + self.GetID(), + self.GetPosition(), + self.GetSize(), + self.GetStyle("style", wx.TAB_TRAVERSAL), + self.GetName() + ) else: # When using the more complex (but more flexible) method # the instance may already have been created, check for it panel = self.GetInstance() if panel is None: # if not, then create the instance (but not the window) - panel = PreMyBluePanel() + panel = PreMyCustomPanel() # Now call the panel's Create method to actually create the window panel.Create(self.GetParentAsWindow(), @@ -139,11 +157,11 @@ class TestPanel(wx.Panel): # Load the resource res = xrc.EmptyXmlResource() - res.InsertHandler(MyBluePanelXmlHandler()) + res.InsertHandler(MyCustomPanelXmlHandler()) res.LoadFromString(resourceText) # Now create a panel from the resource data - panel = res.LoadObject(self, "MyPanel", "MyBluePanel") + panel = res.LoadObject(self, "MyPanel", "MyCustomPanel") # and do the layout sizer = wx.BoxSizer(wx.VERTICAL) diff --git a/wxPython/demo/XmlResourceSubclass.py b/wxPython/demo/XmlResourceSubclass.py index 412aa9da7c..2fcb737bb4 100644 --- a/wxPython/demo/XmlResourceSubclass.py +++ b/wxPython/demo/XmlResourceSubclass.py @@ -11,7 +11,7 @@ resourceText = r''' subclass is specified as "moduleName.ClassName" Try changing the classname to one that does not exist and see what happens --> - + 200,100 #---------------------------------------------------------------------- -class MyBluePanel(wx.Panel): +class MyCustomPanel(wx.Panel): def __init__(self): p = wx.PrePanel() # the Create step is done by XRC. self.PostCreate(p) self.Bind(wx.EVT_WINDOW_CREATE, self.OnCreate) + self.Bind(wx.EVT_SIZE, self.OnSize) + def OnCreate(self, evt): # This is the little bit of customization that we do for this # silly example. It could just as easily have been done in # the resource. We do it in the EVT_WINDOW_CREATE handler # because the window doesn't really exist yet in the __init__. - self.SetBackgroundColour("BLUE") - self.SetForegroundColour("WHITE") + t = wx.StaticText(self, -1, "MyCustomPanel") + f = t.GetFont() + f.SetWeight(wx.BOLD) + f.SetPointSize(f.GetPointSize()+2) + t.SetFont(f) + self.t = t + def OnSize(self, evt): + sz = self.GetSize() + w, h = self.t.GetTextExtent(self.t.GetLabel()) + self.t.SetPosition(((sz.width-w)/2, (sz.height-h)/2)) + #---------------------------------------------------------------------- diff --git a/wxPython/demo/data/wxPackage.html b/wxPython/demo/data/wxPackage.html deleted file mode 100644 index 5b2fb06588..0000000000 --- a/wxPython/demo/data/wxPackage.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - -The wxPython wx Package - - - - - - -
-

The wxPython wx Package

-

Or, how to survive the new wx namespace changes.

- --- - - - - - - - - - - - -
Author:Patrick K. O'Brien
Contact:pobrien@orbtech.com
Organization:Orbtech
Date:2003-05-08
Revision:1.1.2.4
- -
-

Introduction

-

Big things sometimes come in small packages. This is certainly true -of the new wx package, which is being introduced in wxPython 2.4.1 as -a way to allow the "wx" prefix to be dropped from the names of all -wxPython classes, functions, and constants. This document should -answer all the questions you might have concerning the new wx package. -If not, feel free to contact the author. I hope you like the new wx -package as much as I do.

-
-
-

Why change anything?

-

This change is being made for a couple of reasons. The first reason -is to discourage the use of import *, which is a dangerous -technique that can create name conflicts and bloated namespaces.

-

The second reason is to remove what some perceive to be a "wart." For -example, the following code is rather ugly in that the "wx" prefix on -the wxFrame class name is no longer useful when you're using the wx -module prefix:

-
-from wxPython import wx
-
-class Frame(wx.wxFrame)
-
-

The new wx package allows you to write code like this, instead:

-
-import wx
-
-class Frame(wx.Frame)
-
-

The third reason is that the wxWindows project intends to do the same -thing (implement a new wx namespace and drop the "wx" prefix) and we -want wxPython to lead the way.

-
-
-

What does the new wx package do?

-

As a way of getting to this new syntax as quickly as possible, the -code in this new wx package was created. What it does is alter the -existing wx namespace dynamically. By making the changes on-the-fly -at runtime, we can try out the new syntax before any permanent changes -are made to the underlying class library. The downside of making -these changes at runtime is that there is a slight delay when you -import wx; the upside is that you can start using the new syntax -now.

-
-
-

Will any of this effect my existing code?

-

No. Your existing code will continue to work and be supported for -some time. It will be up to you to decide when to switch to the new -syntax. But all new documentation and code examples will use the new -syntax. So don't wait too long. You wouldn't want anyone calling you -old-fashioned, would you?

-
-
-

How does the new wx package work?

-

It's pretty simple, and pretty clever. The wx directory contains an -__init__.py file, making it a Python package. (In contrast, the -old wxPython.wx module is a module, not a package.) When you import -wx the code in the __init__.py file is executed, and that's -where all the magic takes place. Let's take a look at the code inside -the __init__.py file:

-
-"""wx package
-
-Provides a way to drop the wx prefix from wxPython objects."""
-
-__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
-__cvsid__ = "$Id$"
-__revision__ = "$Revision$"[11:-2]
-
-from wxPython import wx
-
-import types
-
-d_new = globals()
-d_old = wx.__dict__
-
-for old, obj in d_old.items():
-    if type(obj) is types.ModuleType or old.startswith('_'):
-        # Skip modules and private names.
-        continue
-    new = old
-    if old.startswith('EVT_'):
-        # Leave name unmodified; add to the new wx namespace.
-        d_new[new] = obj
-    elif old.startswith('wxEVT_'):
-        # Leave name unmodified; add to the new wx namespace.
-        d_new[new] = obj
-    else:
-        if old.startswith('wx'):
-            # Remove the 'wx' prefix.
-            new = old[2:]
-        # Add to the new wx package namespace.
-        d_new[new] = obj
-
-del d_new
-del d_old
-del new
-del obj
-del old
-del types
-
-del wx
-
-
-

Namespaces in Python are implemented as dictionaries. The dictionary -used to create the wx package's namespace is accessible using the -globals() function. The dictionary used to create the old -wxPython.wx module's namespace is wx.__dict__. Once we have these -two dictionaries, it's a simple matter of iterating through one, -changing the names, adding the renamed object to the other dictionary, -and cleaning up a few local variables and imported modules. Voila!

-
-
-

What about all the other modules, like grid, html, and stc?

-

There's more to wxPython than just the wx namespace. And we've got -those extra modules covered as well. For each of those modules (as -well as the lib package) we've got matching modules in the new wx -package. Let's take a look at a few of them.

-

Here is html.py:

-
-"""Provides a way to drop the wx prefix from wxPython objects."""
-
-__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
-__cvsid__ = "$Id$"
-__revision__ = "$Revision$"[11:-2]
-
-import wx
-from wx import prefix
-
-from wxPython import html
-prefix.rename(d_new=globals(), d_old=html.__dict__)
-del html
-
-del prefix
-del wx
-
-
-

And here is lib/dialogs.py:

-
-"""Provides a way to drop the wx prefix from wxPython objects."""
-
-__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
-__cvsid__ = "$Id$"
-__revision__ = "$Revision$"[11:-2]
-
-import wx
-from wx import prefix
-
-from wxPython.lib import dialogs
-prefix.rename(d_new=globals(), d_old=dialogs.__dict__)
-del dialogs
-
-del prefix
-del wx
-
-
-

As you can see, they both rely on the prefix.rename() function -defined in prefix.py:

-
-"""Renaming utility.
-
-Provides a way to drop the wx prefix from wxPython objects."""
-
-__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
-__cvsid__ = "$Id$"
-__revision__ = "$Revision$"[11:-2]
-
-import types
-
-def rename(d_new, d_old):
-    for old, obj in d_old.items():
-        if type(obj) is types.ModuleType or old.startswith('_'):
-            # Skip modules and private names.
-            continue
-##         mod = d_old['__name__']
-##         if hasattr(obj, '__module__') and not obj.__module__.startswith(mod):
-##             # Skip objects imported from other modules, except those
-##             # related to the current module, such as stc_.
-##             continue
-        new = old
-        if old.startswith('EVT_') or old.startswith('wxEVT_'):
-            # Leave these names unmodified.
-            pass 
-        elif old.startswith('wx'):
-            new = old[2:]
-        if new:
-            d_new[new] = d_old[old]
-
-
-

Again, the technique is very similar to the one used by the wx -package.

-
-
-

How do I use this new wx package?

-

The wx package is automatically created when you install wxPython -version 2.4.1 or higher. So all you have to do is:

-
-import wx
-
-
-
-

What are the issues with converting old code to use the new wx package?

-

Obviously, you need to change your import statements from:

-
-from wxPython import wx
-
-

or:

-
-from wxPython.wx import *
-
-

to:

-
-import wx
-
-

Then you need to refer to wx attributes without a "wx" prefix, such -as:

-
-class MyFrame(wx.Frame):
-
-

In most cases, existing code can be modified with a simple search and -replace.

-

One extra issue you might run into when converting existing code is -that the wx.__version__ attribute is no longer available, since the -new wx namespace doesn't include any private attributes from the old -wxPython.wx namespace. The solution is to use the wx.VERSION_STRING -attribute, which was introduced in wxPython 2.4.1.

-
-
-

Where can I find example programs using the new wx syntax?

-

Example programs are included in the wxPython/samples/wx_examples -directory, and are documented in the wxPythonExamples documentation -file. Also, all the code in the py package uses the new wx syntax. -You can learn more about these in the PyManual.

-
-
- - - - diff --git a/wxPython/distrib/DIRLIST b/wxPython/distrib/DIRLIST index 3ff573dfaa..8f075869ae 100644 --- a/wxPython/distrib/DIRLIST +++ b/wxPython/distrib/DIRLIST @@ -53,9 +53,6 @@ wxPython/samples/pySketch wxPython/samples/pySketch/images wxPython/samples/simple wxPython/samples/StyleEditor -wxPython/samples/wx_examples -wxPython/samples/wx_examples/basic -wxPython/samples/wx_examples/hello wxPython/samples/wxProject wxPython/scripts wxPython/src diff --git a/wxPython/distrib/README.devel.txt b/wxPython/distrib/README.devel.txt index b96b1743fe..3d7e548ac0 100644 --- a/wxPython/distrib/README.devel.txt +++ b/wxPython/distrib/README.devel.txt @@ -11,12 +11,12 @@ You'll need to add the following directories to your Include path (the wxPython-[version]\include And also you should link with a set of the *.lib files in the -lib/vc_dll dir. Us the ones with the 'u' in the name after the version +lib/vc_dll dir. Use the ones with the 'u' in the name after the version numbers for Unicode builds, the ones without the 'u' are for ANSI builds. I'm sure I've forgotten some files or something, so when you discover -what it is please let me know. Also, if anyone feels like turning +what they are please let me know. Also, if anyone feels like turning this text into a more detailed HOW-TO please send your text to me. diff --git a/wxPython/distrib/howto-distrib.txt b/wxPython/distrib/howto-distrib.txt index 4630852ab0..97f86dbc63 100644 --- a/wxPython/distrib/howto-distrib.txt +++ b/wxPython/distrib/howto-distrib.txt @@ -14,7 +14,7 @@ main intent of this document... Preflight Checklist ------------------- -* Ensure that the version info in wxPython/setup.py is correct. +* Ensure that the version info in wxPython/config.py is correct. * Ensure that all build machines are up to date with CVS, they should have the same versions of all the wxWidgets files if possible. (Use @@ -52,11 +52,6 @@ Windows (build env is on Cyclops) .make both-hybrid clean .make both-hybrid -* Make the .mo files - - cd wx/locale - makemo.py - * Build the tools. This btm script makes a static release version of wxWidgets, and then builds copies of wxrc.exe and tex2rtf.exe linking with that lib, placing them in wx/lib/vc_dll, (which you @@ -64,11 +59,16 @@ Windows (build env is on Cyclops) .make_tools.btm +* Make the .mo files + + cd wx/locale + makemo.py + * Make the HTMLHelp files. In the wx\wxPython directory run: distrib\makedocs.bat -* Clean and old wxPython builds: +* Clean any old wxPython builds: del /sx build build.unicode @@ -101,7 +101,7 @@ wx/wxPython dir: * Make the demo tarball: - dsitrib/makedemo + distrib/makedemo * Make the docs tarball: diff --git a/wxPython/distrib/mac/wxPythonOSX/Info.icns b/wxPython/distrib/mac/wxPythonOSX/Info.icns new file mode 100644 index 0000000000000000000000000000000000000000..140d91450f99f4b44fddc9c0d7d308f6d77e80ac GIT binary patch literal 59052 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

n81y3nb%OF-;2wpQ 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 z zJbIPf-o>#;0}ft|2J~Fe^nO&1@hTvoPrK*3Kl1p^KSaxwmO#yb-(+~!mou-dBl_ac zXK}c|2O~~iK@kKSFTm{_U-!9U!KnEHKKC5V=_7IG70CyB{`o)7!{CA+KXe6FrpjKv zAe-|S@LG78i^Jbqego@%e!f3_b4&1LV57d+;%iCT5$^X6t zXYft "$DMGDIR/root/Docs/README 1st.txt" < -

  • Make a %WXWIN%BIN directory and add it to the PATH. My build -scripts will copy the wxWidgets DLLs there.

    +
  • Make sure that %WXWIN%libvc_dll directory is on the PATH. The +wxWidgets DLLs will end up there as part of the build and so you'll +need it on the PATH for them to be found at runtime.

  • Change to the %WXWIN%buildmsw directory and copy my build scripts there.

    @@ -323,9 +324,5 @@ python demo.py - - diff --git a/wxPython/docs/CHANGES.html b/wxPython/docs/CHANGES.html index ecdf638c5b..55ca17a8b7 100644 --- a/wxPython/docs/CHANGES.html +++ b/wxPython/docs/CHANGES.html @@ -4,15 +4,15 @@ -CHANGES.txt for wxPython +Recent Changes for wxPython -
    -

    CHANGES.txt for wxPython

    +
    +

    Recent Changes for wxPython

    -

    2.5.1.1

    -

    (See also the MigrationGuide.txt file for details about some of the +

    2.5.1.4

    +

    (See also the MigrationGuide file for details about some of the big changes that have happened in this release and how you should adapt your code.)

    The wxWindows project and library is now known as wxWidgets. Please @@ -73,6 +73,24 @@ MacPrintFile, MacNewFile, and MacReopenApp.

    Added wx.PlatformInfo which is a tuple containing strings that describe the platform and build options of wxPython. See the MigrationGuide for more details.

    +

    Created a new extension module "activex" from Lindsay Mathieson's +newest wxActiveX class. (The existing iewin module used an older +version of this code, but only exposed the wxIEHtmlWin class.) This +new module will (in theory ;-) ) allow you to host arbitrary ActiveX +controls in a wx.Window, without requiring the use of the win32com +and other PyWin32 modules! This should eliminate the cronic problems +that have resulted from minor mismatches in how PyWin32 handles the +GIL and tstate when making callbacks, etc. The older iewin module +will be left in this release as the new stuff is not fully backwards +compatible, but you should migrate your code to the new IEHtmlWindow +in wx.lib.iewin, so the old one can be eventually removed. +Additionally, I've always considered that the wx.lib.activexwrapper +module is an ugly hack that I only included in the lib because I +couldn't figure out anything better. Well now we have something that, +if it isn't already, has the potential to be better. So consider +migrating away from using activexwrapper as well. Please see the +MigrationGuide for more details on using the new module.

    +

    Floats are allowed again as function parameters where ints are expected.

    2.4.2.4

    @@ -1225,9 +1243,5 @@ version segfault shortly after starting up.

    - - diff --git a/wxPython/docs/CHANGES.txt b/wxPython/docs/CHANGES.txt index b1d028aced..c94beec6e0 100644 --- a/wxPython/docs/CHANGES.txt +++ b/wxPython/docs/CHANGES.txt @@ -1,13 +1,16 @@ -CHANGES.txt for wxPython +Recent Changes for wxPython ===================================================================== -2.5.1.1 +2.5.1.4 ------- -(See also the MigrationGuide.txt file for details about some of the +(See also the MigrationGuide_ file for details about some of the big changes that have happened in this release and how you should adapt your code.) +.. _MigrationGuide: MigrationGuide.html + + The wxWindows project and library is now known as wxWidgets. Please see http://www.wxwindows.org/name.htm for more details. This won't really affect wxPython all that much, other than the fact that the @@ -96,18 +99,20 @@ and other PyWin32 modules! This should eliminate the cronic problems that have resulted from minor mismatches in how PyWin32 handles the GIL and tstate when making callbacks, etc. The older iewin module will be left in this release as the new stuff is not fully backwards -compatible, but you should migrate your code to the wx.activex version -of IEHtmlWindow, or the implementation in wx.lib.iewin, so the old one -can be eventually removed. Additionally, I've always considered that -the wx.lib.activexwrapper module is an ugly hack that I only included -in the lib because I couldn't figure out anything better. Well now we -have something that, if it isn't already, has the potential to be -better. So consider migrating away from using activexwrapper as well. -Please see the MigrationGuide for more details on using the new -module. +compatible, but you should migrate your code to the new IEHtmlWindow +in wx.lib.iewin, so the old one can be eventually removed. +Additionally, I've always considered that the wx.lib.activexwrapper +module is an ugly hack that I only included in the lib because I +couldn't figure out anything better. Well now we have something that, +if it isn't already, has the potential to be better. So consider +migrating away from using activexwrapper as well. Please see the +MigrationGuide for more details on using the new module. .. _wxActiveX: http://members.optusnet.com.au/~blackpaw1/wxactivex.html +Floats are allowed again as function parameters where ints are expected. + + 2.4.2.4 diff --git a/wxPython/docs/INSTALL.html b/wxPython/docs/INSTALL.html index 983cd11505..1867d8ae36 100644 --- a/wxPython/docs/INSTALL.html +++ b/wxPython/docs/INSTALL.html @@ -128,15 +128,11 @@ python setup.py install found at runtime by the extension modules without requiring that they be installed on the PATH:

    -copy %WXWIN%\BIN\wx*h_*.dll c:\Python23\Lib\site-pacakges\wx
    +copy %WXWIN%\lib\vc_dll\wx*h_*.dll c:\Python23\Lib\site-pacakges\wx
     
  • - - diff --git a/wxPython/docs/MigrationGuide.html b/wxPython/docs/MigrationGuide.html index 0c01a56e5d..3aab1df56f 100644 --- a/wxPython/docs/MigrationGuide.html +++ b/wxPython/docs/MigrationGuide.html @@ -12,13 +12,13 @@

    wxPython 2.5 Migration Guide

    This document will help explain some of the major changes in wxPython 2.5 and let you know what you need to do to adapt your programs to -those changes. Be sure to also check in the CHANGES.txt file like +those changes. Be sure to also check in the CHANGES file like usual to see info about the not so major changes and other things that have been added to wxPython.

    wxName Change

    The wxWindows project and library is now known as -wxWidgets. Please see here for more details.

    +wxWidgets. Please see here for more details.

    This won't really affect wxPython all that much, other than the fact that the wxwindows.org domain name will be changing to wxwidgets.org, so mail list, CVS, and etc. addresses will be changing. We're going @@ -78,7 +78,7 @@ need to change it to isinstance(obj, wxFoo).

    All of the EVT_* functions are now instances of the wx.PyEventBinder class. They have a __call__ method so they can still be used as functions like before, but making them instances adds some -flexibility.

    +flexibility that I expect to take advantave of in the future.

    wx.EvtHandler (the base class for wx.Window) now has a Bind method that makes binding events to windows a little easier. Here is its definition and docstring:

    @@ -137,7 +137,7 @@ values:

    If you create your own custom event types and EVT_* functions, and you want to be able to use them with the Bind method above then you should change your EVT_* to be an instance of wxPyEventBinder instead of a -function. If you used to have something like this:

    +function. For example, if you used to have something like this:

     myCustomEventType = wxNewEventType()
     def EVT_MY_CUSTOM_EVENT(win, id, func):
    @@ -330,16 +330,39 @@ before that time.

    the contribs (gizmos, stc, xrc, etc.) rather than building local copies of them. If you build your own copies of wxPython please be aware that you now need to also build the ogl, stc, xrc, and gizmos -libraries in addition to the main wx lib. [[TODO: update the -BUILD.*.txt files too!]]

    +libraries in addition to the main wx lib.

    The wxPython.h and other header files are now in .../wxPython/include/wx/wxPython instead of in wxPython/src. You should include it via the "wx/wxPython/wxPython.h" path and add -.../wxPython/include to your list of include paths. [[TODO: Install -these headers on Linux...]]

    +.../wxPython/include to your list of include paths. On OSX and +unix-like systems the wxPython headers are installed to the same place +that the wxWidgets headers are installed, so if you building wxPython +compatible extensions on those platforms then your include path shoudl +already be set properly.

    +

    If you are also using SWIG for your extension then you'll need to +adapt how the wxPython .i files are imported into your .i files. See +the wxPython sources for examples. Your modules will need to at least +%import core.i, and possibly others if you need the definition of +other classes. Since you will need them to build your modules, the +main wxPython .i files are also installed with the wxPython headers in +an i_files sibdirectory. It should be enough to pass a -I/pathname on +the command line for it to find the files.

    +

    The bulk of wxPython's setup.py has been moved to another module, +wx/build/config.py. This module will be installed as part of wxPython +so 3rd party modules that wish to use the same setup/configuration +code can do so simply by importing this module from their own setup.py +scripts using import wx.build.config.

    You no longer need to call wxClassInfo::CleanUpClasses() and wxClassInfo::InitializeClasses() in your extensions or when embedding wxPython.

    +

    The usage of wxPyBeginAllowThreads and wxPyEndAllowThreads has changed +slightly. wxPyBeginAllowThreads now returns a boolean value that must +be passed to the coresponding wxPyEndAllowThreads function call. This +is to help do the RightThing when calls to these two functions are +nested, or if calls to external code in other extension modules that +are wrapped in the standard Py_(BEGIN|END)_ALLOW_THERADS may result in +wx event handlers being called (such as during the call to +os.startfile.)

    Two (or Three!) Phase Create

    @@ -360,11 +383,11 @@ class MyDialog(wx.Dialog):

    Sizers

    The hack allowing the old "option" keyword parameter has been removed. -If you use keyworkd args with wxSizer Add, Insert, or Prepend methods -then you will need to use the "proportion" name instead of "option".

    -

    When adding a spacer to a sizer you now need to use a wxSize or a +If you use keyworkd args with w.xSizer Add, Insert, or Prepend methods +then you will need to use the proportion name instead of option.

    +

    When adding a spacer to a sizer you now need to use a wx.Size or a 2-integer sequence instead of separate width and height parameters.

    -

    The wxGridBagSizer class (very similar to the RowColSizer in the +

    The wx.GridBagSizer class (very similar to the RowColSizer in the library) has been added to C++ and wrapped for wxPython. It can also be used from XRC.

    You should not use AddWindow, AddSizer, AddSpacer (and similar for @@ -393,6 +416,107 @@ way. If there are any other platform/toolkit/build flags that make sense to add to this tuple please let me know.

    BTW, wx.Platform will probably be deprecated in the future.

    +
    +

    ActiveX

    +

    Lindsay Mathieson's newest wxActiveX class has been wrapped into a new +extension module called wx.activex. It is very generic and dynamic +and should allow hosting of arbitray ActiveX controls within your +wxPython apps. So far I've tested it with IE, PDF, and Flash +controls, (and there are new samples in the demo and also library +modules supporting these.)

    +

    The new wx.activex module contains a bunch of code, but the most +important things to look at are ActiveXWindow and ActiveXEvent. +ActiveXWindow derives from wxWindow and the constructor accepts a +CLSID for the ActiveX Control that should be created. (There is also +a CLSID class that can convert from a progID or a CLSID String.) The +ActiveXWindow class simply adds methods that allow you to query some +of the TypeInfo exposed by the ActiveX object, and also to get/set +properties or call methods by name. The Python implementation +automatically handles converting parameters and return values to/from +the types expected by the ActiveX code as specified by the TypeInfo, +(just bool, integers, floating point, strings and None/Empty so far, +but more can be handled later.)

    +

    That's pretty much all there is to the class, as I mentioned before it +is very generic and dynamic. Very little is hard-coded and everything +that is done with the actual ActiveX control is done at runtime and +referenced by property or method name. Since Python is such a dynamic +language this is a very good match. I thought for a while about doing +some Python black-magic and making the specific methods/properties of +the actual ActiveX control "appear" at runtime, but then decided that +it would be better and more understandable to do it via subclassing. +So there is a utility class in wx.activex that given an existing +ActiveXWindow instance can generate a .py module containing a derived +class with real methods and properties that do the Right Thing to +reflect those calls to the real ActiveX control. There is also a +script/tool module named genaxmodule that given a CLSID or progID and +a class name, will generate the module for you. There are a few +examples of the output of this tool in the wx.lib package, see +iewin.py, pdfwin.py and flashwin.py.

    +

    Currently the genaxmodule tool will tweak some of the names it +generates, but this can be controled if you would like to do it +differently by deriving your own class from GernerateAXModule, +overriding some methods and then using this class from a tool like +genaxmodule. [TODO: make specifying a new class on genaxmodule's +command-line possible.] The current default behavior is that any +event names that start with "On" will have the "On" dropped, property +names are converted to all lower case, and if any name is a Python +keyword it will have an underscore appended to it. GernerateAXModule +does it's best when generating the code in the new module, but it can +only be as good as the TypeInfo data available from the ActiveX +control so sometimes some tweaking will be needed. For example, the +IE web browser control defines the Flags parameter of the Navigate2 +method as required, but MSDN says it is optional.

    +

    It is intended that this new wx.activex module will replace both the +older version of Lindsay's code available in iewin.IEHtmlWindow, and +also the wx.lib.activexwraper module. Probably the biggest +differences you'll ecounter in migrating activexwrapper-based code +(besides events working better without causing deadlocks) is that +events are no longer caught by overriding methods in your derived +class. Instead ActiveXWindow uses the wx event system and you bind +handlers for the ActiveX events exactly the same way you do for any wx +event. There is just one extra step needed and that is creating an +event ID from the ActiveX event name, and if you use the genaxmodule +tool then this extra step will be handled for you there. For example, +for the StatusTextChange event in the IE web browser control, this +code is generated for you:

    +
    +wxEVT_StatusTextChange = wx.activex.RegisterActiveXEvent('StatusTextChange')
    +EVT_StatusTextChange = wx.PyEventBinder(wxEVT_StatusTextChange, 1)
    +
    +

    and you would use it in your code like this:

    +
    +self.Bind(iewin.EVT_StatusTextChange, self.UpdateStatusText, self.ie)
    +
    +

    When the event happens and your event handler function is called the +event properties from the ActiveX control (if any) are converted to +attributes of the event object passed to the handler. (Can you say +'event' any more times in a single sentence? ;-) ) For example the +StatusTextChange event will also send the text that should be put into +the status line as an event parameter named "Text" and you can access +it your handlers as an attribute of the event object like this:

    +
    +def UpdateStatusText(self, evt):
    +    self.SetStatusText(evt.Text)
    +
    +

    Usually these event object attributes should be considered read-only, +but some will be defined by the TypeInfo as output parameters. In +those cases if you modify the event object's attribute then that value +will be returned to the ActiveX control. For example, to prevent a +new window from being opened by the IE web browser control you can do +this in the handler for the iewin.EVT_NewWindow2 event:

    +
    +def OnNewWindow2(self, evt):
    +    evt.Cancel = True   
    +
    +

    So how do you know what methods, events and properties that an ActiveX +control supports? There is a funciton in wx.activex named GetAXInfo +that returns a printable summary of the TypeInfo from the ActiveX +instance passed in. You can use this as an example of how to browse +the TypeInfo provided, and there is also a copy of this function's +output appended as a comment to the modules produced by the +genaxmodule tool. Beyond that you'll need to consult the docs +provided by the makers of the ActiveX control that you are using.

    +

    Other Stuff

    Instead of over a dozen separate extension modules linked together @@ -422,18 +546,36 @@ wxPyTypeCast at all.

    there are compatibility aliases for much of the above items.

    The wxWave class has been renamed to wxSound, and now has a slightly different API.

    -

    Instead of a very small 20x20 the default window size is now a more -reasonable size, (currently 400x250 but that may change...) If you -don't specify a size, and the window/control class does not have any -definition of it's own "best size" (most controls do) then the new -default will be used. If you have code that accidentally depends on -the smaller size then things will look a bit odd. To work around this -just give those windows an explicit size when created.

    +

    wx.TaskbarIcon works on wxGTK-based platforms now, however you have to +manage it a little bit more than you did before. Basically, the app +will treat it like a top-level frame in that if the wx.TaskBarIcon +still exists when all the frames are closed then the app will still +not exit. You need to ensure that the wx.TaskBarIcon is destroyed +when your last Frame is closed. For wxPython apps it is usually +enough if your main frame object holds the only reference to the +wx.TaskBarIcon, then when the frame is closed Python reference +counting takes care of the rest.

    +

    Before Python 2.3 it was possible to pass a floating point object as a +parameter to a function that expected an integer, and the +PyArg_ParseTuple family of functions would automatically convert to +integer by truncating the fractional portion of the number. With +Python 2.3 that behavior was deprecated and a deprecation warning is +raised when you pass a floating point value, (for example, calling +wx.DC.DrawLineXY with floats for the position and size,) and lots of +developers using wxPython had to scramble to change their code to call +int() before calling wxPython methods. Recent changes in SWIG have +moved the conversion out of PyArg_ParseTuple to custom code that SWIG +generates. Since the default conversion fragment was a little too +strict and didn't generate a very meaningful exception when it failed, +I decided to use a custom fragment instead, and it turned out that +it's very easy to allow floats to be converted again just like they +used to be. So, in a nutshell, any numeric type that can be +converted to an integer is now legal to be passed to SWIG wrapped +functions in wxPython for parameters that are expecting an integer. +If the object is not already an integer then it will be asked to +convert itself to one. A similar conversion fragment is in place for +parameters that expect floating point values.

    - - diff --git a/wxPython/docs/MigrationGuide.txt b/wxPython/docs/MigrationGuide.txt index c9dfddbedb..476c60252d 100644 --- a/wxPython/docs/MigrationGuide.txt +++ b/wxPython/docs/MigrationGuide.txt @@ -4,10 +4,12 @@ wxPython 2.5 Migration Guide This document will help explain some of the major changes in wxPython 2.5 and let you know what you need to do to adapt your programs to -those changes. Be sure to also check in the CHANGES.txt file like +those changes. Be sure to also check in the CHANGES_ file like usual to see info about the not so major changes and other things that have been added to wxPython. +.. _CHANGES: CHANGES.html + wxName Change ------------- @@ -15,7 +17,7 @@ wxName Change The **wxWindows** project and library is now known as **wxWidgets**. Please see here_ for more details. -.. _here: http://www.wxwindows.org/name.htm +.. _here: http://www.wxwidgets.org/name.htm This won't really affect wxPython all that much, other than the fact that the wxwindows.org domain name will be changing to wxwidgets.org, @@ -89,7 +91,7 @@ Binding Events All of the EVT_* functions are now instances of the wx.PyEventBinder class. They have a __call__ method so they can still be used as functions like before, but making them instances adds some -flexibility. +flexibility that I expect to take advantave of in the future. wx.EvtHandler (the base class for wx.Window) now has a Bind method that makes binding events to windows a little easier. Here is its @@ -151,7 +153,7 @@ values:: If you create your own custom event types and EVT_* functions, and you want to be able to use them with the Bind method above then you should change your EVT_* to be an instance of wxPyEventBinder instead of a -function. If you used to have something like this:: +function. For example, if you used to have something like this:: myCustomEventType = wxNewEventType() def EVT_MY_CUSTOM_EVENT(win, id, func): @@ -362,19 +364,44 @@ wxPython's setup.py script now expects to use existing libraries for the contribs (gizmos, stc, xrc, etc.) rather than building local copies of them. If you build your own copies of wxPython please be aware that you now need to also build the ogl, stc, xrc, and gizmos -libraries in addition to the main wx lib. [[TODO: update the -BUILD.*.txt files too!]] +libraries in addition to the main wx lib. The wxPython.h and other header files are now in .../wxPython/include/wx/wxPython instead of in wxPython/src. You should include it via the "wx/wxPython/wxPython.h" path and add -.../wxPython/include to your list of include paths. [[TODO: Install -these headers on Linux...]] +.../wxPython/include to your list of include paths. On OSX and +unix-like systems the wxPython headers are installed to the same place +that the wxWidgets headers are installed, so if you building wxPython +compatible extensions on those platforms then your include path shoudl +already be set properly. + +If you are also using SWIG for your extension then you'll need to +adapt how the wxPython .i files are imported into your .i files. See +the wxPython sources for examples. Your modules will need to at least +``%import core.i``, and possibly others if you need the definition of +other classes. Since you will need them to build your modules, the +main wxPython .i files are also installed with the wxPython headers in +an i_files sibdirectory. It should be enough to pass a -I/pathname on +the command line for it to find the files. + +The bulk of wxPython's setup.py has been moved to another module, +wx/build/config.py. This module will be installed as part of wxPython +so 3rd party modules that wish to use the same setup/configuration +code can do so simply by importing this module from their own setup.py +scripts using ``import wx.build.config``. You no longer need to call wxClassInfo::CleanUpClasses() and wxClassInfo::InitializeClasses() in your extensions or when embedding wxPython. +The usage of wxPyBeginAllowThreads and wxPyEndAllowThreads has changed +slightly. wxPyBeginAllowThreads now returns a boolean value that must +be passed to the coresponding wxPyEndAllowThreads function call. This +is to help do the RightThing when calls to these two functions are +nested, or if calls to external code in other extension modules that +are wrapped in the standard Py_(BEGIN|END)_ALLOW_THERADS may result in +wx event handlers being called (such as during the call to +os.startfile.) @@ -400,13 +427,13 @@ Sizers ------ The hack allowing the old "option" keyword parameter has been removed. -If you use keyworkd args with wxSizer Add, Insert, or Prepend methods -then you will need to use the "proportion" name instead of "option". +If you use keyworkd args with w.xSizer Add, Insert, or Prepend methods +then you will need to use the ``proportion`` name instead of ``option``. -When adding a spacer to a sizer you now need to use a wxSize or a +When adding a spacer to a sizer you now need to use a wx.Size or a 2-integer sequence instead of separate width and height parameters. -The wxGridBagSizer class (very similar to the RowColSizer in the +The wx.GridBagSizer class (very similar to the RowColSizer in the library) has been added to C++ and wrapped for wxPython. It can also be used from XRC. @@ -480,7 +507,7 @@ class with real methods and properties that do the Right Thing to reflect those calls to the real ActiveX control. There is also a script/tool module named genaxmodule that given a CLSID or progID and a class name, will generate the module for you. There are a few -examples of the output of this tool in the wx.lib package. See +examples of the output of this tool in the wx.lib package, see iewin.py, pdfwin.py and flashwin.py. Currently the genaxmodule tool will tweak some of the names it @@ -501,7 +528,7 @@ method as required, but MSDN says it is optional. It is intended that this new wx.activex module will replace both the older version of Lindsay's code available in iewin.IEHtmlWindow, and also the wx.lib.activexwraper module. Probably the biggest -differences you'l ecounted in migrating activexwrapper-based code +differences you'll ecounter in migrating activexwrapper-based code (besides events working better without causing deadlocks) is that events are no longer caught by overriding methods in your derived class. Instead ActiveXWindow uses the wx event system and you bind @@ -525,16 +552,22 @@ attributes of the event object passed to the handler. (Can you say 'event' any more times in a single sentence? ;-) ) For example the StatusTextChange event will also send the text that should be put into the status line as an event parameter named "Text" and you can access -it your handlers as an attribute of the evnt object like this:: +it your handlers as an attribute of the event object like this:: def UpdateStatusText(self, evt): self.SetStatusText(evt.Text) -These event object attributes should be considered read-only since -support for output parameters on the events is not yet implemented. -But that could/should change in the future. +Usually these event object attributes should be considered read-only, +but some will be defined by the TypeInfo as output parameters. In +those cases if you modify the event object's attribute then that value +will be returned to the ActiveX control. For example, to prevent a +new window from being opened by the IE web browser control you can do +this in the handler for the iewin.EVT_NewWindow2 event:: -So how do you know what methods, events and properties that am ActiveX + def OnNewWindow2(self, evt): + evt.Cancel = True + +So how do you know what methods, events and properties that an ActiveX control supports? There is a funciton in wx.activex named GetAXInfo that returns a printable summary of the TypeInfo from the ActiveX instance passed in. You can use this as an example of how to browse @@ -595,12 +628,23 @@ enough if your main frame object holds the only reference to the wx.TaskBarIcon, then when the frame is closed Python reference counting takes care of the rest. -If you are embedding wxPython in a C++ app, or are writing wxPython -compatible extensions modules, then the usage of wxPyBeginAllowThreads -and wxPyEndAllowThreads has changed slightly. wxPyBeginAllowThreads -now returns a boolean value that must be passed to the coresponding -wxPyEndAllowThreads function call. This is to help do the RightThing -when calls to these two functions are nested, or if calls to external -code that are wrapped in the standard Py_(BEGIN|END)_ALLOW_THERADS may -result in wx event handlers being called (such as os.startfile.) - +Before Python 2.3 it was possible to pass a floating point object as a +parameter to a function that expected an integer, and the +PyArg_ParseTuple family of functions would automatically convert to +integer by truncating the fractional portion of the number. With +Python 2.3 that behavior was deprecated and a deprecation warning is +raised when you pass a floating point value, (for example, calling +wx.DC.DrawLineXY with floats for the position and size,) and lots of +developers using wxPython had to scramble to change their code to call +int() before calling wxPython methods. Recent changes in SWIG have +moved the conversion out of PyArg_ParseTuple to custom code that SWIG +generates. Since the default conversion fragment was a little too +strict and didn't generate a very meaningful exception when it failed, +I decided to use a custom fragment instead, and it turned out that +it's very easy to allow floats to be converted again just like they +used to be. So, in a nutshell, any numeric type that can be +converted to an integer is now legal to be passed to SWIG wrapped +functions in wxPython for parameters that are expecting an integer. +If the object is not already an integer then it will be asked to +convert itself to one. A similar conversion fragment is in place for +parameters that expect floating point values. diff --git a/wxPython/docs/PyManual.html b/wxPython/docs/PyManual.html index 1020b0a8a1..6ebdc01b38 100644 --- a/wxPython/docs/PyManual.html +++ b/wxPython/docs/PyManual.html @@ -7,7 +7,7 @@ The Py Manual - + @@ -25,9 +25,9 @@ Organization: Orbtech Date: -2004-02-04 +2004-03-26 Revision: -1.3 +1.4
    @@ -111,8 +111,8 @@ point where I thought the original PyCrust name was too confining. I was using the PyCrust code base to develop programs that weren't just Python shells any more.

    Around that same time, the wxPython folks asked me if I'd be willing -to move all my wxPython-related projects into the wxPython CVS -repository, and become part of the wxPython/wxWindows developer team. +to move all my wxPython-related projects into the wxPython CVS +repository, and become part of the wxPython/wxWidgets developer team. I decided the time was right to restructure the PyCrust project. During the move, the PyCrust package was renamed to "py" (lowercase "p") and the collection of programs and modules as a whole became @@ -182,8 +182,8 @@ underlying filling module.

    as PyCrust, but doesn't have any of the extra features that appear in the PyCrust notebook interface.

    -

    /screenshots/PyShell.png

    -

    PyShell running on Mandrake Linux 9.1.

    +

    screenshots/PyShell.png

    +

    PyShell running on Mandrake Linux.

    @@ -238,7 +238,7 @@ programs and modules, since the beginning.

    * wxPython Docs * wxSTC Docs

    Fixed Calltip tab refresh problem on Windows.

    -

    shell.autoCompleteAutoHide added with default of True.

    +

    shell.autoCompleteAutoHide added with default of False.

    Changed default namespace of Shell to __main__.__dict__, instead of an empty dictionary.

    @@ -698,9 +698,5 @@ needed. PyCrust had to happen...

    - - diff --git a/wxPython/docs/PyManual.txt b/wxPython/docs/PyManual.txt index dc33a20fa4..9ff2209bab 100644 --- a/wxPython/docs/PyManual.txt +++ b/wxPython/docs/PyManual.txt @@ -67,15 +67,15 @@ Python shells any more. Around that same time, the wxPython folks asked me if I'd be willing to move all my wxPython-related projects into the `wxPython CVS -repository`_, and become part of the wxPython_/wxWindows_ developer team. +repository`_, and become part of the wxPython_/wxWidgets_ developer team. I decided the time was right to restructure the PyCrust project. During the move, the PyCrust package was renamed to "py" (lowercase "p") and the collection of programs and modules as a whole became known as "Py" (with a capital "P"). -.. _wxPython CVS repository: http://cvs.wxwindows.org +.. _wxPython CVS repository: http://cvs.wxWidgets.org .. _SourceForge: http://www.sf.net/projects/pycrust/ -.. _wxWindows: http://www.wxwindows.org/ +.. _wxWidgets: http://www.wxWidgets.org/ The original goal of PyCrust was to be the best interactive, graphical Python shell (of course, I claimed it was the "flakiest" Python @@ -155,9 +155,9 @@ PyShell is an interactive, Python shell. It shares the same base code as PyCrust, but doesn't have any of the extra features that appear in the PyCrust notebook interface. -.. figure:: /screenshots/PyShell.png +.. figure:: screenshots/PyShell.png - PyShell running on Mandrake Linux 9.1. + PyShell running on Mandrake Linux. PyWrap diff --git a/wxPython/docs/README.html b/wxPython/docs/README.html index c899a28851..c7c5505fdb 100644 --- a/wxPython/docs/README.html +++ b/wxPython/docs/README.html @@ -58,9 +58,5 @@ Robin Dunn robin@alldunn.com

    - - diff --git a/wxPython/docs/docutils.conf b/wxPython/docs/docutils.conf index bef8eb9890..ffe24c2e7d 100644 --- a/wxPython/docs/docutils.conf +++ b/wxPython/docs/docutils.conf @@ -1,5 +1,4 @@ [general] output_encoding: iso-8859-1 source_link: 0 -datestamp: %Y-%m-%d %H:%M UTC generator: 0 diff --git a/wxPython/docs/screenshots/PyShell.png b/wxPython/docs/screenshots/PyShell.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c9dd36f12cddc99a9f44fa8bec98bf24b4e4b9 GIT binary patch literal 35825 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

    $xuQl^eP%unccHwA}3NgUg-Pv>KTeX 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∓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 S$#?iQB0Nq_@x463@BaYg;|`br diff --git a/wxPython/docs/wxPackage.html b/wxPython/docs/wxPackage.html index fb8cbb71e8..8969840b20 100644 --- a/wxPython/docs/wxPackage.html +++ b/wxPython/docs/wxPackage.html @@ -8,7 +8,7 @@ - + @@ -28,9 +28,9 @@ Organization: Orbtech Date: -2004-02-04 +2004-03-26 Revision: -1.3 +1.4

    @@ -163,15 +163,97 @@ replace.

    Where can I find example programs using the new wx syntax?

    -

    Example programs are included in the wxPython/samples/wx_examples -directory, and are documented in the wxPythonExamples documentation -file. Also, all the code in the py package uses the new wx syntax. -You can learn more about these in the PyManual.

    +

    The wxPython demo application and most of the sample apps have been +converted to use the new import wx style of programming with +wxPython, so there are lots of examples to look at and to play with. +Here is one of them, it is the simple sample.

    +
    +#----------------------------------------------------------------------
    +# A very simple wxPython example.  Just a wxFrame, wxPanel,
    +# wxStaticText, wxButton, and a wxBoxSizer, but it shows the basic
    +# structure of any wxPython application.
    +#----------------------------------------------------------------------
    +
    +import wx
    +
    +
    +class MyFrame(wx.Frame):
    +    """
    +    This is MyFrame.  It just shows a few controls on a wxPanel,
    +    and has a simple menu.
    +    """
    +    def __init__(self, parent, title):
    +        wx.Frame.__init__(self, parent, -1, title,
    +                          pos=(150, 150), size=(350, 200))
    +
    +        # Create the menubar
    +        menuBar = wx.MenuBar()
    +
    +        # and a menu 
    +        menu = wx.Menu()
    +
    +        # add an item to the menu, using \tKeyName automatically
    +        # creates an accelerator, the third param is some help text
    +        # that will show up in the statusbar
    +        menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample")
    +
    +        # bind the menu event to an event handler
    +        self.Bind(wx.EVT_MENU, self.OnTimeToClose, id=wx.ID_EXIT)
    +
    +        # and put the menu on the menubar
    +        menuBar.Append(menu, "&File")
    +        self.SetMenuBar(menuBar)
    +
    +        self.CreateStatusBar()
    +        
    +
    +        # Now create the Panel to put the other controls on.
    +        panel = wx.Panel(self)
    +
    +        # and a few controls
    +        text = wx.StaticText(panel, -1, "Hello World!")
    +        text.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD))
    +        text.SetSize(text.GetBestSize())
    +        btn = wx.Button(panel, -1, "Close")
    +        funbtn = wx.Button(panel, -1, "Just for fun...")
    +
    +        # bind the button events to handlers
    +        self.Bind(wx.EVT_BUTTON, self.OnTimeToClose, btn)
    +        self.Bind(wx.EVT_BUTTON, self.OnFunButton, funbtn)
    +
    +        # Use a sizer to layout the controls, stacked vertically and with
    +        # a 10 pixel border around each
    +        sizer = wx.BoxSizer(wx.VERTICAL)
    +        sizer.Add(text, 0, wx.ALL, 10)
    +        sizer.Add(btn, 0, wx.ALL, 10)
    +        sizer.Add(funbtn, 0, wx.ALL, 10)
    +        panel.SetSizer(sizer)
    +        panel.Layout()
    +
    +
    +    def OnTimeToClose(self, evt):
    +        """Event handler for the button click."""
    +        print "See ya later!"
    +        self.Close()
    +
    +    def OnFunButton(self, evt):
    +        """Event handler for the button click."""
    +        print "Having fun yet?"
    +
    +
    +class MyApp(wx.App):
    +    def OnInit(self):
    +        frame = MyFrame(None, "Simple wxPython App")
    +        frame.Show(True)
    +        self.SetTopWindow(frame)
    +        return True
    +        
    +app = MyApp(True)
    +app.MainLoop()
    +
    +
    +
    - - diff --git a/wxPython/docs/wxPackage.txt b/wxPython/docs/wxPackage.txt index efd675b06b..35e6e0b64e 100644 --- a/wxPython/docs/wxPackage.txt +++ b/wxPython/docs/wxPackage.txt @@ -157,10 +157,12 @@ replace. Where can I find example programs using the new wx syntax? ========================================================== -Example programs are included in the wxPython/samples/wx_examples -directory, and are documented in the wxPythonExamples_ documentation -file. Also, all the code in the py package uses the new wx syntax. -You can learn more about these in the PyManual_. +The wxPython demo application and most of the sample apps have been +converted to use the new ``import wx`` style of programming with +wxPython, so there are lots of examples to look at and to play with. +Here is one of them, it is the ``simple`` sample. + + +.. include:: ../samples/simple/simple.py + :literal: -.. _wxPythonExamples: wxPythonExamples.html -.. _PyManual: PyManual.html diff --git a/wxPython/docs/wxPythonDocs.html b/wxPython/docs/wxPythonDocs.html deleted file mode 100644 index 53eb239a9f..0000000000 --- a/wxPython/docs/wxPythonDocs.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - -wxPython Documentation - - - - - - -
    -

    wxPython Documentation

    - --- - - - - - - - - - - - -
    Author:Patrick K. O'Brien
    Contact:pobrien@orbtech.com
    Organization:Orbtech
    Date:2003-07-02
    Revision:1.2
    -
    -

    wxPython Manual

    -

    The wxPython Manual is a reference to the wxPython toolkit.

    -
    -
    -

    wxPython Developer Reference

    -

    The wxPython source code documentation is for developers, and was -created using the Epydoc tool.

    -
    -
    -

    wxPython Tutorial

    -

    The wxPython Tutorial will help get you started with wxPython.

    -
    -
    -

    wxPython Examples

    -

    The wxPython Examples illustrates example programs using wxPython.

    -
    -
    -

    wx Package

    -

    The wxPython wx Package explains the new prefix-less wx package.

    -
    -
    -

    Py Manual

    -

    The Py Manual documents the Py collection of programs and source -code modules, including:

    -
      -
    • PyAlaCarte
    • -
    • PyAlaMode
    • -
    • PyCrust
    • -
    • PyFilling
    • -
    • PyShell
    • -
    • PyWrap
    • -
    -
    -
    -

    Py Developer Reference

    -

    The Py source code documentation is for developers, and was created -using the Epydoc tool.

    -
    -
    - - - - diff --git a/wxPython/docs/wxPythonDocs.txt b/wxPython/docs/wxPythonDocs.txt deleted file mode 100644 index cbc378ecc4..0000000000 --- a/wxPython/docs/wxPythonDocs.txt +++ /dev/null @@ -1,77 +0,0 @@ -======================== - wxPython Documentation -======================== - -:Author: Patrick K. O'Brien -:Contact: pobrien@orbtech.com -:Organization: Orbtech_ -:Date: $Date$ -:Revision: $Revision$ - -.. _Orbtech: http://www.orbtech.com/ - - -wxPython Manual -=============== - -`The wxPython Manual`_ is a reference to the wxPython toolkit. - -.. _The wxPython Manual: wxPythonManual.html - - -wxPython Developer Reference -============================ - -`The wxPython source code documentation`_ is for developers, and was -created using the Epydoc tool. - -.. _The wxPython source code documentation: http://www.orbtech.com/www/wx/epydoc/ - - -wxPython Tutorial -================= - -`The wxPython Tutorial`_ will help get you started with wxPython. - -.. _The wxPython Tutorial: wxPythonTutorial.html - - -wxPython Examples -================= - -`The wxPython Examples`_ illustrates example programs using wxPython. - -.. _The wxPython Examples: wxPythonExamples.html - - -wx Package -========== - -`The wxPython wx Package`_ explains the new prefix-less wx package. - -.. _The wxPython wx Package: wxPackage.html - - -Py Manual -========= - -`The Py Manual`_ documents the Py collection of programs and source -code modules, including: - -* PyAlaCarte -* PyAlaMode -* PyCrust -* PyFilling -* PyShell -* PyWrap - -.. _The Py Manual: PyManual.html - - -Py Developer Reference -====================== - -`The Py source code documentation`_ is for developers, and was created -using the Epydoc tool. - -.. _The Py source code documentation: http://www.orbtech.com/www/wx/epydoc/public/wx.py-module.html diff --git a/wxPython/docs/wxPythonExamples.html b/wxPython/docs/wxPythonExamples.html deleted file mode 100644 index ef24fde165..0000000000 --- a/wxPython/docs/wxPythonExamples.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - -Example Programs Using wxPython - - - - - - -
    -

    Example Programs Using wxPython

    -

    A survival guide for the post-wx-prefixed world.

    - --- - - - - - - - - - - - -
    Author:Patrick K. O'Brien
    Contact:pobrien@orbtech.com
    Organization:Orbtech
    Date:2003-07-02
    Revision:1.2
    - -
    -

    Introduction

    -

    This document illustrates example programs using wxPython. All the -examples make use of the new wx package syntax introduced in wxPython -2.4.1, which is a bit different than older examples you might come -across.

    -
    -
    -

    Background (with tongue firmly in cheek)

    -

    If something hits you on the head, don't run around screaming that the -sky is falling. Instead, take a close look and see if it wasn't a -"wx" prefix that hit you. Apparently, they're dropping off wxPython -class names like flies dropping dead in the scorching heat of a -summer's day.

    -

    Yes, the world is changing, and even our little wxPython world must -change with it. Then again, I'm not fond of pesky summertime flies, -and I'm not too upset that the "wx" prefixes are going to bite the -dust. I think it's for the best. But, being the kind, considerate -person that I am, I decided to write this guide to make the wx -namespace transition easier for everyone, even Chicken Little.

    -
    -

    Note

    -

    Say what?

    -

    If you have no idea what I mean by the "wx namespace transition," -consider yourself lucky. You can simply use these examples to -learn wxPython in its current state (beginning with wxPython -version 2.4.1). All you need to know is that previous wxPython -code used a slightly different syntax that some folks (including -me) considered ugly. So we changed it. And that's when the sky -starting falling...

    -

    If you want more of the technical details, read the wx package -documentation.

    -
    -

    Rather than simply tell you that everything will be okay, I -decided to show you that everything will be okay. To do that, -I've created a bunch of example programs using the new wx package. I -hope you like them.

    -
    -
    -

    Basic Program Example

    -

    It doesn't get much simpler than this. Every wxPython program needs -an application and a frame. To encourage good coding habits, I've -split them into separate modules. They don't do much, but they're a -good starting point.

    -

    I include a simple App class in the frame module because the PyWrap -"wrapper" utility (pywrap) only works with modules that contain an -application class. So including a simple one in each of your frame -modules allows you to use the PyWrap runtime wrapper and debug your -frames independent of your full application.

    -

    Here is the module (frame.py) that defines the frame class:

    -
    -#!/usr/bin/env python
    -
    -"""Basic frame class, with App for testing."""
    -
    -__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
    -__cvsid__ = "$Id$"
    -__revision__ = "$Revision$"[11:-2]
    -
    -import wx
    -
    -class Frame(wx.Frame):
    -    """Frame class."""
    -
    -    def __init__(self, parent=None, id=-1, title='Title',
    -                 pos=wx.DefaultPosition, size=(400, 200)):
    -        """Create a Frame instance."""
    -        wx.Frame.__init__(self, parent, id, title, pos, size)
    -
    -class App(wx.App):
    -    """Application class."""
    -
    -    def OnInit(self):
    -        self.frame = Frame()
    -        self.frame.Show()
    -        self.SetTopWindow(self.frame)
    -        return True
    -
    -def main():
    -    app = App()
    -    app.MainLoop()
    -
    -if __name__ == '__main__':
    -    main()
    -
    -
    -

    And here is the module (app.py) that defines the application class -and imports the frame from frame.py:

    -
    -#!/usr/bin/env python
    -
    -"""Basic application class."""
    -
    -__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
    -__cvsid__ = "$Id$"
    -__revision__ = "$Revision$"[11:-2]
    -
    -import wx
    -
    -from frame import Frame
    -
    -class App(wx.App):
    -    """Application class."""
    -
    -    def OnInit(self):
    -        self.frame = Frame()
    -        self.frame.Show()
    -        self.SetTopWindow(self.frame)
    -        return True
    -
    -def main():
    -    app = App()
    -    app.MainLoop()
    -
    -if __name__ == '__main__':
    -    main()
    -
    -
    -
    -
    -

    Hello wxPython Example

    -

    This program displays an image file (wxPython.jpg) inside a frame -sized to match the graphic.

    -
    -

    screenshots/hello-win98.png

    -

    Running hello.py on Windows.

    -
    -
    -

    screenshots/hello-linux.png

    -

    Running hello.py on Linux.

    -
    -
    -

    screenshots/hello-mac.png

    -

    Running hello.py on Mac OS X.

    -
    -

    Here is the source code for hello.py:

    -
    -#!/usr/bin/env python
    -
    -"""Hello, wxPython! program."""
    -
    -__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
    -__cvsid__ = "$Id$"
    -__revision__ = "$Revision$"[11:-2]
    -
    -import wx
    -
    -class Frame(wx.Frame):
    -    """Frame class that displays an image."""
    -
    -    def __init__(self, image, parent=None, id=-1,
    -                 pos=wx.DefaultPosition, title='Hello, wxPython!'):
    -        """Create a Frame instance and display image."""
    -        temp = image.ConvertToBitmap()
    -        size = temp.GetWidth(), temp.GetHeight()
    -        wx.Frame.__init__(self, parent, id, title, pos, size)
    -        self.bmp = wx.StaticBitmap(parent=self, id=-1, bitmap=temp)
    -
    -class App(wx.App):
    -    """Application class."""
    -
    -    def OnInit(self):
    -        wx.InitAllImageHandlers()
    -        image = wx.Image('wxPython.jpg', wx.BITMAP_TYPE_JPEG)
    -        self.frame = Frame(image)
    -        self.frame.Show()
    -        self.SetTopWindow(self.frame)
    -        return True
    -
    -def main():
    -    app = App()
    -    app.MainLoop()
    -
    -if __name__ == '__main__':
    -    main()
    -
    -
    -
    -
    - - - - diff --git a/wxPython/docs/wxPythonExamples.txt b/wxPython/docs/wxPythonExamples.txt deleted file mode 100644 index 80c178a6ae..0000000000 --- a/wxPython/docs/wxPythonExamples.txt +++ /dev/null @@ -1,118 +0,0 @@ -================================= - Example Programs Using wxPython -================================= - --------------------------------------------------- - A survival guide for the post-wx-prefixed world. --------------------------------------------------- - -:Author: Patrick K. O'Brien -:Contact: pobrien@orbtech.com -:Organization: Orbtech_ -:Date: $Date$ -:Revision: $Revision$ - -.. _Orbtech: http://www.orbtech.com/ - -.. contents:: - - -Introduction -============ - -This document illustrates example programs using wxPython. All the -examples make use of the new wx package syntax introduced in wxPython -2.4.1, which is a bit different than older examples you might come -across. - - -Background (with tongue firmly in cheek) -======================================== - -If something hits you on the head, don't run around screaming that the -sky is falling. Instead, take a close look and see if it wasn't a -"wx" prefix that hit you. Apparently, they're dropping off wxPython -class names like flies dropping dead in the scorching heat of a -summer's day. - -Yes, the world is changing, and even our little wxPython world must -change with it. Then again, I'm not fond of pesky summertime flies, -and I'm not too upset that the "wx" prefixes are going to bite the -dust. I think it's for the best. But, being the kind, considerate -person that I am, I decided to write this guide to make the wx -namespace transition easier for everyone, even Chicken Little. - -.. note:: Say what? - - If you have no idea what I mean by the "wx namespace transition," - consider yourself lucky. You can simply use these examples to - learn wxPython in its current state (beginning with wxPython - version 2.4.1). All you need to know is that previous wxPython - code used a slightly different syntax that some folks (including - me) considered ugly. So we changed it. And that's when the sky - starting falling... - - If you want more of the technical details, read the `wx package - documentation`_. - - .. _wx package documentation: wxPackage.html - - -Rather than simply **tell** you that everything will be okay, I -decided to **show** you that everything will be okay. To do that, -I've created a bunch of example programs using the new wx package. I -hope you like them. - - -Basic Program Example -===================== - -It doesn't get much simpler than this. Every wxPython program needs -an application and a frame. To encourage good coding habits, I've -split them into separate modules. They don't do much, but they're a -good starting point. - -I include a simple App class in the frame module because the PyWrap -"wrapper" utility (``pywrap``) only works with modules that contain an -application class. So including a simple one in each of your frame -modules allows you to use the PyWrap runtime wrapper and debug your -frames independent of your full application. - -Here is the module (``frame.py``) that defines the frame class: - -.. include:: ../samples/wx_examples/basic/frame.py - :literal: - -And here is the module (``app.py``) that defines the application class -and imports the frame from ``frame.py``: - -.. include:: ../samples/wx_examples/basic/app.py - :literal: - - -Hello wxPython Example -====================== - -This program displays an image file (``wxPython.jpg``) inside a frame -sized to match the graphic. - -.. figure:: screenshots/hello-win98.png - :scale: 100 - - Running ``hello.py`` on Windows. - -.. figure:: screenshots/hello-linux.png - :scale: 100 - - Running ``hello.py`` on Linux. - -.. figure:: screenshots/hello-mac.png - :scale: 100 - - Running ``hello.py`` on Mac OS X. - -Here is the source code for ``hello.py``: - -.. include:: ../samples/wx_examples/hello/hello.py - :literal: - diff --git a/wxPython/docs/wxPythonManual.html b/wxPython/docs/wxPythonManual.html index 58672d05cb..c23448f728 100644 --- a/wxPython/docs/wxPythonManual.html +++ b/wxPython/docs/wxPythonManual.html @@ -7,7 +7,7 @@ The wxPython Manual - + @@ -25,9 +25,9 @@ Organization: Orbtech Date: -2003-07-02 +2004-03-26 Revision: -1.2 +1.3 License:wxWindows Free Documentation Licence, Version 3 @@ -43,7 +43,7 @@
  • Mac OS X
  • -
  • What is wxWindows?
  • +
  • What is wxWidgets?
  • Why another cross-platform development tool?
  • wxPython Overview
  • Utilities and libraries supplied with wxPython
  • @@ -97,11 +97,11 @@

    Introduction

    This is a guide to the wxPython GUI toolkit, written by a Python programmer for his fellow Python programmers. It began as a -simple translation of the wxWindows documentation (which is written +simple translation of the wxWidgets documentation (which is written for C++ programmers), and evolved from there. And while there's nothing wrong with C++...

    Okay, you got me there. I hate C++. That's why I use Python. If you -like C++, go read the wxWindows documentation. If you'd rather read a +like C++, go read the wxWidgets documentation. If you'd rather read a guide that's written with Python programmers in mind, keep reading this one. If you like it, feel free to send me freshly roasted coffee beans, dark chocolate, and large denomination currency. Better yet, @@ -114,8 +114,8 @@ send one to each of your friends, relatives, and coworkers.

    allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Python extension module (native code) that wraps the -popular wxWindows cross platform GUI library, which is written in C++.

    -

    Like Python and wxWindows, wxPython is Open Source, which means that +popular wxWidgets cross platform GUI library, which is written in C++.

    +

    Like Python and wxWidgets, wxPython is Open Source, which means that it is free for anyone to use and the source code is available for anyone to look at and modify. And anyone can contribute fixes or enhnacments to the project.

    @@ -154,13 +154,13 @@ setups.

    -
    -

    What is wxWindows?

    -

    wxWindows is a C++ framework providing GUI (Graphical User Interface) +

    +

    What is wxWidgets?

    +

    wxWidgets is a C++ framework providing GUI (Graphical User Interface) and other facilities on more than one platform. Version 2 currently supports all desktop versions of MS Windows, Unix with GTK+, Unix with Motif, and MacOS. An OS/2 port is in progress.

    -

    wxWindows was originally developed at the Artificial Intelligence +

    wxWidgets was originally developed at the Artificial Intelligence Applications Institute, University of Edinburgh, for internal use, and was first made publicly available in 1992. Version 2 is a vastly improved version written and maintained by Julian Smart, Robert @@ -171,7 +171,7 @@ variants, unless otherwise stated. All trademarks are acknowledged.

    Why another cross-platform development tool?

    -

    wxWindows was developed to provide a cheap and flexible way to +

    wxWidgets was developed to provide a cheap and flexible way to maximize investment in GUI application development. While a number of commercial class libraries already existed for cross-platform development, none met all of the following criteria:

    @@ -181,13 +181,13 @@ development, none met all of the following criteria:

  • simplicity of programming
  • support for a wide range of compilers
  • -

    Since wxWindows was started, several other free or almost-free GUI +

    Since wxWidgets was started, several other free or almost-free GUI frameworks have emerged. However, none has the range of features, flexibility, documentation and the well-established development team -that wxWindows has.

    -

    As open source software, wxWindows has benefited from comments, ideas, +that wxWidgets has.

    +

    As open source software, wxWidgets has benefited from comments, ideas, bug fixes, enhancements and the sheer enthusiasm of users. This gives -wxWindows a certain advantage over its commercial competitors (and +wxWidgets a certain advantage over its commercial competitors (and over free libraries without an independent development team), plus a robustness against the transience of one individual or company. This openness and availability of source code is especially important when @@ -201,16 +201,16 @@ toolkits such as Motif, GTK+ and MFC.

    overstated, since GUI application development is very time-consuming, and sustained popularity of particular GUIs cannot be guaranteed. Code can very quickly become obsolete if it addresses the wrong -platform or audience. wxWindows helps to insulate the programmer from -these winds of change. Although wxWindows may not be suitable for +platform or audience. wxWidgets helps to insulate the programmer from +these winds of change. Although wxWidgets may not be suitable for every application (such as an OLE-intensive program), it provides access to most of the functionality a GUI program normally requires, plus many extras such as network programming, PostScript output, and HTML rendering; and it can of course be extended as needs dictate. As a bonus, it provides a far cleaner and easier programming interface than the native APIs. Programmers may find it worthwhile to use -wxWindows even if they are developing on only one platform.

    -

    It is impossible to sum up the functionality of wxWindows in a few +wxWidgets even if they are developing on only one platform.

    +

    It is impossible to sum up the functionality of wxWidgets in a few paragraphs, but here are some of the benefits:

    • Low cost (free, in fact!)
    • @@ -281,10 +281,10 @@ Help.

      GUI applications aren't all graphical wizardry. You'll also need lists and hash tables. But since you're working with Python, you should use the ones Python provides (list, tuple, dict), rather than -the wxWindows versions. Same goes for the database related classes. +the wxWidgets versions. Same goes for the database related classes. The basic rule of thumb is this: If you can do it directly in Python, you probably should. If there is a reason not to use a Python data -type, wxPython will provide a wrapper for the wxWindows class.

      +type, wxPython will provide a wrapper for the wxWidgets class.

      You will undoubtedly need some platform-independent file functions, and you may find it handy to maintain and search a list of paths using PathList. There's a miscellany of operating system and other @@ -293,7 +293,7 @@ functions.

    Utilities and libraries supplied with wxPython

    -

    In addition to the core wxWindows library, a number of further +

    In addition to the core wxWidgets library, a number of further libraries and utilities are supplied with each distribution.

    [Need to list these.]

    @@ -305,13 +305,13 @@ allocated with new and deleted with delete. If you delete a window, all of its children and descendants will be automatically deleted, so you don't need to delete these descendants explicitly. -->